Wanted Open models and scripts for Warband

Users who are viewing this thread

tbox

Sergeant
Hey guys, us  newb modders would love love love some warband related model packs and scripts. If a open script or model can be used a brief explanation on how to apply it would be excellent!  On behalf of all the newb modders thank you!

 
Deathrun's exploding arrows item.

Code:
    ["dr_e_arrows", "Explosive Arrows", [("arrow",0), ("flying_missile",ixmesh_flying_ammo), ("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 0,weight(3)|abundance(160)|weapon_length(95)|thrust_damage(4, pierce)|max_ammo(20), 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_torch_fire", pos1, 100),
				 (get_max_players, ":max"),
				 (try_for_range, ":i", 1, ":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),
		]),
	]],
 
Thank you for sharing this code!

Exploding arrows sound amazing can you briefly explain which module it needs to be put in and how exactly.

I am guessing Items module.py needs to have this in it by the arrows.


["dr_e_arrows", "Explosive Arrows", [("arrow",0), ("flying_missile",ixmesh_flying_ammo), ("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 0,weight(3)|abundance(160)|weapon_length(95)|thrust_damage(4, pierce)|max_ammo(20), imodbits_missile,[/i]

Does all of the code above go in Mission templates?



 
I would love a code to cap player's body spin speed so you cannot jack up mouse sensitivity  and swing your 2 hand sword while twisting your mouse so that your character does  a wind mill swing.
 
tbox, it all goes into module_items.py. Just copy and paste it before the items_end item. Then equip a bow and those arrows and shoot! ;D
 
Wow great.  Now how would I go about changing the particle code.  I would love to make the Arrows make a particle effect that is mist llike, (blood spray) (white Mist increase size smoke arrows) or add the script to the throwing stones to make faux smoke bombs. 
 
In module_particle_systems.py. It's all explained in there in the comments. You can actually make a particle stay/hover for a really long time in one place, but I don't recommend it.. it's heavy on the server.
 
My amature addition to the sharing is a change to torch fire so that the arrow explosion particle effect looks more explosive.  As you can tell by the script its calling for the particle modules particles for torch_fire in module particle system.py file.

Warning this will mess up your torch particle effect for single player. What I think you can do is rename the script for and add a new particle system script so it does not. I don't play single player so I have not changed it.


("torch_fire", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1",
    500, 0.3, 0.2, 0.03, 5.0, 0.0,    #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
    (0.5, 0.:cool:, (1, 0),        #alpha keys
    (0.5, 1.0), (1, 0.9),      #red keys
    (0.5, 0.7),(1, 0.3),      #green keys
    (0.5, 0.2), (1, 0.0),      #blue keys
    (0, 0.9),  (0.4, 0.9),  #scale keys
    (0.2, 0.2, 0.5),      #emit box size
    (0, 0, 0.4),              #emit velocity
    0.0,                      #emit dir randomness
    200,                      #rotation speed
    0.5                        #rotation damping
    )

Those number values make a much improved explosive look. I would say the explosion is not perfect and more like a gas can explosion because the effects don't immediately flash off but shortly.  Way improved from default particle script for use as an explosive or incendiary arrow.
 
That would be really nice if they could. I need to try to get some of the fire arrow mod code to work in warband. My first newb attempt did not work. 
 
cdvader said:
Deathrun's exploding arrows item.

Code:
    ["dr_e_arrows", "Explosive Arrows", [("arrow",0), ("flying_missile",ixmesh_flying_ammo), ("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 0,weight(3)|abundance(160)|weapon_length(95)|thrust_damage(4, pierce)|max_ammo(20), 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_torch_fire", pos1, 100),
				 (get_max_players, ":max"),
				 (try_for_range, ":i", 1, ":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),
		]),
	]],
Any ideas on how to convert the code to make a choking gas arrow.  I would like to have the code make a bigger radius of damage and to deliver damage in the area repetitively if the player is within the area of effect.
 
Kbcamaster said:
Nice script cdvader, grabbing it already, thanks.

Do you know if in Warband the item meshes will be able to emit particle effects again?
I haven't tested yet.. perhaps I should.  :grin:


Anyway, I have created medic/ammo packs. Basically, you throw them somewhere (must be at least 100cm near the ground) and they will "deploy" themselves. They will stay there for 15 seconds. If a player goes nearby a medic package, he will gain 3hp per second. However, if a player goes near a ammo package, he will gain all his ammunation back.

There is only one bug. When the player throws the item, the "real", pick-up able item still stays there. I need Beavers help on this, I'm pretty sure you can't pick up Grenades in Mount & Musket module.

Here are the clean code versions of the scripts (copy-pastying from the Python files to Forum will mess up the code a bit).
http://www.filefront.com/15750587/Medic-Ammo-v2.7z/
http://www.2shared.com/file/11878301/d5a17102/Medic-Ammo_v2.html

Code:
	#cdvader begin
	["medic_pack", "Medic Pack", [("throwing_stone", 0)], itp_type_thrown|itp_primary, itcf_throw_knife, 0, weight(3.5)|spd_rtng(102)|shoot_speed(25)|thrust_damage(0, blunt)|max_ammo(1)|weapon_length(0), imodbits_thrown,
	[
	    (ti_on_missile_hit,
		[
		    (multiplayer_is_server),
			(assign, ":fail", 0),
			(try_begin),
			    (position_get_distance_to_terrain, ":dist", pos1),
				(gt, ":dist", 100),
				(assign, ":fail", 1),
			(try_end),
			(eq, ":fail", 0),
			(position_set_z_to_ground_level, pos1),
			(particle_system_burst, "psys_gourd_smoke", pos1, 100),
			(set_spawn_position, pos1),
			(spawn_scene_prop, "spr_medic_pack", 0),
			(scene_prop_get_num_instances, ":max", "spr_medic_pack"),
			(try_for_range, ":prop", 0, ":max"),
			    (scene_prop_get_instance, ":instance", "spr_medic_pack", ":prop"),
				(party_get_slot, ":active", "p_medic_active", ":instance"),
				(neq, ":active", 1),
				(party_set_slot, "p_medic", ":instance", 20),
				(party_set_slot, "p_medic_active", ":instance", 1),
				(party_set_slot, "p_medic_locked", ":instance", 0),
			(try_end),
		]),
	]],
	
	["ammo_pack", "Ammo Pack", [("throwing_stone", 0)], itp_type_thrown|itp_primary, itcf_throw_knife, 0, weight(3.5)|spd_rtng(102)|shoot_speed(25)|thrust_damage(0, blunt)|max_ammo(1)|weapon_length(0), imodbits_thrown,
    [
	    (ti_on_missile_hit,
		[
		    (multiplayer_is_server),
			(assign, ":fail", 0),
			(try_begin),
			    (position_get_distance_to_terrain, ":dist", pos1),
				(gt, ":dist", 100),
				(assign, ":fail", 1),
			(try_end),
			(eq, ":fail", 0),
			(position_set_z_to_ground_level, pos1),
			(particle_system_burst, "psys_gourd_smoke", pos1, 100),
			(set_spawn_position, pos1),
			(spawn_scene_prop, "spr_ammo_pack", 0),
			(scene_prop_get_num_instances, ":max", "spr_ammo_pack"),
			(try_for_range, ":prop", 0, ":max"),
			    (scene_prop_get_instance, ":instance", "spr_ammo_pack", ":prop"),
				(party_get_slot, ":active", "p_ammo_active", ":instance"),
				(neq, ":active", 1),
				(party_set_slot, "p_ammo", ":instance", 20),
				(party_set_slot, "p_ammo_active", ":instance", 1),
				(party_set_slot, "p_ammo_locked", ":instance", 0),
			(try_end),
		]),
	]],
 	#cdvader end

Code:
#cdvader begin
medic_1 = (
	0.75, 0, 0, [],
	[
	    (multiplayer_is_server),
	    (scene_prop_get_num_instances, ":max", "spr_medic_pack"),
		(try_for_range, ":prop", 0, ":max"),
		    (scene_prop_get_instance, ":instance", "spr_medic_pack", ":prop"),
			(party_get_slot, ":time", "p_medic", ":instance"),
			(gt, ":time", 0),
			(val_sub, ":time", 1),
			(party_set_slot, "p_medic", ":instance", ":time"),
		(try_end),
	])
	
ammo_1 = (
	0.75, 0, 0, [],
	[
	    (multiplayer_is_server),
	    (scene_prop_get_num_instances, ":max", "spr_ammo_pack"),
		(try_for_range, ":prop", 0, ":max"),
		    (scene_prop_get_instance, ":instance", "spr_ammo_pack", ":prop"),
			(party_get_slot, ":time", "p_ammo", ":instance"),
			(gt, ":time", 0),
			(val_sub, ":time", 1),
			(party_set_slot, "p_ammo", ":instance", ":time"),
		(try_end),
	])
	
medic_2 = (
	1, 0, 0, [],
	[
	    (multiplayer_is_server),
		(scene_prop_get_num_instances, ":max", "spr_medic_pack"),
		(try_for_range, ":prop", 0, ":max"),
		    (scene_prop_get_instance, ":instance", "spr_medic_pack", ":prop"),
			(prop_instance_get_position, pos1, ":instance"),
			(try_begin),
			    (party_get_slot, ":time", "p_medic", ":instance"),
				(le, ":time", 0),
				(party_get_slot, ":lock", "p_medic_locked", ":instance"),
				(neq, ":lock", 1),
				(particle_system_burst, "psys_gourd_smoke", pos1, 100),
				(position_move_z, pos1, -750),
				(prop_instance_set_position, ":instance", pos1),
				(party_set_slot, "p_medic_locked", ":instance", 1),
				#(replace_scene_props, ":instance", "spr_empty"), #Not sure if works.
			(try_end),
			(get_max_players, ":max"),
			(try_for_range, ":i", 1, ":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", 300),
					(store_agent_hit_points, ":hp", ":agent", 1),
					(val_add, ":hp", 3),
					(agent_set_hit_points, ":agent", ":hp", 1),
				(try_end),
			(try_end),
		(try_end),
	])
	
ammo_2 = (
	1, 0, 0, [],
	[
	    (multiplayer_is_server),
		(scene_prop_get_num_instances, ":max", "spr_ammo_pack"),
		(try_for_range, ":prop", 0, ":max"),
		    (scene_prop_get_instance, ":instance", "spr_ammo_pack", ":prop"),
			(prop_instance_get_position, pos1, ":instance"),
			(try_begin),
			    (party_get_slot, ":time", "p_ammo", ":instance"),
				(le, ":time", 0),
				(party_get_slot, ":lock", "p_ammo_locked", ":instance"),
				(neq, ":lock", 1),
				(particle_system_burst, "psys_gourd_smoke", pos1, 100),
				(position_move_z, pos1, -750),
				(prop_instance_set_position, ":instance", pos1),
				(party_set_slot, "p_ammo_locked", ":instance", 1),
				#(replace_scene_props, ":instance", "spr_empty"), #Not sure if works.
			(try_end),
			(get_max_players, ":max"),
			(try_for_range, ":i", 1, ":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", 300),
					(agent_refill_ammo, ":agent"),
				(try_end),
			(try_end),
		(try_end),
	])
#cdvader end

Code:
    #cdvader begin
    ("medic",         "medic",        pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners, 0, ai_bhvr_hold, 0, (0., 0), [(trp_looter, 15, 0)]),
	("medic_active",  "medic_active", pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners, 0, ai_bhvr_hold, 0, (0., 0), [(trp_looter, 15, 0)]),
	("medic_locked",  "medic_locked", pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners, 0, ai_bhvr_hold, 0, (0., 0), [(trp_looter, 15, 0)]),
	
	("ammo",          "ammo",         pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners, 0, ai_bhvr_hold, 0, (0., 0), [(trp_looter, 15, 0)]),
	("ammo_active",   "ammo_active",  pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners, 0, ai_bhvr_hold, 0, (0., 0), [(trp_looter, 15, 0)]),
    ("ammo_locked",   "ammo_locked",  pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners, 0, ai_bhvr_hold, 0, (0., 0), [(trp_looter, 15, 0)]),
    #cdvader end
 
Your submissions are excellent thank you very much for doing this for all of us warband modders who don't have the codding skills or experience.  With your explosive arrow code I modded it into a smoke arrow.  So your helping in more ways then just your code. Thank You!
 
tbox said:
cdvader said:
Deathrun's exploding arrows item.

[qoute]
    ["dr_e_arrows", "Explosive Arrows", [("arrow",0), ("flying_missile",ixmesh_flying_ammo), ("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 0,weight(3)|abundance(160)|weapon_length(95)|thrust_damage(4, pierce)|max_ammo(20), imodbits_missile,
[
    (ti_on_missile_hit,  [(play_sound, "snd_man_yell"),

    #pos1 - Missile hit position
#param_1 - Shooter agent
    (try_begin),
    (multiplayer_is_server),
(store_trigger_param_1, ":shooter"),
(particle_system_burst, "psys_torch_fire", pos1, 100),
(get_max_players, ":max"),
(try_for_range, ":i", 1, ":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),
]),
]],


See the area at the top right after (it_on_missle_hit)  for adding sound to explosive arrows.  As you can see for this demonstration I use sound man yell.
 
Ok I had some small stupid errors I fixed but I am drawing a blank on this one.


Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Error: Unable to find object:spr_medic_pack
ERROR: Illegal Identifier:spr_medic_pack
Error: Unable to find object:spr_medic_pack
ERROR: Illegal Identifier:spr_medic_pack
Error: Unable to find object:spr_medic_pack
ERROR: Illegal Identifier:spr_medic_pack
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
 
Wow, I am figured that out right before you post I am creeping myself out with the fact I am learning slowly.  P.S I changed the mesh to an ale keg!
 
GetAssista, it still doesn't work perfectly.

You can spawn a new scene prop, but it still doesn't save it to reg0. That's why I had to do that simple, yet annoying workaround (p_medic_active).
 
cdvader said:
GetAssista, it still doesn't work perfectly.

You can spawn a new scene prop, but it still doesn't save it to reg0. That's why I had to do that simple, yet annoying workaround (p_medic_active).
Given what I have to do now to get dynamic scene props your rant is peanuts :smile:

Does not it spawn as a last instance?? So you can do scene_prop_get_num_instances and use the number as a reference to it in get_scene_prop_instance
 
I made an insta heal throw-able by reversing your explosive arrow code with val add instead of subtract and removed val max, told agent to set hit points to agent and shooter instead of deliver damage.  I wonder if I could do the same thing with your health pack to make an poison gas arrow cloud.  So basically the arrow mesh would be the scene prop and it would val sub instead of val add?


Also medic packs dont seem to work on the thrower/shooter. Maybe you need to add in ":shooter" as well?
 
Back
Top Bottom