Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
How is a town/castle "garrison" defined as a location?

i.e. How do I add troops to a garrison from a script?

Also, I have made it so I can recruit a special troop type from my steward:
[trp_steward|plyr, "steward_introduce_2", [],  "I want to recruit a Noble.", "steward_introduce_3",[(troop_join, "trp_noble_recruit"),(troop_remove_gold, "trp_player", 200)]],

How can I make it so there is a limited number of these at any one time? Say once a week I can recruit 10-15 of these units.
 
Okay, how is the destination defined though?

# (party_add_members,<party_id>,<troop_id>,<number>),

what is <party_id>? "$current_town"?

You have been a great help MadVader, I really appreciate you helping learn how to do this.
 
What people do (and so do I) is to look for party_add_members in the code, then copy-paste and modify.
How do you find the town depends on the context, "$current_town" is valid only when the player is visiting the town and not when roaming the map.
 
Okay, it would seem that "$current_town" is the <party_id> I am looking for then if I want to create a script to recruit for that specific castle/town garrison. Correct?

and it would look like this
(party_add_troop, $current_town,  slot_faction_tier_1_troop, :rand)

:rand would be a variable determined by slot_center_player_relation?

Also, I have made it so I can recruit a special troop type from my steward:
[trp_steward|plyr, "steward_introduce_2", [],  "I want to recruit a Noble.", "steward_introduce_3",[(troop_join, "trp_noble_recruit"),(troop_remove_gold, "trp_player", 200)]],

How can I make it so there is a limited number of these at any one time? Say once a week I can recruit 10-15 of these units.

In regards to copy paste modify, lets see if I'm getting this right:
("village_recruit_volunteers_recruit",
    [(party_get_slot, ":volunteer_troop", "$current_town", slot_center_volunteer_troop_type),
    (party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
    (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
    (val_min, ":volunteer_amount", ":free_capacity"),
    (store_troop_gold, ":gold", "trp_player"),
    (store_div, ":gold_capacity", ":gold", 10),#10 denars per man
    (val_min, ":volunteer_amount", ":gold_capacity"),
    (party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"),
    (party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
    (store_mul, ":cost", ":volunteer_amount", 10),#10 denars per man
    (troop_remove_gold, "trp_player", ":cost"),
    ]),
Modified
("steward_recruit_garrison",
    [(party_get_slot, ":volunteer_troop", "$current_town",slot_village_bound_center),
    (party_get_slot, ":volunteer_amount", "$current_town" slot_village_bound_center),
    (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
    (val_min, ":volunteer_amount", ":free_capacity"),
    (store_troop_gold, ":gold", "trp_player"),
    (store_div, ":gold_capacity", ":gold", 10),#10 denars per man
    (val_min, ":volunteer_amount", ":gold_capacity"),
    (party_add_members, "$current_town", ":volunteer_troop", ":volunteer_amount"),
    (party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
    (store_mul, ":cost", ":volunteer_amount", 10),#10 denars per man
    (troop_remove_gold, "trp_player", ":cost"),
    ]),

One of the lines in the modified script needs to pull the troops from the centers bound villages.


 
Somebody said:
Shredzorz said:
Is there any good way of removing or hiding that little thing that displays an agent's name when you look at him/her in multiplayer?
Kill him/her Tried playing with agent relationships?
May I ask what is this "thing", since I've never seen agents' names in MP? Do they appear above below their banner mesh or somewhere else? Or is that the tooltip we're talking about (that only shows if you're near)?
Asking because if there's a built-in presentation overlay or something similar that displays people's names above their heads in MP, I could use it in the future. (Though writing one will probably be a matter of five minutes.)
 
I think he means the tooltips that also show up on usable scene props.
You can toggle them with WSE's [font=consolas,courier](set_show_use_tooltip, <tooltip_type>, [<value>])[/font] or do what Somebody suggested.
 
shokkueibu said:
I think he means the tooltips that also show up on usable scene props.
You can toggle them with WSE's [font=consolas,courier](set_show_use_tooltip, <tooltip_type>, [<value>])[/font] or do what Somebody suggested.
Yeah, I was talking about the tooltip, I just didn't know it was called that. Thanks, that operation is perfect. I was using WSE already anyway, so this works out great.

I almost had to resort to clearing all the troop names and then faking them in some way. I'm glad you guys were able to save me from that. :razz:
 
A question unrelated to nothing, that was born in my mind two minutes before three in the morning while I was browsing some threads here in the Forge. What can we do about the turning speed? If I remember correctly, people in the good old M&B didn't have problems with turning and did not require horse-like arcs of footwork in order to turn around; they could turn on the spot. The inability to do this has long bugged me in Warband. And now, after I remembered of this out of the blue, I shall ask: how do I remove it, and oh, why did they have to hardcode it into the engine (because if it wasn't hardcoded, someone would have done it already)...

Good night, everyone.
 
Somebody said:
They're probably playing with it in 1.155. You could probably make a button that does a backflip or something - plays an animation and turn the agent's position 180.
Actually, after a bit of testing, I noticed that trying to turn around with a bit of A or D pressed gives you much better results than trying the same only with W. I reckon that's enough for me. :smile:

Anyways, two more questions. What's the most reliable way to see if the player's underground (set_z_to_ground_level and then compare wth player's Z?), and is there a way to force shadows not to render on a specific scene prop?

EDIT: Scratch the underground thing, already created something that works.
 
Lumos said:
What's the most reliable way to see if the player's underground (set_z_to_ground_level and then compare wth player's Z?)?

I would also like to know. I'm currently using [font=consolas,courier](position_get_distance_to_terrain, <destination>, <position>),[/font] on the player position and checking for a negative distance. My first thought was using [font=consolas,courier]position_set_z_to_ground_level[/font] as well but then I noticed Lav's operations expanded mentioning it "takes scene props with their collision meshes into account".
 
shokkueibu said:
I would also like to know. I'm currently using [font=consolas,courier](position_get_distance_to_terrain, <destination>, <position>),[/font] on the player position and checking for a negative distance. My first thought was using [font=consolas,courier]position_set_z_to_ground_level[/font] as well but then I noticed Lav's operations expanded mentioning it "takes scene props with their collision meshes into account".
I just came here to scratch that part of my question because I did exactly the same thing, then I noticed you'd answered. :smile:
Perhaps this method is the most reliable one. Seems to work for me every time, so I'm fine with doing that.

And another one, which should be my last: Is calling (init_position) all the time generally a good idea? I'm experiencing some wonky teleportation issues after fiddling with positions, and I think the reason for them is held exactly in my habit of calling init_position often.
 
Status
Not open for further replies.
Back
Top Bottom