Wanted Open models and scripts for Warband

Users who are viewing this thread

tbox, you did add the mission template triggers to a mission template, right? Like how under the multiplayer_bt mission template there are things like medic_1, medic_2, etc.

You have to place the medic_1, medic_2, ammo_1 and ammo_2 right before 'tournament_triggers'. Then put the medic_1 etc to your mission template, like multiplayer_bt (that is the Battle gamemode).
 
GetAssista said:
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

Nope, it doesn't.
 
Hmmm.. I'm not sure what to do here. Everything works expect moving the prop underground. If I move the prop underground, the Server crashes (not the game, it just throws you out of the server) with these errors.

Code:
Error 1
--------------
Assertion failed!
File: e:\develop\mbexp\rgl\rglVec3.h
Line: 699
Expression: v.z - min_value >= 0.0f
--------------

Error 2
--------------
Assertion failed!
File: e:\develop\mbexp\mbnet\../Progra.../networ...uffer.h
Line: 913
Expression: (pos_num_bits == 32) || (vu.z < (unsigned int)(1 << (pos_num_bits + 1)))
--------------

What am I supposed to do with the used props if I can't move them underground?
 
Lol did  you say to put them  there?    I did not I put them at the end and that my be problem.
 
Actually, I found the problem. I had a loop in my script which caused the prop to go down and down and even more downwards each second until it reached the very bottom of the scene and then.. boom, crash.

I'll post the updated code here soon.
 
If I change the time values in a few spots and the lt distance I could make a  explosive  powder keg  with a time delay?

I beleive I hae to:
Increase lt distance  less or equal distance for effect.
change val add to hp to val subtract
Have particles burst later
some how change the time check and make the pro last only until first tick.

So my question is this bascially going to work. And 2ndly what part of your code changes the val add hp delay/trigger.

I am not a coder but I can see the logic progression of your code to a degree of many limited experiance.  I made great smoke arrrows and healing throwing weapons from your last code.
 
To be honest, I never modify my old scripts to create a new purpose for them. It's best if you start it all over again.

I will make a explosive powder keg with a time delay today.
 
cdvader said:
To be honest, I never modify my old scripts to create a new purpose for them. It's best if you start it all over again.

I will make a explosive powder keg with a time delay today.


Spoken like a pro!   


Your scripts are good templates for us newbs! 

If your up to a challenge add  a knock down effect  to the players who are in the aoe area of effect.  That way I can make a concussion powder keg as well!  btw man you rule! I am wondering if you can, how you tell the game to make a player go into a different animation (not including the item  itc_ stuff)?

I am thinking of adding a class to my mod called alchemist who will  throw healing projectiles, medic packs,  and bombs.  Was thinking of dressing him up with the middle eastern open source stuff.    In addition to your explosive arrows , smoke arrows and soon to be choking gas arrows (reverse medic pack with arrow mesh). Your scripts are going to make my mode more unique then originally planed and I appreciate it.

Now I am wishing I knew a good modeller with all these cool scripts to play with!
 
If I were you I'd slow down with all the script requests; I think that even an expert coder like cdvader can get overworked. From now on I'd say you should just ask for some how-to guidelines as opposed to full codes, and if you can't figure something out then it's a little out of your range and you should probably pull back a bit and aim a little lower. Rome wasn't built in a day.
 
Well, it's not like he demands these scripts.  :wink: I like to create and implement these, I find it quite fun. It's also a great chance to improve my scripting skills and logic.

However, Ruthven is right anyway - you should at least read the Jik's ModuleSystem Tutorial. That's where I learned the basics of the ModuleSystem. It'll only take a hour or two.

Anyway. I have updated the first post with scripts. I fixed pretty much all of the bugs.. it's working as it should.

EDIT: I have finished the Keg script (with working animations), but I'm waaaay too tired to post it here right now. Gonna go to sleep and post it tomorrow.
 
Ruthven said:
If I were you I'd slow down with all the script requests; I think that even an expert coder like cadaver can get overworked. From now on I'd say you should just ask for some how-to guidelines as opposed to full codes, and if you can't figure something out then it's a little out of your range and you should probably pull back a bit and aim a little lower. Rome wasn't built in a day.

I think your getting the wrong impression.   Also, I really dislike the "picture you paint" of my actions to the other forum readers.

