Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
NPC99 said:
Any helmets or armour flagged as itp_civilian in module_items.py can be worn inside. A lot of mods flag all armours as itp_civilian to stop Lords without a secondary set of civilian clothes appearing naked indoors.

Thank you very much. That worked perfectly for the lords, but the player character still unequips. Any ideas?
 
SatoriLotus said:
NPC99 said:
Any helmets or armour flagged as itp_civilian in module_items.py can be worn inside. A lot of mods flag all armours as itp_civilian to stop Lords without a secondary set of civilian clothes appearing naked indoors.

Thank you very much. That worked perfectly for the lords, but the player character still unequips. Any ideas?

See reply 3 https://forums.taleworlds.com/index.php/topic,283550.msg6745216.html#msg6745216
 
I'm trying to add new sounds to a module. 11 to be precise but only about 4 of them work, while the others make the game crash during battle. The thing is they shouldn't be crashing at all. They are all:
- ogg
- around 100kbps
- mono
- 44k Hz
Technically they should be working, and what's even weirder is that if I just take one of the sounds which ARE working like, let's say, new_sound_1, and just copy it and rename it to new_sound_2, new_sound_3 etc instead of using the other ones, the game still crashes.
This makes no sense at all.
 
I was working on a role play module before, and the oog sounds were corrupted and caused crashes. Get audacity, and re-export them.
 
benis said:
I'm trying to add new sounds to a module. 11 to be precise but only about 4 of them work, while the others make the game crash during battle. The thing is they shouldn't be crashing at all. They are all:
- ogg
- around 100kbps
- mono
- 44k Hz
Technically they should be working, and what's even weirder is that if I just take one of the sounds which ARE working like, let's say, new_sound_1, and just copy it and rename it to new_sound_2, new_sound_3 etc instead of using the other ones, the game still crashes.
This makes no sense at all.

Try using one if the WAV formats in reply 8 https://forums.taleworlds.com/index.php/topic,174213.0.html

 
I'll try changing them all to wav with audacity (and rename them to .wav in the txt) and see if that works, thanks.
 
benis said:
benis said:
I'll try changing them all to wav with audacity (and rename them to .wav in the txt) and see if that works, thanks.

No cigar.  :evil:

Well so far I tried:
- Converting to WAV 16bit mono 44k Hz, 22k Hz and 11k Hz
- Disabling sound variation in the "Configure" menu
- Taking out the sounds I knew were causing problems and putting re-named sounds that I knew were working in their place to test

Nothing worked, only disabling sounds completely kept the game from crashing, but then what would be the point?
 
This again. :sad:
The previous replys did not help. :sad:

alkaiq said:
Hello!

I just started modding and I have been trying to figure out how to find out the correct <slot_no> of multiplayer players' equipement.

E.g. we all have 4 inventory slots for melee/ranged items. How do I know what is the <slot_no> of a particular item (for example, the most top slot)?

Thanks in advance,
Carpra

Edit: I'm trying to change a particular slot's contents with a script. If it is even possible...

Namakan said:
Could just try using this(obviously before the players agent is spawned):

Code:
player_add_spawn_item                        =  410  # (player_add_spawn_item, <player_id>, <item_slot_no>, <item_id>),
                                                     #
with item_slot_no being one of these:
Code:
ek_item_0 = 0
ek_item_1 = 1
ek_item_2 = 2
ek_item_3 = 3
ek_head   = 4
ek_body   = 5
ek_foot   = 6
ek_gloves = 7
ek_horse  = 8
ek_food   = 9
 
alkaiq said:
This again. :sad:
The previous replys did not help. :sad:

alkaiq said:
Hello!

I just started modding and I have been trying to figure out how to find out the correct <slot_no> of multiplayer players' equipement.

E.g. we all have 4 inventory slots for melee/ranged items. How do I know what is the <slot_no> of a particular item (for example, the most top slot)?

Thanks in advance,
Carpra

Edit: I'm trying to change a particular slot's contents with a script. If it is even possible...

Namakan said:
Could just try using this(obviously before the players agent is spawned):

Code:
player_add_spawn_item                        =  410  # (player_add_spawn_item, <player_id>, <item_slot_no>, <item_id>),
                                                     #
