Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
jacobhinds said:
Lords recruit small "reinforcement" groups of 5-10 men every day or so - there are three for each faction. The problem with giving them another faction's troops is that soldiers tend to stay in lord's armies for just as long as in the player's. So unless you could somehow write a script to remove non-faction troops once a war ends (potentially unbalancing unless they're replaced), every lord is just going to go round with a mishmash of everyone before long.

Depending on what kind of mod you're trying to make, you could try and make alliances and wars last longer by making the triggers for declarations of war fire less often. <- there's most likely a far better solution for this, though.
The eventual mod concept would be a Warcraft conversion, so a "mishmash" of everyone would be appropriate in-world.  Obviously that mod is quite a ways off, but I want some basic systems to work before I'd ask for any art help.  Rewriting strings and making the map is where I'm starting, but I'm conceptualizing some deeper gameplay mechanics before I decide where to take the mod.
 
Two questions:

1. how do I make items appear in the marketplaces of factions I've created? they'e completely empty at the moment, with the exception (iirc) of the goods department.

2. how do I create factions with varying levels of lords without messing up the family tree generator? currently the player is related to the lords of factions with irregular numbers of lords (i.e. not 20).
I'm not bothered if I'm limited to numbers like 10 or 5, I just want to be able to give some factions fewer lords.
 
For the first question: Have you looked at this tutorial?

For the second question: I guess you have to set the family generation "by hand" instead of using a randomised loop like in native. Brytenwalda has factions of vastly different sizes, and they set their family relations by hand in script "initialize_aristocracy". Example:
Code:
     (troop_set_slot, "trp_knight_1_1", slot_troop_spouse, "trp_kingdom_1_lady_1"),
     (troop_set_slot, "trp_kingdom_1_lady_1", slot_troop_spouse, "trp_knight_1_1"),
     (troop_set_slot, "trp_kingdom_1_lady_2", slot_troop_father, "trp_knight_1_1"),
     (troop_set_slot, "trp_kingdom_1_lady_2", slot_troop_mother, "trp_kingdom_1_lady_1"),
     (troop_set_slot, "trp_kingdom_1_lady_3", slot_troop_guardian, "trp_knight_1_2"),

     (troop_set_slot, "trp_knight_2_2", slot_troop_spouse, "trp_kingdom_2_lady_1"),
     (troop_set_slot, "trp_kingdom_2_lady_1", slot_troop_spouse, "trp_knight_2_2"),
     (troop_set_slot, "trp_kingdom_2_lady_2", slot_troop_mother, "trp_kingdom_2_lady_1"),
     (troop_set_slot, "trp_kingdom_2_lady_2", slot_troop_father, "trp_knight_2_2"),
     (troop_set_slot, "trp_knight_2_3", slot_troop_spouse, "trp_kingdom_2_lady_3"),
     (troop_set_slot, "trp_kingdom_2_lady_3", slot_troop_spouse, "trp_knight_2_3"),

An alternative would be to break down the random generation loop from native into sections for each faction with a check for the faction and assigning random values vor each faction separately within their range of existing lords and ladies. If two factions have the same amount of lords/ladies you could have one case for all of them.
 
jacobhinds said:
Thank you for those. I couldn't make head nor tail of initialize_aristocracy, it made my puny little brain hurt.
It'd make far more sense in my mod, too - I've got lords who I'd like to have as part of a family without the game making weird choices for me.
Glad I could help. I am very excited to see your mod!
 
Is there any way to get a player's ip without using any 3rd program, if you have access to the dedicat console?

Also can someone explain me why spawned scene props's instance id aren't increasing 1 by 1? From my observation, this was happening: last instance id was 420, then after spawning a scene prop, the id was 460, then 459, then 458 and so on until it reach 441, then it jumps to 480, then 479, 478 ... 461, then 500, 499, 498 and so on... What is the advantage of using such a method? Why not simply incrementing the last instance id? (I am only curious about this)
 
I'm not asking for any code (though I wouldn't mind a bit), but how would one approach implementing a heredity-old age system into Warband? So, ignoring the obscene amount of time the player would need to have played, say the character has lived for 50 years. By script he dies of old age, but, rather than game over, the player is given the option of taking control of one of the dead character's offspring. These offspring are produced through marriage.