Not sure how far Jik's tutorial goes but I  know how to do a lot of the beginner stuff.    Hell I taught myself how to edit his code to add sound and change the particle system, added a custom sound for the  script, changed it again for a smoke arrow and  again to make a insta healing throwable  ( with no help or questions).
If you did so much as read the full thread you will see I  gave/added to his explosive arrow script a section for playing a sound and also a change to the particle effect code that is more explosive looking.  I am asking questions and giving script changes I figured out on my own to the forum viewers.  This is clearly not a one way exchange!
I also  pmed to offer him a sound for the explosive arrow script, which was a costume wav file I created by editing two sound files.

Then I asked how do you change the time value of his medic pack script. He volunteered to the do he explosive  powder keg. I was more then willing to alter the medic pack code.  I just was asking for advice how to adjust the time integer. 


Been working on the module system at least 35 hours a week for 3 weeks.  Self taught how to add models, call scripts, troop editing, sound effects, damage interrupt threshold, etc. (Thanks to some small help from Yoshi on irc!) I think you made a misstatement and I hope you exercise more caution before you start piping off your opinion.  2ndly, who are you to tell me who I can talk to and ask questions to ?

Hate to pipe up at someone like these because anyone who knows me in game/vent knows me to be one of the nicer people.  But I don't take kindly to ignorant statements about how I should "act".  I think I have been more then respectful to cad, if you noticed how many times I have thanked him.  I suspect you will now have a digital grudge against me  lol.

 
Silly tbox. If I respected you, I might give a damn about your opinion of me, but whatever.

I suppose I was a little ahead of myself. To me you represent every other starting modder, and since I cba to read through a three-page thread all I saw was codes and "It would be cool ifs" type of thing, which irks me slightly. But there are many like you who can do absolutely ****all and still claim to be modders because they can copy and paste other people's codes and make item codes with everyone else's models. This usually leads to the original creators being ignored and the person who did next to no work getting all the credit. I wouldn't even consider any of my own mods so far to be my own work really, because all I made were some ****ty pseudo codes.

Your english also reminds of the aforementioned rabble, but I know it's not your fault.

Anyways, this part will probably piss you right off, so just note that its just me being a ***** and nothing personal. Yavul?



*****y thoughts reading your post:
"You're", not "your"
Beginner meaning beginner, this ****'s a tad bit beyond that
I don't think there's anything you could add to cdvaders' code that he couldn't if he cared to
Thats lots of modsys hours in just three weeks! Do you get lonely?
All the things you taught yourself how to do are listed off in header_operations or are balls-to-the-wall obvious
I didn't tell you how to act, I said that maybe cdv doesn't like doing all this stuff. But he does so 'sall good I guess. And why would I be cautious about my opinion? This is the internet for god's sake!
"2ndly, who are you to tell me who I can talk to and ask questions to ?" Someone who's been asked questions by people in your position and got really pissed because of it.
I get PMs from people all the time about how to do this and that and I really dislike taking the time to explain it to them, especially since  I know I'll have to do it again. I don't care how many times people thank me, it won't give me back the twenty minutes it took me to write that code or the other hour explaining it. Looks like cdvader's doing this because he likes it though, so meh. Maybe I'd like it too if I didn't think my build_module got mad at me because of all my code errors.
 
Relax.. don't do it..  :razz: tbox, I highly doubt Ruthven was insulting or making fun of you. Both, me and Ruthven, know that there are many "newbs" with very high goals and aims. Knowing Ruthven, I'm sure he was just trying to help you.

Alright, here's the Keg script. The only tricky part was sync'ing the animation (Thank you Yoshi, for your tutorial). Although I did backfire my own statements; I used Medic-Ammo script as a template.  :wink:

Here are the clean-code versions of the script.
http://www.filefront.com/15753761/Keg.7z
http://www.2shared.com/file/11885966/603289fd/Keg.html

