Wanted Open models and scripts for Warband

Users who are viewing this thread

$ is a global variable, which means you can assign something and call it from any other place in the module system. (Usually used for quest conditions etc.)
: is a local variable, which works the same but can only be called within a single code. (Usually used for storing or getting a slot.)
 
Ruthven said:
$ is a global variable, which means you can assign something and call it from any other place in the module system. (Usually used for quest conditions etc.)
: is a local variable, which works the same but can only be called within a single code. (Usually used for storing or getting a slot.)
Ooh I see, what about the Quotations?  Is that used for referancing an ID?
 
Basically. Put quotations around anything external you're referencing (anything related to that operation that isn't specifically part of it like values and destinations.) You don't need quotations to assign properties (ie making an item have a certain imodbit) or anything from module_constants (like setting a party slot etc) and the like. It's all fairly obvious, and if you aren't sure you can just look at an existing code that has the same operation.
 
Ruthven said:
Basically. Put quotations around anything external you're referencing (anything related to that operation that isn't specifically part of it like values and destinations.) You don't need quotations to assign properties (ie making an item have a certain imodbit) or anything from module_constants (like setting a party slot etc) and the like. It's all fairly obvious, and if you aren't sure you can just look at an existing code that has the same operation.
Ah that's what I generally thought.
 
I will die in four days.


doomn.jpg
 
Initializing...
Traceback (most recent call last):
  File "process_global_variables.py", line 12, in <module>
    from process_operations import *
  File "C:\mod system 720\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\mod system 720\module_scripts.py", line 7881, in <module>
    (eq, ":event_type", multiplayer_event_animation_server),
NameError: name 'multiplayer_event_animation_server' is not defined
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Traceback (most recent call last):
  File "process_map_icons.py", line 6, in <module>
    from process_operations import *
  File "C:\mod system 720\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\mod system 720\module_scripts.py", line 7881, in <module>
    (eq, ":event_type", multiplayer_event_animation_server),
NameError: name 'multiplayer_event_animation_server' is not defined
Exporting faction data...
Exporting item data...
Traceback (most recent call last):
  File "process_items.py", line 66, in <module>
    from process_operations import *
  File "C:\mod system 720\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\mod system 720\module_scripts.py", line 7881, in <module>
    (eq, ":event_type", multiplayer_event_animation_server),
NameError: name 'multiplayer_event_animation_server' is not defined
Exporting scene data...
Traceback (most recent call last):
  File "process_scenes.py", line 15, in <module>
    from process_operations import *
  File "C:\mod system 720\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\mod system 720\module_scripts.py", line 7881, in <module>
    (eq, ":event_type", multiplayer_event_animation_server),
NameError: name 'multiplayer_event_animation_server' is not defined
Exporting troops data
Exporting particle data...
Traceback (most recent call last):
  File "process_scene_props.py", line 7, in <module>
    from process_operations import *
  File "C:\mod system 720\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\mod system 720\module_scripts.py", line 7881, in <module>
    (eq, ":event_type", multiplayer_event_animation_server),
NameError: name 'multiplayer_event_animation_server' is not defined
Traceback (most recent call last):
  File "process_tableau_materials.py", line 8, in <module>
    from process_operations import *
  File "C:\mod system 720\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\mod system 720\module_scripts.py", line 7881, in <module>
    (eq, ":event_type", multiplayer_event_animation_server),
NameError: name 'multiplayer_event_animation_server' is not defined
Traceback (most recent call last):
  File "process_presentations.py", line 8, in <module>
    from process_operations import *
  File "C:\mod system 720\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\mod system 720\module_scripts.py", line 7881, in <module>
    (eq, ":event_type", multiplayer_event_animation_server),
NameError: name 'multiplayer_event_animation_server' is not defined
Exporting party_template data...
Traceback (most recent call last):
  File "process_parties.py", line 6, in <module>
    from process_operations import *
  File "C:\mod system 720\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\mod system 720\module_scripts.py", line 7881, in <module>
    (eq, ":event_type", multiplayer_event_animation_server),
NameError: name 'multiplayer_event_animation_server' is not defined
Exporting quest data...
Exporting info_page data...
Traceback (most recent call last):
  File "process_scripts.py", line 4, in <module>
    from module_scripts import *
  File "C:\mod system 720\module_scripts.py", line 7881, in <module>
    (eq, ":event_type", multiplayer_event_animation_server),
NameError: name 'multiplayer_event_animation_server' is not defined
Traceback (most recent call last):
  File "process_mission_tmps.py", line 5, in <module>
    from module_mission_templates import *
  File "C:\mod system 720\module_mission_templates.py", line 987
    cdvader begin
                ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "process_game_menus.py", line 8, in <module>
    from process_operations import *
  File "C:\mod system 720\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\mod system 720\module_scripts.py", line 7881, in <module>
    (eq, ":event_type", multiplayer_event_animation_server),
