How can I go about creating a flame particle on an existing weapon? (ACOK 2.2)

Users who are viewing this thread

Hi everyone, this is really my first time modding for M&B. Yesterday I spent hours learning how to import a texture from one mod to another with Morgh's editor, OpenBRF and even System Module but I'm having some issues getting a particle affect down.

In short: I want to make a sword that constantly emits fire.

I know I can do this by just using similar code to that of a torch.



Code:
["torch",         "Torch", [("club",0)], itp_type_one_handed_wpn|itp_primary, itc_scimitar, 11 , weight(2.5)|difficulty(0)|spd_rtng(95) | weapon_length(95)|swing_damage(11 , blunt) | thrust_damage(0 ,  pierce),imodbits_none,
 [(ti_on_init_item, [(set_position_delta,0,60,0),(particle_system_add_new, "psys_torch_fire"),(particle_system_add_new, "psys_torch_smoke"),(set_current_color,150, 130, 70),(add_point_light, 10, 30),
])]],


I've read several posts that say "just post it after an item like so"

Code:
["Bastard_sword", "Bastard Sword", [("Bastard_Sword",0)], itp_type_two_handed_wpn|itp_primary, itc_bastardsword|itcf_carry_sword_left_hip, 1, weight(1)|difficulty(2)|spd_rtng(110)|weapon_length(119)|swing_damage(90,pierce)|thrust_damage(90,pierce), imodbits_sword_high, [(ti_on_init_item,[(set_position_delta,0,63,0),(particle_system_add_new,"psys_torch_smoke"),(particle_system_add_new,"psys_torch_fire_sparks"),(particle_system_add_new,"psys_fire_glow_1"),(set_current_color,220,180,120),(add_point_light,10,30),])], ],

However my issue is that when I post the code on the weapon I wish to have the particle affect I just get a syntax error.

Please forgive me, this is literally my first time doing any sort of code-related work in my life. I really just want a kickass fire sword. Thanks to all.
 
ACOK is not open source IIRC, which means you do not have the source to change things like that using the Modsys.

You can however do that on the .txt files but it won't as easy.

The particle effects only use operations and constants, so you don't need to worry about variables. Try to compare the .txt generated on native for a torch with and without the effects, and you can copy that to your sword.

Code:
[(ti_on_init_item, [(set_position_delta,0,60,0),(particle_system_add_new, "psys_torch_fire"),(particle_system_add_new, "psys_torch_smoke"),(set_current_color,150, 130, 70),(add_point_light, 10, 30),
])]
^ that is the effect code
 
Hey thanks for replying. Like I said this is my first time actually messing with files on a game outside of very vanilla modding.

So here's what I found. I was able to go into the Native module and open up the item_kinds1.txt and from there I did a CTRL+F and searched for a torch.

I then copied this code:
Code:
-50.000000  5 1955 3 0 60 0 1965 1 1008806316530991114 1965 1 1008806316530991117 1950 3 150 130 70 1960 2 10 30
and pasted it on a weapon in my ACOK 2.2 Module in the file item_kinds1.txt .

Here was the result:

b8e305a344b345ba300c0131f564c189.png


As you can see, it's there kind of, but not really huge.

My next/last question would be: How can I make the particle effect bigger or even change the color on it to resemble something like this. As in, which numbers above do I need to edit or even add to get a similar result to this:

f7c35f2d5408847d13adf19e38e84cfc.png


Thank you!
 
kraggrim said:
Have you tried finding that item in AWOIAF and following the same process you did with the torch?

this. As long the effect code is similar to Native you can copy it from any mod, as it is not using any variables (values you would have to adapt).

You can also follow my initial suggestion: work on Native and create your sword there by editing your .py code. When you are happy copy the result to ACOK.

Code:
[(ti_on_init_item, 
[
  (set_position_delta,0,60,0),
  (particle_system_add_new, "psys_torch_fire"),
  (particle_system_add_new, "psys_torch_smoke"),
  (set_current_color,150, 130, 70),
  (add_point_light, 10, 30),
])]

code is self explanatory. Second line adds the fire effect, which you can check on the file particle_systems.txt (or the .py file). Third is the smoke, 4th the color (RGB) ...

Play with the values and numbers to change the effect.

Code:
add_point_light                             = 1960  # (add_point_light, [flicker_magnitude], [flicker_interval]),
                                                    # Adds a point light source to an object with optional flickering magnitude (range 0..100) and flickering interval (in 1/100th of second). Uses position offset and color provided to previous calls to (set_position_delta) and (set_current_color). Can only be used in item triggers.

set_current_color                           = 1950  # (set_current_color, <red_value>, <green_value>, <blue_value>),
                                                    # Sets color for subsequent calls to (add_point_light) etc. Color component ranges are 0..255.
set_position_delta                          = 1955  # (set_position_delta, <value>, <value>, <value>),
                                                    # Can only be called inside item or scene prop triggers. Sets (X,Y,Z) offsets from the item/prop current position for subsequent calls to (add_point_light) etc. Offsets are apparently in centimeters.
 
I GOT IT WORKING ON NATIVE! Explanation/how to for anyone in the future posted below.

First of all: Thanks to both of you guys. I know it's stupid but I really wanted to create "Lightbringer" for my A Clash of Kings playthrough. I've read every post on the internet looking for help and you guys put me over the top. I wish there was a Reddit gold-esque system on these forums, I'd guild you both.

