Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
How can i make aa scene prop that, on use, kills all bots(!) on the map? And only the bots. It's for An Invasion Mode... Any ideas how to do it?
 
Code:
(ti_on_scene_prop_use, 0, 0, [], 
 [
  (try_for_agents, ":agent"),
      (agent_is_non_player, ":agent"),
   #might need some other checks here about if the agent is active/alive...not sure
      (remove_agent, ":agent"),
    #or, instead of remove agent, use the following
      (agent_set_hit_points, ":agent", 0),
  (try_end),
]),
It would go in your scene_prop code in module_scene_props
 
You need to be more specific here if you want an answere. In the above script the agent is removed and afterwards their hitpoints set to 0. This doesn't make sense, does it? So how does your script look like and what error message do you get?

'Something about the agent' doesn't really say anything.
 
Code:
(ti_on_scene_prop_use, 0, 0, [], 
 [
  (try_for_agents, ":agent"),
      (agent_is_non_player, ":agent"),
      (agent_set_hit_points, ":agent", 0),
  (try_end),
]),

I reduced it to this, and i get no specific error, just: Error in Scene Prop
and then he gives me the lines were ":agent" is standing, and nothing more.
 
Patta said:
Code:
(ti_on_scene_prop_use, 0, 0, [], 
 [
  (try_for_agents, ":agent"),
      (agent_is_non_player, ":agent"),
      (agent_set_hit_points, ":agent", 0),
  (try_end),
]),

I reduced it to this, and i get no specific error, just: Error in Scene Prop
and then he gives me the lines were ":agent" is standing, and nothing more.
Did you put in the list of triggers for a scene prop and close the brackets appropriately?
 