NameError: name 'multiplayer_event_animation_server' is not defined
Traceback (most recent call last):
  File "process_simple_triggers.py", line 5, in <module>
    from process_operations import *
  File "C:\mod system 720\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\mod system 720\module_scripts.py", line 7881, in <module>
    (eq, ":event_type", multiplayer_event_animation_server),
NameError: name 'multiplayer_event_animation_server' is not defined
Traceback (most recent call last):
  File "process_dialogs.py", line 9, in <module>
    from process_operations import *
  File "C:\mod system 720\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\mod system 720\module_scripts.py", line 7881, in <module>
    (eq, ":event_type", multiplayer_event_animation_server),
NameError: name 'multiplayer_event_animation_server' is not defined
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\mod system 720\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\mod system 720\module_scripts.py", line 7881, in <module>
    (eq, ":event_type", multiplayer_event_animation_server),
NameError: name 'multiplayer_event_animation_server' is not defined
Exporting postfx_params...




Not sure what I did wrong for the name error to happen. Placed your scripts for animation sync in the events for server and client  for the correct one.  Any ideas on what I did wrong would be helpful, Thank you!
 
I forgot the header_common.py files.

Add multiplayer_event_animation_client = 45 under multiplayer_event_admin_set_anti_cheat and multiplayer_event_animation_server = 105 under multiplayer_event_return_anti_cheat.
 
Thanks. I was thinking that and started reading Yoshi's excellent tuturial.  I have a very beginner problem which I am sure is a just a scripting grammar problem.    This is the error message  from module_mission_templates import *
File "C:\mod system 720\module_mission_templates.py", line 988
  medic_1 = (
          ^

Invalid Syntax. 


The area is right before mission triggers.  Here is how the script transitions


common_siege_assign_men_to_belfry = (
  0, 0, ti_once,
  [
    (call_script, "script_cf_siege_assign_men_to_belfry"),
    ], [])
#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),
])

........





 
Quick-Commands for Modding

I've created a few easy commands to use in Warband modding.

(multiplayer_send_2_int_to_server, multiplayer_event_animation_server, "anim_youranim", ":player"),
This command is to play an animation at an agent. anim_youranim is the animation you want to play, and :player is the player you want your animation to play on.

(multiplayer_send_3_int_to_server, multiplayer_event_skill_server, ":troop", "skl_yourskill", ":value"),
With this command, you can modify a troops skills. :troop is the troop you want to modify, skl_yourskill is the skill you want to change and :value is the value you want the skill to be raised. Note: this will raise a skill. Aka add to the skill, val_add basically. To lower a skill, make a value have a minus, like -5.

(multiplayer_send_2_int_to_server, multiplayer_event_sound_server, ":agent", "snd_yoursound"),
This will play a sound at a agent. :agent is the agent you want to play the sound at, and snd_yoursound is the sound you want to play.

(multiplayer_send_int_to_server, multiplayer_event_display_message_server, s1, ":player"),
And finally, this will display a string to a player. It's pretty self explanatory. s1 is the string you want to display and :player is the player you want to send the string to.

When implementing this, don't forget to make sure the (else_try)'s match.
Thanks to Yoshi for his tutorial.

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"),
			(ge, ":agent", 0),
			(agent_is_alive, ":agent"),
			(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),
		(else_try),
		    (eq, ":event_type", multiplayer_event_skill_server),
			(store_script_param, ":troop", 3),
			(store_script_param, ":skill", 4),
			(store_script_param, ":amount", 5),
			(troop_raise_skill, ":troop", ":skill", ":amount"),
			(get_max_players, ":max"),
			(try_for_range, ":i", 1, ":max"),
			    (player_is_active, ":i"),
				(multiplayer_send_3_int_to_player, ":i", multiplayer_event_skill_client, ":troop", ":skill", ":amount"),
			(try_end),
		(else_try),
		    (eq, ":event_type", multiplayer_event_sound_server),
			(store_script_param, ":agent", 3),
			(store_script_param, ":sound", 4),
			(ge, ":agent", 0),
			(agent_is_alive, ":agent"),
			(agent_play_sound, ":agent", ":sound"),
			(get_max_players, ":max"),
			(try_for_range, ":i", 1, ":max"),
			    (player_is_active, ":i"),
				(multiplayer_send_2_int_to_player, ":i", multiplayer_event_sound_client, ":agent", ":sound"),
			(try_end),
		(else_try),
		    (eq, ":event_type", multiplayer_event_display_message_server),
			(store_script_param, s1, 3),
			(store_script_param, ":player", 4),
			(multiplayer_send_int_to_player, ":player", multiplayer_event_display_message_client, s1),
		#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),
			    (eq, ":event_type", multiplayer_event_skill_client),
				(store_script_param, ":troop", 3),
				(store_script_param, ":skill", 4),
				(store_script_param, ":amount", 5),
				(troop_raise_skill, ":troop", ":skill", ":amount"),
			(else_try),
			    (eq, ":event_type", multiplayer_event_sound_client),
				(store_script_param, ":agent", 3),
				(store_script_param, ":sound", 4),
				(ge, ":agent", 0),
				(agent_is_alive, ":agent"),
				(agent_play_sound, ":agent", ":sound"),
			(else_try),
			    (eq, ":event_type", multiplayer_event_display_message_client),
				(store_script_param, s1, 3),
				(display_message, "@{s1}"),
			(else_try),
			#cdvader end

