Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
DarkAngel#1 said:
Thirdly the new skins I added for some reason are listed as female in the characters folder and when menus come up, even though the start up(eg as young life changed - squire etc)  has them as male as well as when courting ladies and such. How can i make them male?
Because If troop_get_type is not equal to 0 (tf_male = 0) most of scripts are consider a given troop as a female. You need to scan module system for troop_get_type.
Also you need to change strings like {he/she} ({lord/lady}, {sir/madam} etc) to string {regx?she:he}, where regx is a gender of the referenced troop.

DarkAngel#1 said:
Fourthly where do you find the codes for naming lords when they defect eg jarl aidan becoming aidan noyan because i would like to change these values.
module_scripts.py
troop_set_title_according_to_faction
troop_set_name

DarkAngel#1 said:
and Finally how do you change the map icons of castles and towns manually because thorgrims map editor doesn't allow me to change icons.
in module_parties.py. Please, read the heading comments in all module_*.py, before asking such questions.
 
AFAIK, string format {maskulin/feminime} always refers to player troop. I solved the problem with this by using troop_set_type at the first start and triggered_event of dialog state checking block, and restore it after dialog, like on simple trigger. I did the similar thing for menus.
 
Lumos said:
Fix your indentation.
Does your script show the "player found" message?
Have you heard of
Code:
[color=navy](player_get_troop_id, <destination>, <player_id>),[/color]
?
1.Yes it shows,
2.Yes i heared.
 
Can I know my mistakes here? (As usual.)

Code:
admin_fly = (
  0, 0, 0, [(multiplayer_get_my_player, "$myplayer"),
            (player_is_active, "$myplayer"),
            (player_get_agent_id, "$myagent", "$myplayer"),
            (agent_is_active, "$myagent"),
            (key_is_down, key_left_control),(key_clicked, key_f),
            (assign, "$flying", 0),
            (assign, "$box_spawned", 0),],

  [   (init_position, pos22),
      (agent_get_position, pos22, "$myagent"),
      (agent_is_alive, "$myagent"),

      (set_spawn_position, pos22),
      (spawn_scene_prop, "spr_invisible_box"),
      (assign, reg0, reg22),

      (init_position, pos32),
      (prop_instance_get_position, pos32, reg22),
     
      (agent_set_position, "$myagent", pos32),
      (agent_set_attached_scene_prop, "$myagent", reg22),
      (agent_set_no_dynamics, "$myagent", 0),

      (position_move_z, pos32, 180,360),
      (prop_instance_set_position, reg22, pos32),
      (assign, reg22, "$reg_prop"),
      (assign, "$box_spawned", 1),
      
    ])

admin_fly_0 = (
  0, 0, 0, [(eq, "$box_spawned", 1),
            (eq, "$flying", 0),
            (scene_prop_has_agent_on_it, "spr_invisible_box", "$myagent"),
            (agent_is_alive, "$myagent"),
            (player_is_active, "$myplayer"),],

  [(init_position, pos12),
    (prop_instance_get_position, pos12, "$reg_prop"),
     (try_begin),
      (game_key_clicked, gk_move_forward),
      (position_move_y, pos12, 10),
      (prop_instance_set_position, "$reg_prop", pos12),
     (else_try),
      (game_key_clicked, gk_move_backward),
      (position_move_y, pos12, -10),
      (prop_instance_set_position, "$reg_prop", pos12),
     (else_try),
      (game_key_clicked, gk_move_left),
      (position_move_x, pos12, 10),
      (prop_instance_set_position, "$reg_prop", pos12),
     (else_try),
      (game_key_clicked, gk_move_right),
      (position_move_x, pos12, -10),
      (prop_instance_set_position, "$reg_prop", pos12),
     (try_end),
   (assign, "$flying", 1),
     
      
    ])

admin_fly_1 = (
  0, 0, 0, [(eq, "$box_spawned", 1),
            (eq, "$flying", 1),
            (scene_prop_has_agent_on_it, "spr_invisible_box", "$myagent"),
            (agent_is_alive, "$myagent"),
            (player_is_active, "$myplayer"),
            (key_is_down, key_left_control),(key_clicked, key_f),],

  [
      (init_position, pos22),
      (agent_get_position, pos22, "$myagent"),
      (agent_set_no_dynamics, "$myagent", 1),
      (position_move_z, pos22, 0, 0),
      (agent_set_position, "$myagent", pos22),

      (init_position, pos32),
      (prop_instance_get_position, pos32, "$reg_prop"),
      (position_move_z, pos32, 0, 0),
      (prop_instance_set_position, "$reg_prop", pos32),

      (agent_get_attached_scene_prop, ":reg_prop", "$myagent")
      (assign, ":reg_prop", -1),
    ])
 
He meant that that you also could read other people posts
http://forums.taleworlds.com/index.php/topic,112639.0.html
 