Code:
	#cdvader begin
	["keg", "Keg", [("barrel", 0)], itp_type_thrown|itp_primary, itcf_throw_knife, 0, weight(3.5)|spd_rtng(50)|shoot_speed(10)|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", 50),
				(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_keg", 0),
			(scene_prop_get_num_instances, ":max", "spr_keg"),
			(try_for_range, ":prop", 0, ":max"),
			    (scene_prop_get_instance, ":instance", "spr_keg", ":prop"),
				(party_get_slot, ":active", "p_keg_active", ":instance"),
				(neq, ":active", 1),
				(party_set_slot, "p_keg", ":instance", 10),
				(party_set_slot, "p_keg_active", ":instance", 1),
				(party_set_slot, "p_keg_locked", ":instance", 0),
			(try_end),
		]),
	]],
 	#cdvader end
Code:
#cdvader begin
keg_1 = (
    0.50, 0, 0, [],
	[
	    (multiplayer_is_server),
		(scene_prop_get_num_instances, ":max", "spr_keg"),
		(try_for_range, ":prop", 0, ":max"),
		    (scene_prop_get_instance, ":instance", "spr_keg", ":prop"),
			(party_get_slot, ":time", "p_keg", ":instance"),
			(gt, ":time", 0),
			(val_sub, ":time", 1),
			(party_set_slot, "p_keg", ":instance", ":time"),
		(try_end),
	])
	