Code:
#cdvader begin
multiplayer_event_animation_client = 45
multiplayer_event_skill_client = 46
multiplayer_event_sound_client = 47
multiplayer_event_display_message_client = 48
#cdvader end

#cdvader begin
multiplayer_event_animation_server = 105
multiplayer_event_skill_server = 106
multiplayer_event_sound_server = 107
multiplayer_event_display_message_server = 108
#cdvader end
 
tbox, odd. I don't have that kind of problem, however, your script is identical to mine. Try to re-compile.
 
With the troop skill command  did you just find a way in which to lower a player's skill temporarily or the whole troop as in swadian infantry?  Or is it like an add bonus' to weapon or items?  Can you explain maybe a few examples of  how this type of command can be used in game?
 
For some reason, TaleWorlds didn't implement Players as Lords. You know, lord_1, lord_2, lord_3 etc. So it affects the troop as whole (for example, every player as Swadian Infantry will get a boost to the skills).

You will see a example soon, once I finish my Warcry script. The Warcry script utilizes all of the previous quick-commands.
 
cdvader said:
For some reason, TaleWorlds didn't implement Players as Lords. You know, lord_1, lord_2, lord_3 etc. So it affects the troop as whole (for example, every player as Swadian Infantry will get a boost to the skills).

You will see a example soon, once I finish my Warcry script. The Warcry script utilizes all of the previous quick-commands.


Another possibility could be some type of commander class that could use items to increase the team's abilities. Just would have to make sure to val sub the effect after some condition like player death or time maybe.  Cool script for sure. With a good imagination, I am sure it can be even more useful.

Off to American Constitutional law Bar exam review then I will fiddle with your code some more tonight. So far everything seems to be working.  Thanks again and excellent work.
 
This question/advise request  is  regarding Ammo/medic pack and keg pack.  Placing the script into the mission templates and the scripts module.  Can you explain where you need to place it in both with more detail.


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).

  From an ealier post you mention the in mission templates the scripts should be placed right before "tournament triggers" and in the mission template type for the mulitplayer mission.    I did a find tournament triggers and they appear in two spots.  One spot is   
Code:
tournament_triggers = [
  (ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest"),
                                       (assign, "$g_arena_training_num_agents_spawned", 0)]),
  (ti_inventory_key_pressed, 0, 0, [(display_message,"str_cant_use_inventory_arena")], []),
  (ti_tab_pressed, 0, 0, [],
   [(try_begin), 


The other
Code:
 (56, mtef_visitor_source|mtef_team_0, af_override_all, aif_start_alarmed, 1, [itm_practice_sword, itm_practice_shield, itm_padded_cloth, itm_segmented_helmet]),
      (57, mtef_visitor_source|mtef_team_0, af_override_all, aif_start_alarmed, 1, [itm_practice_sword, itm_practice_shield, itm_padded_cloth, itm_segmented_helmet]),
    ],
    tournament_triggers
  ),
Added a little before stuff so you get the idea of where its coming from.

I am having just as much confusion with mission bt area of the mission templates as well when trying to get the code inserted. 


In scripts and and mission templates the code is very contingent and longer then the other modules that have to be edited.  Therefore, I find it hard to not screw something else up in the incersion process.  If someone could give a little explanation on where to place the code in scripts and mission templates for use newbs I would be extremely grateful.


 
For mission templates module editing  for keg and ammo/medic pack you have to place them before "tournament_triggers = ("  in the section,  so right above tournament triggers and exactly below/ after
Code:
common_siege_assign_men_to_belfry = (
  0, 0, ti_once,
  [
    (call_script, "script_cf_siege_assign_men_to_belfry"),
    ], [])

Basically this is the trigger information and all you have to do next is just reference the trigger in each of  multiplayer mission templates (area of code for mulitplayer game types in within overall mission templates module)  To do this search for multiplayer_bt
then scroll down a couple of lines until you see common_battle_init_banner,  then you just add keg_1, keg_2, and ammo_1 and so forth right after and below 
Code:
      common_battle_init_banner,
      keg_1, 
      keg_2,

I wan to thank Yoshi on IRC for clearing this up for me. I hope any other newb/learning coders will find this helpful. 


Also note you will have to also make  a scene prop for each.  Just copy and paste the empty scene prop rename and add a mesh to it.  I would suggest the same one as the item mesh you choose.  If anyone else needs help with this stuff message me and I can try to help as best I can. 
 
Back
Top Bottom