Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Caba`drin said:
Alakeram said:
hmm ran into a problem lol, how would i stop hidden factions from declaring war and doing peace treatys until after they rebel? or is there a way to hide those messages until after they rebel?

Set their slot_faction_status to sfs_inactive

when i see  :shock: how easy the code is i feel so amateury :neutral:.... lol :oops: :oops: :oops: :oops:
 
Caba`drin said:
Gulard said:
How do I know what kind of arrow hit the agent?
Trigger ti_on_agent_hit provides
#can only be used in module_mission_templates triggers
# Trigger Param 1: damage inflicted agent_id
# Trigger Param 2: damage dealer agent_id
# Trigger Param 3: inflicted damage
# Register 0: damage dealer item_id
# Position Register 0: position of the blow
#                      rotation gives the direction of the blow

I'm not positive if Reg0's damage dealer item_ID is the weapon hit, or if it is only filled if the damage dealer is a horse...

In any case, you can take trigger param 2's agent_id, get the wielded item and then get the ammo for that wielded item.

You might be able to use the above in conjunction with the item trigger
ti_on_missile_hit        = -52.0 #can only be used in module_items triggers
# Position Register 1: Missile Position
# Trigger Param 1: shooter agent id

but given it doesn't identify the hit agent, it seems of limited usefulness in this instance.
And how to get the ammo? What if agent have 2 kinds of arrows and one bow for example. How to now exactly which king of arrow he has shot.
 
Gulard said:
And how to get the ammo? What if agent have 2 kinds of arrows and one bow for example. How to now exactly which king of arrow he has shot.
Other than on a companion, you will never run into this problem, as the engine will not give an agent more than one item of a single type.

(agent_get_ammo,<destination>,<agent_id>, <value>), #value = 1 gets ammo for wielded item, value = 0 gets ammo for all items
 
Well I've found the answer to one of my previous questions, two are still left unanswered. So, is there code I can change that increases the Skills (Leadership,Iron Flesh etc. etc.) to be  able to go higher then 10? Also, to change the experience gain/limit which file is that in as well? I have just spent sometime searching through pages of results on these two topics. Any help on this would be fantastic.
 
Rotnroller89 said:
Well I've found the answer to one of my previous questions, two are still left unanswered. So, is there code I can change that increases the Skills (Leadership,Iron Flesh etc. etc.) to be  able to go higher then 10? Also, to change the experience gain/limit which file is that in as well? I have just spent sometime searching through pages of results on these two topics. Any help on this would be fantastic.
You can change the max skill level in TweakMB, or you'll find the numbers to change in module_skills. You can only go up to 15.
 
Caba`drin said:
Rotnroller89 said:
Well I've found the answer to one of my previous questions, two are still left unanswered. So, is there code I can change that increases the Skills (Leadership,Iron Flesh etc. etc.) to be  able to go higher then 10? Also, to change the experience gain/limit which file is that in as well? I have just spent sometime searching through pages of results on these two topics. Any help on this would be fantastic.
You can change the max skill level in TweakMB, or you'll find the numbers to change in module_skills. You can only go up to 15.

Cool thanks I must have over looked it when I was going through it when I first looked in there.

What about experience gain/ limit amount? Ex. you need xxxx amount of xp to level up.
 
Rotnroller89 said:
What about experience gain/ limit amount? Ex. you need xxxx amount of xp to level up.
That is governed in the script "game_get_upgrade_xp" for all troops in the game.
Also, there are XP multipliers (for the player, heroes, and normal soldiers respectively) you can change in module.ini

13exa said:
What is Script to make people walk around scenes like in Town or Village?
I want it on Tavern :grin:
Look up the various scripts that deal with "town_walkers"
Essentially they pick an existing entry point, set it as a destination, then set another as a destination and repeat.
 
Caba`drin said:
Rotnroller89 said:
What about experience gain/ limit amount? Ex. you need xxxx amount of xp to level up.
That is governed in the script "game_get_upgrade_xp" for all troops in the game.
Also, there are XP multipliers (for the player, heroes, and normal soldiers respectively) you can change in module.ini

13exa said:
What is Script to make people walk around scenes like in Town or Village?
I want it on Tavern :grin:
Look up the various scripts that deal with "town_walkers"
Essentially they pick an existing entry point, set it as a destination, then set another as a destination and repeat.

Thanks this has been very helpful.
 