Caba`drin said:
Code:
(ti_on_scene_prop_use, 0, 0, [], 
 [
  (try_for_agents, ":agent"),
      (agent_is_non_player, ":agent"),
   #might need some other checks here about if the agent is active/alive...not sure
      (remove_agent, ":agent"),
    #or, instead of remove agent, use the following
      (agent_set_hit_points, ":agent", 0),
  (try_end),
]),
It would go in your scene_prop code in module_scene_props
Some problems: remove agent causes random crashes in multiplayer - I suggest using agent_deliver_damage_to_agent or agent_fade_out - and is_non_player might kill some horses as well (they are sometimes detected as the mounted player, sometimes not, if I recall correctly). I suggest:
Code:
("kill_agents",spr_use_time(1),"mesh","bo_mesh", [(ti_on_scene_prop_use,
 [(try_for_agents, ":agent_id"),
    (agent_is_non_player, ":agent_id"),
    (agent_is_human, ":agent_id"), # if you don't want to kill any horses
    (agent_is_alive, ":agent_id"),
    (agent_fade_out, ":agent_id"), # the agent will disappear, along with the corpse, items, and mounted horse
    (agent_deliver_damage_to_agent, ":agent_id", ":agent_id", 200), # or else use this, to leave the corpse, items, and horse
  (try_end),
  ])]),
Patta said:
Code:
(ti_on_scene_prop_use, 0, 0, [], 
 [
  (try_for_agents, ":agent"),
      (agent_is_non_player, ":agent"),
      (agent_set_hit_points, ":agent", 0),
  (try_end),
]),

I reduced it to this, and i get no specific error, just: Error in Scene Prop
and then he gives me the lines were ":agent" is standing, and nothing more.
The correct format for that trigger is as above. agent_set_hit_points with 0 never kills the agent; though you could do "(agent_set_hit_points, ":agent", 0), (agent_deliver_damage_to_agent, ":agent_id", ":agent_id", 5)," if you wanted to.
 
As far as I can tell the map textures and the scene textures are the same texture. How would I change it so they are different?
 
Havoc said:
As far as I can tell the map textures and the scene textures are the same texture. How would I change it so they are different?

Do you mean the terrain textures?  If so, module_data/ground_specs.py

Ok, so I've got a question about store_add

Code:
				# (store_add,<destination>,<value>,<value>),

Destination is my variable, in this instance.  So I have a global variable with the store "current_day" and I want to add a number to it (we'll say three.) 

Code:
  (store_current_day, "$blessing"),
  (assign, ":three_day_wait", 3),
  (store_add, "$blessing", ":three_day_wait", 30),

What's the second <value> for?  Can I just leave it empty and let it add 3 with my local variable? 

EDIT:  Nevermind, I checked http://mbcommands.zxq.net/ and it makes sense now.  Destination = Val1+Val2, so in my case, I need to do:

(store_current_day, "$blessing"),
  (assign, ":three_day_wait", 3),
  (store_add, "$blessing", ":$blessing", ":three_day_wait"),

Though, actually, this does away with the need for the local variable.  Nice. 

 
Bolkonsky said:
Code:
  (store_current_day, "$blessing"),
  (assign, ":three_day_wait", 3),
  (store_add, "three", ":cur_day", 30),
What's the second <value> for?  Can I just leave it empty and let it add 3 with my local variable?
That seems a bit muddled: you probably want val_add if you just want to add to an existing variable, like:
Code:
(store_current_day, ":cur_day"),
(val_add, ":cur_day", 3),
store_add would be used like this, to store in a new variable:
Code:
(store_add, ":day_three", "$blessing_day" 3),
 
Vornne said:
Bolkonsky said:
Code:
  (store_current_day, "$blessing"),
  (assign, ":three_day_wait", 3),
  (store_add, "three", ":cur_day", 30),
What's the second <value> for?  Can I just leave it empty and let it add 3 with my local variable?
That seems a bit muddled: you probably want val_add if you just want to add to an existing variable, like:
Code:
(store_current_day, ":cur_day"),
(val_add, ":cur_day", 3),
store_add would be used like this, to store in a new variable:
Code:
(store_add, ":day_three", "$blessing_day" 3),
I ninja edited.  :razz:  I got it.  Thanks anyways! 
 
(Windows 7)
I am trying to run the build_module.bat but i've got the following output:

Initializing...
variables.txt not found. Creating new variables.txt file
Compiling all global variables...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Traceback (most recent call last):
  File "process_global_variables.py", line 106, in <module>
    save_variables(export_dir, variables,variable_uses)
  File "C:\Users\opuri\Desktop\Module_system 1.132\process_operations.py", line
171, in save_variables
    file = open(export_dir + "variables.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundvariables.txt"
Exporting strings...
Traceback (most recent call last):
  File "process_strings.py", line 26, in <module>
    save_strings(strings)
  File "process_strings.py", line 9, in save_strings
    ofile = open(export_dir + "strings.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundstrings.txt"
Exporting skills...
Traceback (most recent call last):
  File "process_skills.py", line 32, in <module>
    save_skills()
  File "process_skills.py", line 15, in save_skills
    ofile = open(export_dir + "skills.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundskills.txt"
Exporting tracks...
Traceback (most recent call last):
  File "process_music.py", line 23, in <module>
    save_tracks()
  File "process_music.py", line 15, in save_tracks
    file = open(export_dir + "music.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundmusic.txt"
Exporting animations...
Traceback (most recent call last):
  File "process_animations.py", line 61, in <module>
    write_actions(animations,len(action_codes),action_codes,"actions.txt")
  File "process_animations.py", line 24, in write_actions
    file = open(export_dir + file_name,"w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundactions.txt"
Exporting meshes...
Traceback (most recent call last):
  File "process_meshes.py", line 25, in <module>
    save_meshes()
  File "process_meshes.py", line 9, in save_meshes
    ofile = open(export_dir + "meshes.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundmeshes.txt"
Exporting sounds...
Traceback (most recent call last):
  File "process_sounds.py", line 51, in <module>
    write_sounds(sound_samples, sounds)
  File "process_sounds.py", line 13, in write_sounds
    ofile = open(export_dir + "sounds.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundsounds.txt"
Exporting skins...
Traceback (most recent call last):
  File "process_skins.py", line 105, in <module>
    export_skins(skins)
  File "process_skins.py", line 45, in export_skins
    ofile = open(export_dir + "skins.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundskins.txt"
Exporting map icons...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_map_icons.py", line 38, in <module>
    save_map_icons(variables,variable_uses,tag_uses,quick_strings)
  File "process_map_icons.py", line 9, in save_map_icons
    ofile = open(export_dir + "map_icons.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundmap_icons.txt"
Exporting faction data...
Traceback (most recent call last):
  File "process_factions.py", line 70, in <module>
    save_factions(relations)
  File "process_factions.py", line 34, in save_factions
    file = open(export_dir + "factions.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundfactions.txt"
Exporting item data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_items.py", line 72, in <module>
    write_items(variables,variable_uses,tag_uses,quick_strings)
  File "process_items.py", line 19, in write_items
    ofile = open(itemkinds_file_name,"w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgrounditem_kinds1.txt"
Exporting scene data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_scenes.py", line 77, in <module>
    save_scenes(variables,variable_uses,tag_uses)
  File "process_scenes.py", line 46, in save_scenes
    ofile = open(export_dir + "scenes.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundscenes.txt"
Exporting troops data
Traceback (most recent call last):
  File "process_troops.py", line 107, in <module>
    save_troops()
  File "process_troops.py", line 13, in save_troops
    file = open(export_dir + "troops.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundtroops.txt"
Exporting particle data...
Traceback (most recent call last):
  File "process_particle_sys.py", line 61, in <module>
    save_particle_systems()
  File "process_particle_sys.py", line 29, in save_particle_systems
    ofile = open(export_dir + "particle_systems.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundparticle_systems.txt"
Exporting scene props...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_scene_props.py", line 32, in <module>
    save_scene_props(variables,variable_uses,tag_uses,quick_strings)
  File "process_scene_props.py", line 10, in save_scene_props
    ofile = open(export_dir + "scene_props.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundscene_props.txt"
Exporting tableau materials data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_tableau_materials.py", line 31, in <module>
    save_tableau_materials(variables,variable_uses,tag_uses,quick_strings)
  File "process_tableau_materials.py", line 11, in save_tableau_materials
    ofile = open(export_dir + "tableau_materials.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundtableau_materials.txt"
Exporting presentations...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_presentations.py", line 33, in <module>
    save_presentations(variables,variable_uses,tag_uses,quick_strings)
  File "process_presentations.py", line 11, in save_presentations
    ofile = open(export_dir + "presentations.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundpresentations.txt"
Exporting party_template data...
Traceback (most recent call last):
  File "process_party_tmps.py", line 46, in <module>
    save_party_templates()
  File "process_party_tmps.py", line 20, in save_party_templates
    file = open(export_dir + "party_templates.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundparty_templates.txt"
Exporting parties
Creating new tag_uses.txt file...
Traceback (most recent call last):
  File "process_parties.py", line 69, in <module>
    save_parties(parties)
  File "process_parties.py", line 12, in save_parties
    file = open(export_dir + "parties.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundparties.txt"
Exporting quest data...
Traceback (most recent call last):
  File "process_quests.py", line 30, in <module>
    save_quests()
  File "process_quests.py", line 9, in save_quests
    ofile = open(export_dir + "quests.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundquests.txt"
Exporting info_page data...
Traceback (most recent call last):
  File "process_info_pages.py", line 26, in <module>
    save_info_pages()
  File "process_info_pages.py", line 9, in save_info_pages
    ofile = open(export_dir + "info_pages.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundinfo_pages.txt"
Exporting scripts...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_scripts.py", line 40, in <module>
    save_scripts(variables,variable_uses,scripts,tag_uses,quick_strings)
  File "process_scripts.py", line 10, in save_scripts
    file = open(export_dir + "scripts.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundscripts.txt"
Exporting mission_template data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_mission_tmps.py", line 64, in <module>
    save_mission_templates(variables,variable_uses,tag_uses,quick_strings)
  File "process_mission_tmps.py", line 38, in save_mission_templates
    file = open(export_dir + "mission_templates.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundmission_templates.txt"
Exporting game menus data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_game_menus.py", line 47, in <module>
    save_game_menus(variables,variable_uses,tag_uses,quick_strings)
  File "process_game_menus.py", line 22, in save_game_menus
    ofile = open(export_dir + "menus.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundmenus.txt"
exporting simple triggers...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_simple_triggers.py", line 24, in <module>
    save_simple_triggers(variables,variable_uses,simple_triggers,tag_uses,quick_
strings)
  File "process_simple_triggers.py", line 8, in save_simple_triggers
    file = open(export_dir + "simple_triggers.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundsimple_triggers.txt"
exporting triggers...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_dialogs.py", line 193, in <module>
    save_triggers(variables,variable_uses,triggers,tag_uses,quick_strings)
  File "process_dialogs.py", line 47, in save_triggers
    file = open(export_dir + "triggers.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundtriggers.txt"
Checking global variable usages...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Exporting postfx_params...
Traceback (most recent call last):
  File "process_postfx.py", line 27, in <module>
    write_postfx_params(postfx_params)
  File "process_postfx.py", line 13, in write_postfx_params
    ofile = open(export_dir + "postfx.txt","w")
IOError: [Errno 13] Permission denied: "C:\\Program Files (x86)\\Mount&Blade War
band\\Modules\\Opuri's Playgroundpostfx.txt"

______________________________

Script processing has ended.
Press any key to exit. . .

Access denied did sound like a lack of admin rights, but running build_module.bat with admin rights will produce the following output:
python: can't open file 'process_init.py': [Errno 2] No such file or directory
python: can't open file 'process_global_variables.py': [Errno 2] No such file or
directory
python: can't open file 'process_strings.py': [Errno 2] No such file or director
y
python: can't open file 'process_skills.py': [Errno 2] No such file or directory

python: can't open file 'process_music.py': [Errno 2] No such file or directory
python: can't open file 'process_animations.py': [Errno 2] No such file or direc
tory
python: can't open file 'process_meshes.py': [Errno 2] No such file or directory

python: can't open file 'process_sounds.py': [Errno 2] No such file or directory

python: can't open file 'process_skins.py': [Errno 2] No such file or directory
python: can't open file 'process_map_icons.py': [Errno 2] No such file or direct
ory
python: can't open file 'process_factions.py': [Errno 2] No such file or directo
ry
python: can't open file 'process_items.py': [Errno 2] No such file or directory
python: can't open file 'process_scenes.py': [Errno 2] No such file or directory

python: can't open file 'process_troops.py': [Errno 2] No such file or directory

python: can't open file 'process_particle_sys.py': [Errno 2] No such file or dir
ectory
python: can't open file 'process_scene_props.py': [Errno 2] No such file or dire
ctory
python: can't open file 'process_tableau_materials.py': [Errno 2] No such file o
r directory
python: can't open file 'process_presentations.py': [Errno 2] No such file or di
rectory
python: can't open file 'process_party_tmps.py': [Errno 2] No such file or direc
tory
python: can't open file 'process_parties.py': [Errno 2] No such file or director
y
python: can't open file 'process_quests.py': [Errno 2] No such file or directory

python: can't open file 'process_info_pages.py': [Errno 2] No such file or direc
tory
python: can't open file 'process_scripts.py': [Errno 2] No such file or director
y
python: can't open file 'process_mission_tmps.py': [Errno 2] No such file or dir
ectory
python: can't open file 'process_game_menus.py': [Errno 2] No such file or direc
tory
python: can't open file 'process_simple_triggers.py': [Errno 2] No such file or
directory
python: can't open file 'process_dialogs.py': [Errno 2] No such file or director
y
python: can't open file 'process_global_variables_unused.py': [Errno 2] No such
file or directory
python: can't open file 'process_postfx.py': [Errno 2] No such file or directory

No se pudo encontrar C:\Windows\system32\*.pyc

______________________________

Script processing has ended.
Press any key to exit. . .


Any ideas what may be causing this?
 
Caba`drin said:
Your folder's admin rights.
Either do your module compiling outside of your Program Files folder, or adjust the rights to your Mount&Blade Warband folder accordingly.

Hadn't thought about that, such simple answers are usually those one needs to be told! Thanks a ton mister!
 
I'm just looking for confirmation on a couple things. 

[+]Global variables values are saved with saved games?
[+]A global variable declared in the start game script won't be redeclared when a game is loaded, correct?
[+]try_end and end_try are the same?  It says deprecated, but will it still work? 
[+]"p_main_party" is the players party?

Thanks. 
 
Bolkonsky said:
[+]Global variables values are saved with saved games?
[+]A global variable declared in the start game script won't be redeclared when a game is loaded, correct?
[+]try_end and end_try are the same?  It says deprecated, but will it still work? 
[+]"p_main_party" is the players party?
1) Yes.
2) Correct.
3) Yes, they are the same. Yes, end_try still works.
4) Yes, it is the player's party.
 
Status
Not open for further replies.
Back
Top Bottom