kraggrim said:
Have you tried finding that item in AWOIAF and following the same process you did with the torch?

When I tried to do that and post the code of the fire sword on my ACOK mod, it would crash.

Fire sword code:
Code:
-50.000000  30 1955 3 0 30 0 1965 1 1008806316530991182 1955 3 0 35 0 1965 1 1008806316530991182 1955 3 0 40 0 1965 1 1008806316530991182 1955 3 0 45 0 1965 1 1008806316530991182 1955 3 0 50 0 1965 1 1008806316530991182 1955 3 0 55 0 1965 1 1008806316530991182 1955 3 0 60 0 1965 1 1008806316530991182 1955 3 0 65 0 1965 1 1008806316530991182 1955 3 0 70 0 1965 1 1008806316530991182 1955 3 0 75 0 1965 1 1008806316530991182 1955 3 0 80 0 1965 1 1008806316530991182 1955 3 0 85 0 1965 1 1008806316530991182 1955 3 0 90 0 1965 1 1008806316530991182 1955 3 0 95 0 1965 1 1008806316530991182 1955 3 0 100 0 1965 1 1008806316530991182

I also compiled and created everything initially in the Module System 1.166 and for whatever reason I would get the effect, but it would only be a small area of the sword.

I was literally doing everything right, and still only a small portion of the flame actually was on my sword.

So what did I do? I went back to a file called particle_systems.txt in the folder that had the Fire Sword (A World of Ice and Fire - Beta 9.5 for anyone curious) and opened the text file and noticed that the particle system file said this:

particle_systemsfile version 1 85

When I checked the particle_systems.txt in my Native folder, I noticed that it said
particle_systemsfile version 1 60

What I did was simply drag the particle system.txt from AWOIAF Beta 9.5 into my Native/ACOK 2.2 folder!

22eb3908489eb96d7a54dbba52e67731.png


Which is exactly what the sword looks like in AWOIAF Beta 9.5!

Now there are still some things I need to figure out: For one, I don't know why changing the particle system number to 85 fixed the problem because I really don't know what the difference between the two are. And #2 when I try and put the fire effect on a 2 Handed sword it works great..buuut when it's on the back I get this silly little glitch:

592fb43fd69b53ecff6046e2eb45f3b5.png




To anyone out there who finds this and wants to do the same thing, all you need to do is open up item_kinds1.txt, find the sword you want to put the effect on, change the second zero to 1:

2ea4d5965dcdaa55c110f9a35ca68a71.png


And then paste this code as shown above:
Code:
-50.000000  30 1955 3 0 30 0 1965 1 1008806316530991182 1955 3 0 35 0 1965 1 1008806316530991182 1955 3 0 40 0 1965 1 1008806316530991182 1955 3 0 45 0 1965 1 1008806316530991182 1955 3 0 50 0 1965 1 1008806316530991182 1955 3 0 55 0 1965 1 1008806316530991182 1955 3 0 60 0 1965 1 1008806316530991182 1955 3 0 65 0 1965 1 1008806316530991182 1955 3 0 70 0 1965 1 1008806316530991182 1955 3 0 75 0 1965 1 1008806316530991182 1955 3 0 80 0 1965 1 1008806316530991182 1955 3 0 85 0 1965 1 1008806316530991182 1955 3 0 90 0 1965 1 1008806316530991182 1955 3 0 95 0 1965 1 1008806316530991182 1955 3 0 100 0 1965 1 1008806316530991182

And that's it!

Thanks again to everyone :smile:


 
Hello there and sorry for resurrecting an old post, but finding this helped me a lot with my own little project.
BTW, that sword looks fantastic!

I was trying to add light (no flame, just light) to a custom made sword (basically a Ravenstern Great Sword but 30% bigger with edited .dds). I followed your idea of adding a single trigger and many "spots" and it helped a lot.

I was wondering if one should put a single trigger for all the "spots" like you did or make one trigger for every "particle". Any opinion about this?
 
One trigger is always better, but the engine only supports so many lights in a scene before the added ones stop working, so it's best to just add one lamp to the sword. (Look at the Volcano Sword in Touhou Gensokyo Warfare for reference)
 
OK i will check them out. Thank you both for the info.
Yeah, at first considered glowing, but then i wanted it to irradiate light. I remember Ianna's sword from Blade of Darkness years ago.
 
@YoItsObama: The glitch happens because when it's holstered, the scabbard/holstered version is initialized and the trigger just activates again. You could try removing the scabbard carry mesh from your sword. You can always justify its disappearance by saying it's magical.

PS. If you want to keep the carry mesh, let's say you create your flame script. Put it into module_scripts and call it from the item trigger, or directly make it the trigger.

Now you need to make sure it's not activated when it's not being wielded. To store the wielding state of the agent, place ti_on_item_wielded and ti_on_item_unwielded triggers into relevant mission templates. Create something like slot_agent_wielding_flame_sword.

[set slot_agent_wielding_flame_sword to 1 for the relevant agent]
[set slot_agent_wielding_flame_sword to 0 for the relevant agent]

The flame script must check if slot_agent_wielding_flame_sword equals 1 for the agent and only then activate the flames.
 
Last edited:
Back
Top Bottom