Somebody said:
slot_troop_banner_scene_prop means you need a corresponding scene prop referencing your mesh (and a map icon). These must be in the same order for the reference offsets to work properly.
Actually I did.
All I want is to make this compatible for lords not for kings/factions:

      (try_for_range, ":cur_faction", active_npcs_begin, active_npcs_end),
        (faction_get_slot, ":cur_faction_king", ":cur_faction", slot_faction_leader),
        (faction_get_slot, ":cur_faction_banner", ":cur_faction", slot_faction_banner),
        (val_sub, ":cur_faction_banner", banner_meshes_begin),
        (val_add, ":cur_faction_banner", banner_scene_props_begin),
        (troop_set_slot, ":cur_faction_king", slot_troop_banner_scene_prop, ":cur_faction_banner"),
      (try_end),
 
Came up with:
      (try_for_range, ":cur_kingdom_hero", active_npcs_begin, active_npcs_end),
        (troop_get_slot, ":cur_kingdom_hero", ":cur_kingdom_hero", slto_kingdom_hero),
        (troop_get_slot, ":cur_troop_banner", ":cur_kingdom_hero", slot_troop_banner_scene_prop),
        (val_sub, ":cur_troop_banner", banner_meshes_begin),
        (val_add, ":cur_troop_banner", banner_scene_props_begin),
        (troop_set_slot, ":cur_kingdom_hero", slot_troop_banner_scene_prop, ":cur_troop_banner"),
      (try_end),
but still won't work.It shows the old banners
 
Caba`drin said:
Gulard said:
And how to get the ammo? What if agent have 2 kinds of arrows and one bow for example. How to now exactly which king of arrow he has shot.
(agent_get_ammo,<destination>,<agent_id>, <value>), #value = 1 gets ammo for wielded item, value = 0 gets ammo for all items
I'm pretty sure the only way to detect this without using the WSE would be to store the ammo values of each equipment slot in agent slots whenever a quiver is picked up or dropped, then use the new agent_get_ammo_for_slot operation (in warband 1.142) inside the attack trigger of every bow item to see which type was shot (I tried to implement something similar a while back with warband 1.134, and didn't figure out another way).
 
Not sure if agent_has_item_equipped would work on ammo.
ThaneWulfgharn said:
but still won't work.It shows the old banners
Instead of assigning the wrong values in the first place (meshes instead of scene props), just do it right the first time - if your banners aren't next to each other, then just iterate over all the heroes of one faction, set the slot to spr_whatever, and repeat for each faction.
 
I don't get it.I changed it to spr_banner_x from mesh_banner_x that it was still nothing.Say,can we create a new function slot_troop_banner to set the place of slot_troop_banner_scene_prop?
 
Hiya! I got a whole bunch o' questions.

How can I make it so certain compnaions start in the players party? Some troops too.

Is it possible to change a companions name if they are promoted to lordship?

How do I effect how much money is recieved when a town/castle is captured, a party is defeated, or a village sacked?

And taking that one further, if possible I'd love to implement a system simular to medieval 2. When you sieze a town you have the option to Occupy, Loot, or Pillage. Occupy means you get less money but no negative relation. Loot gives you negative relation and knocks the city down a prosperity level, but more money. Pillage makes the population hate you and puts the prosperity level down to very low, but gives you a huge amount of money.
 
Rotnroller89 said:
Caba`drin said:
Rotnroller89 said:
What about experience gain/ limit amount? Ex. you need xxxx amount of xp to level up.
That is governed in the script "game_get_upgrade_xp" for all troops in the game.
Also, there are XP multipliers (for the player, heroes, and normal soldiers respectively) you can change in module.ini

13exa said:
What is Script to make people walk around scenes like in Town or Village?
I want it on Tavern :grin:
Look up the various scripts that deal with "town_walkers"
Essentially they pick an existing entry point, set it as a destination, then set another as a destination and repeat.

Thanks this has been very helpful.

I'm using Module System and hunt a picked through each of the items to look for that game_get_upgrade_xp as well as those multipliers and I didn't find them. Still hunting through topics for any thing related to this. Which file for module system can I go in and edit this?
 
ThaneWulfgharn said:
I don't get it.I changed it to spr_banner_x from mesh_banner_x that it was still nothing.Say,can we create a new function slot_troop_banner to set the place of slot_troop_banner_scene_prop?
Does not matter. As long as you can assign proper scene prop IDs to those slots so the game can understand. Or you will have to rewrite the code.

I'm still not very clear on what you try to archieve. Did you want to assign banner to lords using a loop instead of manually one by one? If so, how many lords and how many banners? Are you including companions?
 
Caba`drin said:
(agent_get_ammo,<destination>,<agent_id>, <value>), #value = 1 gets ammo for wielded item, value = 0 gets ammo for all items
Thanks, (why I have not seen this before?  :eek:)
But <destination> is the item_id or number of arrows?
 
Status
Not open for further replies.
Back
Top Bottom