Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
I have trouble to give merchant my new items.
So I made some new items but I want them only appears in one merchant. "troop_add_merchandise" won't work for item like "itm_...". How can I assign few items to only one merchant?

I have this:
Code:
(store_random_in_range,":new_item", "itm_new_1", "itm_new_5"),
  (troop_clear_inventory, "trp_itm_merchant"),
  (troop_add_merchandise, "trp_itm_merchant", :new_item, 1),
But it's not working like I want.
 
A few questions from me :smile:

1) What script do I use to make a certain center a lord's 'home-base,' without actually giving it to him?
2) How can I force a lord to travel to a center?
3) Can I do #2 and then #1? (basically, make the lord travel to a center then make it his 'home-base')  :eek:

Thanks in advance
 
When I run the build module.bat I get these "Permission Denied" error messages. I am the admin, how do I fix this? (I am on Windows 8 ) I set the bat file to have full permission.
 
I have a script which procedurally initialises merchants and bartenders and other minor NPCs by changing their faces and items. This is supposed to make these NPCs look different without the effort of changing every troop individually. However, currently they all end up looking like quick jimmy, with 0x0000000...00000 face codes, and they retain the items they originally have in module_troops.py Here's a basic psuedocode of what I'm doing at the moment:

try for range with troop
    troop clear inventory

    try blocks with randomisation for different factions and locations
        troop set face keys
        troop set type
        troop add item
    try end

    troop equip items
try end

Is it possible to procedurally delete equipped items? And does the face code require you to do something else other than simply setting the code?
 
Khamukkamu said:
1) What script do I use to make a certain center a lord's 'home-base,' without actually giving it to him?
2) How can I force a lord to travel to a center?
3) Can I do #2 and then #1? (basically, make the lord travel to a center then make it his 'home-base')  :eek:

you set the AI flags for behaviour and object (target), and the engine does the rest

remember AI is recalculated often, so if you force a particular setting for a test you will need to disable that lord from normal scripts (you can use a new slot to track this)
Code:
#slot_faction_ai_state values
sfai_default                   		 = 0 #also defending
sfai_gathering_army            		 = 1
sfai_attacking_center          		 = 2
sfai_raiding_village           		 = 3
sfai_attacking_enemy_army      		 = 4
sfai_attacking_enemies_around_center = 5
sfai_feast             		 		 = 6 #can be feast, wedding, or major tournament
#Social events are a generic aristocratic gathering. Tournaments take place if they are in a town, and hunts take place if they are at a castle.
#Weddings will take place at social events between betrothed couples if they have been engaged for at least a month, if the lady's guardian is the town lord, and if both bride and groom are present


#Rebellion system changes begin
sfai_nascent_rebellion          = 7
#Rebellion system changes end

#slot_party_ai_state values
spai_undefined                  = -1
spai_besieging_center           = 1
spai_patrolling_around_center   = 4
spai_raiding_around_center      = 5
##spai_raiding_village            = 6
spai_holding_center             = 7
##spai_helping_town_against_siege = 9
spai_engaging_army              = 10
spai_accompanying_army          = 11
spai_screening_army             = 12
spai_trading_with_town          = 13
spai_retreating_to_center       = 14
##spai_trading_within_kingdom     = 15
spai_visiting_village           = 16 #same thing, I think. Recruiting differs from holding because NPC parties don't actually enter villages



jacobhinds said:
Is it possible to procedurally delete equipped items? And does the face code require you to do something else other than simply setting the code?

Yes. Nope.

1)
troop inventory includes all slots (gear + bag). However, the clear_inventory operation only removes items from the bag. You need to loop the first few slots, check if there is a item there, and remove it yourself.

only works for heroes

2)
If you are using a face key on a register
Code:
(str_store_string, s1, "@000000000a00000136db6db6db6db6db00000000001db6db0000000000000000"),
note it didn't use the 0x

remember to set both keys (or use the default operation).
 
Khamukkamu said:
Thanks again kalarhan. I think I'm a bit over my head with these AI changes. I'll keep on it though  :ohdear:

Scripts are kind of a mess. What I did to learn (and eventually write my own AI): start with a empty Native, and include AI utilities part by part. That way you can learn all the ins and outs in a couple days (few hours)

you can then experiment with things like you mentioned above: 1) make a lord move to a certain place; 2) make lords follow a lord around; 3) give a attack order against a center; ...
 
Khamukkamu said:
A few questions from me :smile:

2) How can I force a lord to travel to a center?

Thanks in advance
you can look at VC MS to see how it was implemented, basically you have edit a bunch of troop and faction_ai decisions to make the lord to ignore them.
 
Hey friends  :smile: trying to make a mission template trigger using ti_on_agent_killed_or_wounded with a 30 second delay. The code itself works, but even though the delay interval is set to 30s the code fires immediately. Is this because of the ti_on_agent_killed_or_wounded?
 
Ruthven said:
Hey friends  :smile: trying to make a mission template trigger using ti_on_agent_killed_or_wounded with a 30 second delay. The code itself works, but even though the delay interval is set to 30s the code fires immediately. Is this because of the ti_on_agent_killed_or_wounded?
Engine events can't be used in combination with delay parameters.
 
Hey guy, maybe somebody could help: is it possible to change default campaign map camera angle or rotate the map itself? Basically the same thing you can do holding right mouse button, but permanently.
 
Severyn said:
Hey guy, maybe somebody could help: is it possible to change default campaign map camera angle or rotate the map itself?

you can control the zoom (which affects the angle) on module.ini

Code:
 ## WOLRDMAP ZOOM
    map_min_elevation      = 0.2  
    map_max_elevation     = 1.0

to rotate the map you can do that on a 3D software. Of course you will need to update your parties positions too  :mrgreen:
 
Hi guys! Some players of my mod suggested that minor faction parties could capture towns, or castles.

Is it possible to code this not by turning minor faction to major faction? As I recall from Prophesy, minor parties could attack and sack towns, but I dn't have any idea how they did it.

Could you point me out to the general idea, what should be done? Or script's names involved in such action?

Thanks in advance!


One more thing: a long time ago, when I aplied my first race, skeletons I accidentaly broke down RAGDOLL effect. I didn't care, but it turned out, that many peole uses this effect or even make fun of it. Well, thay can make what they like, but I would like to know can I repair it? Maybe it is some simple problem?

link to video wich shows the problem: https://youtu.be/jgGX5vBtff8?t=644
Thanks for help in this matter too.
 
_Sebastian_ said:
Ruthven said:
Hey friends  :smile: trying to make a mission template trigger using ti_on_agent_killed_or_wounded with a 30 second delay. The code itself works, but even though the delay interval is set to 30s the code fires immediately. Is this because of the ti_on_agent_killed_or_wounded?
Engine events can't be used in combination with delay parameters.
Ah, thought so. I'll have to find a workaround then. Cheers.
 
Status
Not open for further replies.
Back
Top Bottom