Particle Effects

Users who are viewing this thread

9jakub9

Sergeant at Arms
Hello, i am working on a magic system for my mod and i am basically (for now) using a rock on fire as a fireball. I have a problem though, the fire effect is only attached to the rock when it is in the hand, i would like to make the projectile be on fire too when thrown, it also would be great to have a lovely fire expolosion effect when the spell hits something/somebody. If you could help me out with this i would be very greatful, thanks!
 
_Sebastian_ said:
Attaching a particle system to a missile only works with WSE atm, except your missile is actually a scene prop.

WSE? Please explain if you can.

EDIT: Hmm i see Warband Script Enhancer. Is it possibble to integrate it into my 1.158 SP mod?
 
You can make an explosion on the ground using a code similar to this, its what i use for my explosive arrows:

Code:
["explo_arrow", "Flaming Arrows", [("harad_arrow",0),("harad_arrow_flying",ixmesh_flying_ammo),("harad_quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 400,weight(3)|abundance(160)|weapon_length(96)|thrust_damage(7, pierce)|max_ammo(8), imodbits_missile,
	[
	    (ti_on_missile_hit,
		[
		    #pos1 - Missile hit position
	            #param_1 - Shooter agent
		    (try_begin),
			    (multiplayer_is_server),
				 (store_trigger_param_1, ":shooter"),
				 (particle_system_burst, "psys_fireplace_fire_small", pos1, 100),
				 (particle_system_burst, "psys_gourd_smoke", pos1, 100),
				 (get_max_players, ":max"),
				 (try_for_range, ":i", 0, ":max"),
				    (player_is_active, ":i"),
					 (player_get_agent_id, ":agent", ":i"),
					 (ge, ":agent", 0),
					 (agent_is_alive, ":agent"),
					 (agent_get_position, pos2, ":agent"),
					 (position_move_z, pos2, 50),
					 (get_distance_between_positions, ":dist", pos1, pos2),
					 (try_begin),
					    (lt, ":dist", 150),
						 (store_agent_hit_points, ":hp", ":agent", 1),
						 (val_sub, ":hp", 10),
						 (val_max, ":hp", 0),
						 (agent_set_hit_points, ":agent", ":hp", 1),
						 (try_begin),
						    (eq, ":hp", 0),
							 (agent_deliver_damage_to_agent, ":shooter", ":agent"),
						 (try_end),
					 (try_end),
				 (try_end),
			 (try_end),
		]),
	]],

Explained:

["explo_arrow", "Flaming Arrows", [("arrow",0),("arrow_flying",ixmesh_flying_ammo),("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 400,weight(3)|abundance(160)|weapon_length(96)|thrust_damage(7, pierce)|max_ammo(:cool:, imodbits_missile,

^My item tuple (in this case you would just make yours a throwing weapon, not an arrow).
instead of ending it with a "]", i keep it opened to add this to it:

          [
    (ti_on_missile_hit,
[

This makes the effect thats under it start when the missile hits an enemy, ground, or etc.

(store_trigger_param_1, ":shooter"), <---the one who shot
(particle_system_burst, "psys_fireplace_fire_small", pos1, 100), <--- pos1 is the position where the missile hit, and it
(particle_system_burst, "psys_gourd_smoke", pos1, 100),        <---- makes a particle effect where pos1 is.


                                (get_max_players, ":max"), <---- Gets the max players on the server
(try_for_range, ":i", 0, ":max"), <--- all below until the next note, tries all players and makes sure they ARE players. (wont work on ai, my mod doesnt deal with ais, but you could find a fix to this, or if you REALLY need, ill look into it. :razz:).
    (player_is_active, ":i"),
(player_get_agent_id, ":agent", ":i"),
(ge, ":agent", 0),
(agent_is_alive, ":agent"),
(agent_get_position, pos2, ":agent"), <--- the belows compare distance to the hit, if they are close to where the hit is, they take dmg.
(position_move_z, pos2, 50),
(get_distance_between_positions, ":dist", pos1, pos2),

                                                (store_agent_hit_points, ":hp", ":agent", 1), <--- this stores the hp from the player hit
(val_sub, ":hp", 10), <---- subtracts dmg from the hp
(val_max, ":hp", 0),
(agent_set_hit_points, ":agent", ":hp", 1), <--- sets the players health to the modified value.
(try_begin),
    (eq, ":hp", 0),
(agent_deliver_damage_to_agent, ":shooter", ":agent"), <--- if player has no hp, give the shooter the kill.
(try_end),

Hoped that helped, if you need more, look at my profile for a link to my steam or pm me here :smile:. Good luck!

P.S. sorry for all the weird indentation, the forum is weird :razz:.
 
Kelthin said:
You can make an explosion on the ground using a code similar to this, its what i use for my explosive arrows:

Code:
["explo_arrow", "Flaming Arrows", [("harad_arrow",0),("harad_arrow_flying",ixmesh_flying_ammo),("harad_quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 400,weight(3)|abundance(160)|weapon_length(96)|thrust_damage(7, pierce)|max_ammo(8), imodbits_missile,
	[
	    (ti_on_missile_hit,
		[
		    #pos1 - Missile hit position
	            #param_1 - Shooter agent
		    (try_begin),
			    (multiplayer_is_server),
				 (store_trigger_param_1, ":shooter"),
				 (particle_system_burst, "psys_fireplace_fire_small", pos1, 100),
				 (particle_system_burst, "psys_gourd_smoke", pos1, 100),
				 (get_max_players, ":max"),
				 (try_for_range, ":i", 0, ":max"),
				    (player_is_active, ":i"),
					 (player_get_agent_id, ":agent", ":i"),
					 (ge, ":agent", 0),
					 (agent_is_alive, ":agent"),
					 (agent_get_position, pos2, ":agent"),
					 (position_move_z, pos2, 50),
					 (get_distance_between_positions, ":dist", pos1, pos2),
					 (try_begin),
					    (lt, ":dist", 150),
						 (store_agent_hit_points, ":hp", ":agent", 1),
						 (val_sub, ":hp", 10),
						 (val_max, ":hp", 0),
						 (agent_set_hit_points, ":agent", ":hp", 1),
						 (try_begin),
						    (eq, ":hp", 0),
							 (agent_deliver_damage_to_agent, ":shooter", ":agent"),
						 (try_end),
					 (try_end),
				 (try_end),
			 (try_end),
		]),
	]],

Explained:

["explo_arrow", "Flaming Arrows", [("arrow",0),("arrow_flying",ixmesh_flying_ammo),("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 400,weight(3)|abundance(160)|weapon_length(96)|thrust_damage(7, pierce)|max_ammo(:cool:, imodbits_missile,

^My item tuple (in this case you would just make yours a throwing weapon, not an arrow).
instead of ending it with a "]", i keep it opened to add this to it:

          [
    (ti_on_missile_hit,
[

This makes the effect thats under it start when the missile hits an enemy, ground, or etc.

(store_trigger_param_1, ":shooter"), <---the one who shot
(particle_system_burst, "psys_fireplace_fire_small", pos1, 100), <--- pos1 is the position where the missile hit, and it
(particle_system_burst, "psys_gourd_smoke", pos1, 100),        <---- makes a particle effect where pos1 is.


                                (get_max_players, ":max"), <---- Gets the max players on the server
(try_for_range, ":i", 0, ":max"), <--- all below until the next note, tries all players and makes sure they ARE players. (wont work on ai, my mod doesnt deal with ais, but you could find a fix to this, or if you REALLY need, ill look into it. :razz:).
    (player_is_active, ":i"),
(player_get_agent_id, ":agent", ":i"),
(ge, ":agent", 0),
(agent_is_alive, ":agent"),
(agent_get_position, pos2, ":agent"), <--- the belows compare distance to the hit, if they are close to where the hit is, they take dmg.
(position_move_z, pos2, 50),
(get_distance_between_positions, ":dist", pos1, pos2),

                                                (store_agent_hit_points, ":hp", ":agent", 1), <--- this stores the hp from the player hit
(val_sub, ":hp", 10), <---- subtracts dmg from the hp
(val_max, ":hp", 0),
(agent_set_hit_points, ":agent", ":hp", 1), <--- sets the players health to the modified value.
(try_begin),
    (eq, ":hp", 0),
(agent_deliver_damage_to_agent, ":shooter", ":agent"), <--- if player has no hp, give the shooter the kill.
(try_end),

Hoped that helped, if you need more, look at my profile for a link to my steam or pm me here :smile:. Good luck!

P.S. sorry for all the weird indentation, the forum is weird :razz:.

Hmmm very interesting, thank you for this i will investigate into it more, could make some bad ass stuff like molotov cocktails :twisted:

BUT! Is there no way to make the fire be attached to the flying projectile? Can i somehow integrate the script enhancer into my mod so that people don't have to download it? Can i set up some auto install feature that installs the needed files? This stuff is urgent to me as i need this for magic effects etc.
 
I dont know about that, you could message Guspav, the creator of the mod "Phantasy" which has quite a bit of magic effects and weapons in there, and ask him about some of the things he did.
 
Kelthin said:
I dont know about that, you could message Guspav, the creator of the mod "Phantasy" which has quite a bit of magic effects and weapons in there, and ask him about some of the things he did.

Thanks a lot, i will contact him.
 
WSE was never updated after 1.153 Warband version, so I'm not sure how it will interact with more recent Warband executable. And if your mod download page starts with "to play this mod, please download and install this obsolete version of Warband first", it isn't going to boost your mod's popularity one bit. :smile:
 
Lav said:
WSE was never updated after 1.153 Warband version, so I'm not sure how it will interact with more recent Warband executable. And if your mod download page starts with "to play this mod, please download and install this obsolete version of Warband first", it isn't going to boost your mod's popularity one bit. :smile:

Well that's unfortunate, thanks for your help though.

Can i at least make my spells make a sound and effect when they hit someone or something? The item already has a particle effect while it is in hand. I tried to experiment using the explosive arrow code and my fire ball item but i only got errors.
 
La Grandmaster said:
just play a sound somewhere in this trigger ti_on_missile_hit

I am getting some syntax error, particle systems are all over me, can i send you a line of code to look at please?
 
[
  (ti_on_missile_hit,
  [
    (particle_system_burst, "particle1", pos1, 100),
  ]),
]),

^Remove the "]" at the end of your items tuple, then place this below it.
 
Kelthin said:
[
  (ti_on_missile_hit,
  [
    (particle_system_burst, "particle1", pos1, 100),
  ]),
]),

^Remove the "]" at the end of your items tuple, then place this below it.

I will test it and reply, thanks.
 
Back
Top Bottom