Rongar said:
He meant that that you also could read other people posts
http://forums.taleworlds.com/index.php/topic,112639.0.html

I wouldnt ask for help before doing thorough research :razz: I found scraps of code here n there, but that was for custom battles, and i need it for ONE map in multiplayer, and i dont know where to insert the code either
 
hey again
I made an error in my questions up above, I did add new skins but I also added new skeletons and Ithink these are what are causing the random body jerking upon death (note that the skeletons all work fine except when a unit is killed)

Also wondering about uploading images can you select an image and upload it from the desktop or documentsand if so how to specifically.

DarkAngel#1

ps. i got the python/module system stuff today so I now know how to change the icons and troops.
Thanks to all replies from before
 
How do I make player's horse death permanent? so if his horse dies in battle its gone forever  :twisted:
 
Gambino said:
How do I make player's horse death permanent? so if his horse dies in battle its gone forever  :twisted:
force remove it from player's inventory.
And don't forget about mtf_synch_inventory flag  that some missions templates may have.
 
Hey, I have something wrong on my code, my equips that i set to my troop when choosing troop only load when i click "Reset to Default" on equipment screen.
I am using troop_add_item, troop_set_inventory_slot,agent_equip_item and agent_unequip item,
example of me using them:
(troop_clear_inventory,":troop"),
        (troop_add_item,":troop","itm_arming_cap"),
        (troop_add_item,":troop","itm_plate_armor"),
        (troop_add_item,":troop","itm_scimitar"),
        (troop_add_item,":troop","itm_courser"),
        (troop_set_inventory_slot, ":troop", ek_head, "itm_arming_cap"),
        (troop_set_inventory_slot, ":troop", ek_body, -1),
        (troop_set_inventory_slot, ":troop", ek_body, "itm_plate_armor"),
        (troop_set_inventory_slot, ":troop", ek_horse, "itm_courser"),
        (troop_set_inventory_slot, ":troop", ek_item_0, "itm_scimitar"),
(troop_set_inventory_slot_modifier, ":troop", 0, 0),
        (agent_unequip_item,":agent","itm_blue_tunic"),
        (agent_equip_item, ":agent", "itm_arming_cap"),
        (agent_equip_item, ":agent", "itm_plate_armor"),
        (agent_equip_item, ":agent", "itm_scimitar"),
        (agent_equip_item, ":agent", "itm_courser"),
        (troop_equip_items,":troop"),
 
Belendor said:
Can I know my mistakes here? (As usual.)
As I said here previously, you can't use local variables without first setting them inside the current operations block! In other words, you can't use multiplayer_get_my_player to store ":myplayer" in a trigger conditions block, then use it in the consequences block. Since you are not using the delay interval with any of your quoted triggers, it is pointless to use both the conditions and consequences blocks - just put all operations in one of them (can depend on whether you want to use the rearm interval or not). I also suggest to put the key_clicked operation first: though it might not matter in this case, to optimize regularly run blocks of code you should put the quickest or most likely to fail checks first; so for this example the player and agent aren't checked and found valid almost every single frame only for the key_clicked operation to fail most of the time, meaning the first operations are mostly wasted.

If you are trying to write code for a multiplayer mod, the previous warnings regarding the need for network messages still apply: unless you fix the design, your features will never work on remote servers.
 
thanks for help, im having another annoying problem now, when i try to remove this line from bottom of the heraldic round shields to make it not heraldic

[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_round_shield_1", ":agent_no", ":troop_no")])]],


( and i also put another mesh for the shield)

but when i do that and compile it gives me an error, it tells me invalid syntax at the last line of module_items.py

whats the solution?

thanks in advance, waiting on-line
 
@Gambino,

[(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_round_shield_1", ":agent_no", ":troop_no")])]],

Remove the blue part only.
 
Has anyone ever worked with enviromental maps for mount and blade before because I tried it on the metal section of the ticket gate and it looks kinda odd from the way I though it would appear. It seems that other enviromental maps are appearing when they shouldn't or is this normal because I don't really nkow about this.

I'll proably just not just an enviromental map in the end and just use iron_shader.

Here's a video of it to see what I mean by this.
http://youtu.be/CMN8YsHDf8Y




 
cmpxchg8b said:
He's using a global variable, not a local one (will probably work, but still fairly bad practice).
Heh, I didn't notice. It will start spewing errors when the player dies and then might try to move other spawned agents reusing that id, but in any case it will only work as the host on a client hosted server, never on a dedicated or remote server (will simply crash with a synchronization error, for a start, unless the spawned prop is not flagged moveable and doesn't move agents around).

Another reminder to anyone interested: unless you are very knowledgeable about multiplayer scripting, never test scripts with the "Host a Game" mode.
 
Status
Not open for further replies.
Back
Top Bottom