keg_2 = (
    0.75, 0, 0, [],
	[
	    (multiplayer_is_server),
		(scene_prop_get_num_instances, ":max", "spr_keg"),
		(try_for_range, ":prop", 0, ":max"),
		    (scene_prop_get_instance, ":instance", "spr_keg", ":prop"),
			(prop_instance_get_position, pos1, ":instance"),
			(try_begin),
			    (party_get_slot, ":time", "p_keg", ":instance"),
				(le, ":time", 0),
				(party_get_slot, ":lock", "p_keg_locked", ":instance"),
				(neq, ":lock", 1),
				#(play_sound, "snd_kaboom"),
				(particle_system_burst, "psys_village_fire_big", 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", 300),
					    (try_begin),
					        (neg|position_is_behind_position, pos1, pos2),
					        (multiplayer_send_2_int_to_server, multiplayer_event_animation_server, "anim_keg_chest_front", ":i"),
					    (else_try),
					        (multiplayer_send_2_int_to_server, multiplayer_event_animation_server, "anim_keg_body_back", ":i"),
					    (try_end),
					    (store_agent_hit_points, ":hp", ":agent", 1),
					    (store_random_in_range, ":rand", 10, 30),
					    (val_sub, ":hp", ":rand"),
					    (val_max, ":hp", 0),
					    (agent_set_hit_points, ":agent", ":hp", 1),
					    (try_begin),
					        (eq, ":hp", 0),
						    (agent_deliver_damage_to_agent, ":agent", ":agent"),
					    (try_end),
				    (try_end),
			    (try_end),
				(position_move_z, pos1, -750),
				(prop_instance_set_position, ":instance", pos1),
				(party_set_slot, "p_keg_locked", ":instance", 1),
			(try_end),
		(try_end),
	])
#cdvader end
Code:
    #cdvader begin	
	("keg",           "keg",         pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners, 0, ai_bhvr_hold, 0, (0., 0), [(trp_looter, 15, 0)]),
	("keg_active",   "keg_active",   pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners, 0, ai_bhvr_hold, 0, (0., 0), [(trp_looter, 15, 0)]),
    ("keg_locked",   "keg_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

Code:
    #cdvader begin
 ["keg_chest_front", acf_enforce_all|acf_align_with_ground|acf_lock_camera, amf_priority_die|amf_accurate_body|amf_client_prediction,
   [1.0, "death_chest", 4, 37, arf_blend_in_16|arf_make_custom_sound, pack2f(0.9, 0.0), (0,0,0), 0.5],
 ],
 
 ["keg_body_back", acf_enforce_all|acf_align_with_ground|acf_lock_camera, amf_accurate_body|amf_client_prediction,
   [2.7, "death", 0, 83, arf_blend_in_16|arf_make_custom_sound, pack2f(0.47, 0.82), (0,0,0), 1.8], 
 ],
    #cdvader end

Animation Sync'ing
Code:
		#cdvader begin
		(else_try),
		    (eq, ":event_type", multiplayer_event_animation_server),
			(store_script_param, ":anim", 3),
			(store_script_param, ":player", 4),
			(player_get_agent_id, ":agent", ":player"),
			(agent_set_animation, ":agent", ":anim"),
			(get_max_players, ":max"),
			(try_for_range, ":i", 1, ":max"),
			    (player_is_active, ":i"),
				(multiplayer_send_2_int_to_player, ":i", multiplayer_event_animation_client, ":anim", ":player"),
			(try_end),
		#cdvader end
Code:
		    #cdvader begin
			    (eq, ":event_type", multiplayer_event_animation_client),
				(store_script_param, ":anim", 3),
				(store_script_param, ":player", 4),
				(player_get_agent_id, ":agent", ":player"),
				(ge, ":agent", 0),
				(agent_is_alive, ":agent"),
				(agent_set_animation, ":agent", ":anim"),
			(else_try),
			#cdvader end

Then, to use it, simply call this: (multiplayer_send_2_int_to_server, multiplayer_event_animation_server, "anim_youranim", ":player"),.

Thanks,
cdvader.
 
Ruth, I want you to know from the age of 5  I was diagnosed with learning disabilities that include executory function disorder which among other things impacts spelling and grammar.  The reason for my disabilities are questionable from 3 causes.  Genetics, agent orange exposure by my father a veteran, and or the result of aesteshia used when I was a infant in need of life saving surgery.  So you're  poking fun at person who is certified disabled over the course of 25 years of testing by countless  PhD's and MD neurologists.  All the models I have ever used are open source or with permission.  Furthermore, the definition of modding is not contingent upon making every aspect of the mod unique,  but deals with many aspects and can include but is not limited too rearranging or making new things out of common parts as to present a new total package.  Copying Cad's code or changing is an learning experience, and I am for ever thankful for what he has provided me.    Learning and manipulating ones work is a core essential element to learning creating new.  Toyota did not reinvent the car with a new car.      Cdv's codes have taught me a lot about scripting in warband, and I appreciate that to a high degree and that is why I find your comments increasing offensive and down right rude. 


 
Animation Sync'ing
Code: ( module_scripts.py (Server Events)) [Select]
      #cdvader begin
      (else_try),
          (eq, ":event_type", multiplayer_event_animation_server),
        (store_script_param, ":anim", 3),
        (store_script_param, ":player", 4),
        (player_get_agent_id, ":agent", ":player"),
        (agent_set_animation, ":agent", ":anim"),
        (get_max_players, ":max"),
        (try_for_range, ":i", 1, ":max"),
            (player_is_active, ":i"),
            (multiplayer_send_2_int_to_player, ":i", multiplayer_event_animation_client, ":anim", ":player"),
        (try_end),
      #cdvader end
Code: ( module_scripts.py (Client Events)) [Select]
          #cdvader begin
            (eq, ":event_type", multiplayer_event_animation_client),
            (store_script_param, ":anim", 3),
            (store_script_param, ":player", 4),
            (player_get_agent_id, ":agent", ":player"),
            (ge, ":agent", 0),
            (agent_is_alive, ":agent"),
            (agent_set_animation, ":agent", ":anim"),
        (else_try),
        #cdvader end

Then, to use it, simply call this: (multiplayer_send_2_int_to_server, multiplayer_event_animation_server, "anim_youranim", ":player"),.


What do you mean to simply call this : (multiplayer_send_2_int_to_server, multiplayer_event_animation_server, "anim_youranim", ":player"),"    I am not exactly sure what "This" is referring to and where to place it.  I appreciate any light you could shed on my confusion.  Thanks!
 
I have already included the command (((multiplayer_send_2_int_to_server, multiplayer_event_animation_server, "anim_youranim", ":player"),) in the Keg script, but you can always use it for anything else.

Absolutely anything else. Whenever you might want to play a animation on someone, you can simply just call (multiplayer_send_2_int_to_server, multiplayer_event_animation_server, "anim_youranim", ":player"), and the animation will play on the :player and everyone else will see it.
 
Ok, so in essence it is the "animation ID" or referencing phrase akin to a books ISBN number, or a car's vin number or a home address.  Thank you for the clarification.
 
What do these symbols do?  Don't tell me what the code I posted does, just the symbols.  I've never done any scripting but I want to learn.

ex. "$g_multiplayer_point_gained_from_flags"
and, ":faction_index"
 
Back
Top Bottom