with item_slot_no being one of these:
Code:
ek_item_0 = 0
ek_item_1 = 1
ek_item_2 = 2
ek_item_3 = 3
ek_head   = 4
ek_body   = 5
ek_foot   = 6
ek_gloves = 7
ek_horse  = 8
ek_food   = 9

How it didnt helped? Whats wrong? Becouse for me it looks like answer for your question.
 
-MaveRick- said:
I want to change party speed in the map. How can I do it?

use script "script_game_get_party_speed_multiplier". It applies the modifiers (% value) to increase/decrease the speed of any party.

You can see a example of this on VC modsys.
 
kalarhan said:
-MaveRick- said:
I want to change party speed in the map. How can I do it?

use script "script_game_get_party_speed_multiplier". It applies the modifiers (% value) to increase/decrease the speed of any party.

You can see a example of this on VC modsys.

very thanks kalarhan.
I want select "20" count of 'trp_swadian_knight' and give them "shield" animation. How can I do?
this is an incomplete script:


Code:
   (store_current_scene, ":cur_scene"),
   (scene_get_slot, ":slot", slot_scene_number_troops, ":cur_scene"),

slot_scene_number_troops = 20

How can I do this? Any things?
 
I think you misunderstood what slots are. Slots are like an array of spaces you can store information. Parties have slots, troops have slots, players in multiplayer have slots, agents in every scene has slots, etc. when you are grabbing from slot 20, it doesn't return 20, it returns the value stored in slot 20. This value is -1 if you haven't assigned anything to it yet.
 
Ramaraunt said:
I think you misunderstood what slots are. Slots are like an array of spaces you can store information. Parties have slots, troops have slots, players in multiplayer have slots, agents in every scene has slots, etc. when you are grabbing from slot 20, it doesn't return 20, it returns the value stored in slot 20. This value is -1 if you haven't assigned anything to it yet.

No I know it. Bu there is no other way. At least, to my knowledge.

 
If you want to select the number of troops in a scene you need something like this:

Code:
(try_for_agents, ":agent"),
   (agent_get_troop_id, ":troop", ":agent"),
   (eq, ":troop", "trp_swadian_knight"),
(try_end),

Notice how agents and troops are different. Agents are the individuals who exist and get spawned in a scene, while a troop is just a data set containing their name, skills, and a list of weapons they can spawn with. If you want to do anything with agents you need to cycle between all of them using try_for_agents first.
 
Jacobhinds said:
If you want to select the number of troops in a scene you need something like this:

Code:
(try_for_agents, ":agent"),
   (agent_get_troop_id, ":troop", ":agent"),
   (eq, ":troop", "trp_swadian_knight"),
(try_end),

Notice how agents and troops are different. Agents are the individuals who exist and get spawned in a scene, while a troop is just a data set containing their name, skills, and a list of weapons they can spawn with. If you want to do anything with agents you need to cycle between all of them using try_for_agents first.

All right. I know but I want select at a certain number? For example, "select 20 count swadian knight and use "agent_set_division" assign there , ":firstcohort", Is this possible? (sorry for my bad eng)
 
You'll have to set a counter within the try_for_agents so that it stops after 20 swadian knights.

Code:
(assign, ":number_of_swadian_knights", 0),

(try_for_agents, ":agent"),
   (le, ":number_of_swadian_knights", 20),
   (agent_get_troop_id, ":troop", ":agent"),
   (eq, ":troop", "trp_swadian_knight"),
   (val_add, ":number_of_swadian_knights", 1),
(try_end),
This loop stops running once ":number_of_swadian_knights" reaches 20. Here's a "verbal" version of this script to explain what I mean:

Code:
Set the swadian knight counter to 0.

Run this script for all the agents until there are no agents left.
  if the swadian knight counter is less than 20, continue.
  what troop is the agent using? 
  if is it a swadian knight, continue.
  add one to the swadian knight counter.
Go back to the top of this block until there are no agents left.

Try reading tutorials and looking at the code in native to help you understand how this stuff works. If you try to guess you'll end up getting confused.

For example your ":firstcohort" won't allow you to assign anything to a division. Values beginning in : are local variables which are just numbers you can change in the script. Have a look at the Native mission templates and have a look at where agent_set_division gets used.
 
Status
Not open for further replies.
Back
Top Bottom