If explanation would be too much; on a scale of 1-10, how possible would this be?
 
If it's just a matter of changing player stats, equipment and face, i can't see why that'd be too hard, as it's been done before via lord execution. Can't remember the exact mod, though.

You'd have to set a trigger that fires randomly between 20 and 30 years later, and get it to fire a few scripts that'd set your age, perhaps change your name, and change your face (not sure how that could be done). Other stuff like equipment would be simple. There are tons of examples of it in the code.
 
The_dragon said:
Is there any way to get a player's ip without using any 3rd program, if you have access to the dedicat console?

Also can someone explain me why spawned scene props's instance id aren't increasing 1 by 1? From my observation, this was happening: last instance id was 420, then after spawning a scene prop, the id was 460, then 459, then 458 and so on until it reach 441, then it jumps to 480, then 479, 478 ... 461, then 500, 499, 498 and so on... What is the advantage of using such a method? Why not simply incrementing the last instance id? (I am only curious about this)
It's either reusing instances after culling other objects or incrementing the size of the reference array, 20 at a time.
Sêrachim said:
I'm not asking for any code (though I wouldn't mind a bit), but how would one approach implementing a heredity-old age system into Warband? So, ignoring the obscene amount of time the player would need to have played, say the character has lived for 50 years. By script he dies of old age, but, rather than game over, the player is given the option of taking control of one of the dead character's offspring. These offspring are produced through marriage.

If explanation would be too much; on a scale of 1-10, how possible would this be?
You can easily do this with
Code:
set_player_troop
, but keep in mind you'd need to change almost every single references (and inferences) to "trp_player" afterward, not to mention the relationship and other arrays. You would also only have a limited pool of offsprings each game, as many as you pre-allocate.
 
Sêrachim said:
I'm not asking for any code (though I wouldn't mind a bit), but how would one approach implementing a heredity-old age system into Warband? So, ignoring the obscene amount of time the player would need to have played, say the character has lived for 50 years. By script he dies of old age, but, rather than game over, the player is given the option of taking control of one of the dead character's offspring. These offspring are produced through marriage.

If explanation would be too much; on a scale of 1-10, how possible would this be?
You can do it.

You have to create a few hero troops in advance as sons and daughters which will all belong the neutral commoner faction. These should be regular npc's best handled as addiotional companions, but you could also create a new category for them. Then you will have to create a script which will fire after certain conditions are met (the player's offspring has come of age vor example). Then the troop will be added to a specific scene (most probably the location of the players court). There the player can promote the offspring to a lord or just take him/her as companion. To have the daughters act as kingdom_ladies might be a little bit more difficult - you might have to change the current algorithm to identify ladies. I have not looked into this in detail.

When your player character dies, you can do what Somebody suggested and transfer player control to the son/daughter troop. The big advantages is that you will have the troop with the right attributes, level, inventor, etc. and the right facekey out of the box. The big disadvantage Somebody already mentioned.

To avoid that disadvantage you could transfer all stuff including name, level, attributes, skills and inventory of the offspring-troop to the player troop and "reset" the offspring-troop. All operations for this are available besides the facekey transfer operation. This is the biggest drawback of this method. You can do it with the facekey transfer, but you will have to use the Warband Script Enhancer, which comes with its own drawbacks and difficulties. See here for details on facekey transfer. Another advantage of this method is, that you could reset the troop and use it again as offspring for your new character later in the game.

So either you will have to do lots of coding to circumvent the references to trp_player all over in the code, or you will have to either live with that your offspring now switches to the same face the father had, or you could try to use WSE. Either way, the lack of set_facekey operation for troops in the native module system is the biggest drawback here. The only existing native facekey operation refers to the facekey of your multiplayer profile and does not work to retrieve facekeys of regular troops.

There is, of course, one other solution to the facekey problem: you could change the face always by hand.
 
Sometimes I'll be in a large-ish battle (300 agents total) and I'll suddenly get huge framerate lag. It doesn't go away when i slow down the game, or when I look at the sky or something. Whenever this happens, there's a guy on the floor whose death animation is FUBAR. I've seen disembodied trousers doing slow motion loop the loops, characters who've completely twisted out of shape, or elongated limbs.

Is this a native bug?
 
Status
Not open for further replies.
Back
Top Bottom