Modding Q&A [For Quick Questions and Answers]

正在查看此主题的用户

状态
不接受进一步回复。
Hernanxd16 说:
I only want they don't appear in any scene and the player can't join them (Of course, remove the dialog of the traveller too).

track down where the troops are used (via their constants) and "disable" that. I would remove the entire feature from your code base (trash code leads to more work and bugs), but that is up to you.

插入代码块:
pretenders_begin = "trp_kingdom_1_pretender"
pretenders_end = kingdom_ladies_begin
 
kalarhan 说:
I would remove the entire feature from your code base (trash code leads to more work and bugs), but that is up to you.

Is there any word (The same comment, etc) to search on the module system to find all the code of the feature?
 
Hernanxd16 说:
Is there any word (The same comment, etc) to search on the module system to find all the code of the feature?

you can't trust comments. You can trust code  :mrgreen:

search for the constants, they are a good way to find it (or at least, most of it)
 
Now I'm thinking on an alternative, you say before if I don't remove all the code, it can generate bugs. What about If I put all the pretenders in a scene inaccessible for the player? Is a good idea?
 
kalarhan 说:
review how you are suppose to use a call_script operation (few errors there)

Thanks. I need to add 2 variables to all parties. Will I have to do this through the slot system or whatever? If so, how?

To elaborate, I need every party to have 2 booleans: spotted by player, and has spotted player. This is because the scouting system updates every half hour but if you set the trigger result to one and then let it go, it will just flash the other party on the screen for a frame, then the same thing will happen next half hour. So if I update the scouting checks every half hour but update whether someone is spotted by you or has spotted you every frame, to ensure that you can actually see the other lords and they can actually see you.
 
Hernanxd16 说:
Is a good idea?

Nope.

You are missing the point.

Pretenders are not a hardcoded mechanic/feature. It is a modsys feature, written on the modsys, that adds a new feature to the game engine. A feature that made sense to Native design.

If your mod doesn't have a place for them (which is fine, it is your vision/design), you do not need such feature. So you can simple remove/delete all related code (troops, constants, scripts, triggers, and so on) to reduce the trash code on your modsys (less risky of trash code creating bugs in future updates). You do not need to do that if you are confortable with trash code, just find the critical code (a dialog, etc) and disable it. Now that feature is disabled (hopefully), so players will not access it.

Lets say your mod doesn't allow horses. There are no horses on your world. The safest way to eliminate horses is by deleting horses from the codebase (all stuff horse-related that is not hardcoded). You can replace horses with anything (objects, ideas, troops, etc) that doesn't fit.



Bustah 说:
I need to add 2 variables to all parties.

"I need to add one general variable to the game" -> global
"I need to add a variable to each entity [party, troop, etc]" -> slot

See tutorial section to learn more about the different types of entities and variables. Check module_constants.py for a free slot for your party. See header_operations.py operations for slots on a party.

 
kalarhan 说:
Nope.

You are missing the point.

Pretenders are not a hardcoded mechanic/feature. It is a modsys feature, written on the modsys, that adds a new feature to the game engine. A feature that made sense to Native design.

If your mod doesn't have a place for them (which is fine, it is your vision/design), you do not need such feature. So you can simple remove/delete all related code (troops, constants, scripts, triggers, and so on) to reduce the trash code on your modsys (less risky of trash code creating bugs in future updates). You do not need to do that if you are confortable with trash code, just find the critical code (a dialog, etc) and disable it. Now that feature is disabled (hopefully), so players will not access it.

Lets say your mod doesn't allow horses. There are no horses on your world. The safest way to eliminate horses is by deleting horses from the codebase (all stuff horse-related that is not hardcoded). You can replace horses with anything (objects, ideas, troops, etc) that doesn't fit.

Well, I thought that because I did not want to risk leaving some code causing problems and also having the possibility to activate it at some point if I needed it. If I did this theoretically the code would still work and there would be no trash code, right ?
 
Hernanxd16 说:
there would be no trash code, right ?

wrong, but lets move on  :mrgreen: It is clear you do not want to remove the code, which is fine, it is your mod  :razz:

remember that you are a player, so you can extrapolate the game design (what the original developers had in mind) and from that know where most of the code should be.

For this case, where/how/when does a player interacts with a pretender to start the quest? Find that and turn it off.

You can even add some flavour dialog to make it clear that it is a pretender NPC, just not interested in starting a revolution (which would reduce the number of players asking you why pretenders are bugged lol)
 
kalarhan 说:
You can even add some flavour dialog to make it clear that it is a pretender NPC, just not interested in starting a revolution (which would reduce the number of players asking you why pretenders are bugged lol)

Oh, its a very good idea. Thanks, I will try it.
 
Thanks kalarhan for the link but in that tutorial thre is not answer on my question how it works that this lord gets this banner and another one use another banner what scripts i need to find
 
KnightV 说:
Thanks kalarhan for the link but in that tutorial thre is not answer on my question how it works that this lord gets this banner and another one use another banner what scripts i need to find

check section 2: lords and banners, and if you need further help you need to be specific

Cheers
 
I'm looking for a good run down of presentations. I have the lav module system and I have made a lot of presentations but I'm struggling with create_slider_overlay function. I can't seem to understand how in the custom battle they manage to display the value of the slider bar as it changes.  I've been using registers to display numerical variables in my presentations but I cant change the value in real time. It looks like Taleworlds uses strings to do this.  Sorry if my explanation is confusing I guess that is why I'm asking for a more in depth explanation of presentations.py.  Like I said I have lavs version and it has been really helpful.
 
elcapo29 说:
I'm looking for a good run down of presentations.

its not well covered on tutorials, so you need to learn by doing stuff and the usual study of examples and the header_XXX.py files.

you can use search and see old discussions as well. A example: https://forums.taleworlds.com/index.php/topic,6575.msg8904412.html#msg8904412

in short: you need to use the event trigger to catch the change in value of your slider, and a display widget on the run trigger to update such value.
 
I'm trying to learn how to use tableau_materials.py, this aspect of M&B/WB modding has always confused me (maybe cause it is closely related to dealing with materials/textures, which I have very little knowledge of).

How is it best to see if I am pinpointing the position I want to for cur_tableau_add_mesh? Is it just really trial and error, or is there a better method to doing so?

Any other tips on how to understand how to use tableaus better? I feel like this is a great way of having more items without adding item entries (for our crazy M&B compatibility). For instance, we have a lot of Gondor subfaction armours that are just retextures of 1 armour piece. This is a great candidate for tableaus.

BJUc5.jpg
YAhjk.jpg
J5go2.jpg
yMDbE.jpg
 
kalarhan 说:
elcapo29 说:
I'm looking for a good run down of presentations.

its not well covered on tutorials, so you need to learn by doing stuff and the usual study of examples and the header_XXX.py files.

you can use search and see old discussions as well. A example: https://forums.taleworlds.com/index.php/topic,6575.msg8904412.html#msg8904412

in short: you need to use the event trigger to catch the change in value of your slider, and a display widget on the run trigger to update such value.
Thanks Kalarhan that example was exactly what I was looking for. Thanks for always responding so quickly!  I had the event trigger working right just not the display widget.
 
Khamukkamu 说:
I'm trying to learn how to use tableau_materials.py, this aspect of M&B/WB modding has always confused me (maybe cause it is closely related to dealing with materials/textures, which I have very little knowledge of).

How is it best to see if I am pinpointing the position I want to for cur_tableau_add_mesh? Is it just really trial and error, or is there a better method to doing so?

Any other tips on how to understand how to use tableaus better? I feel like this is a great way of having more items without adding item entries (for our crazy M&B compatibility). For instance, we have a lot of Gondor subfaction armours that are just retextures of 1 armour piece. This is a great candidate for tableaus.

BJUc5.jpg
YAhjk.jpg
J5go2.jpg
yMDbE.jpg
How exactly do you intend to implement it?
If you want to change materials procedurally, it's probably better to use cur_item_set_material (I never tried it myself I just rely on its description) within ti_on_init_item trigger depending on what soldier is wearing this item.
Then you will have fewer items (also you will be able to delete redundant meshes) but making different versions available for the player will require a new customization menu.

cur_tableau_add_mesh is usually used for heraldics. The banner mesh is added to the center of the frontal part of an armor at these coordinates:
h-266.jpg
1 square = 50x50, so in this case a banner should be placed somewhere near (0,125).
I guess you could make an entire basic texture transparent and add flat texture meshes to its center, but it seems more difficult/complex than cur_item_set_material.
 
Khamukkamu 说:
I'm trying to learn how to use tableau_materials.py, this aspect of M&B/WB modding has always confused me (maybe cause it is closely related to dealing with materials/textures, which I have very little knowledge of).

How is it best to see if I am pinpointing the position I want to for cur_tableau_add_mesh? Is it just really trial and error, or is there a better method to doing so?

Any other tips on how to understand how to use tableaus better? I feel like this is a great way of having more items without adding item entries (for our crazy M&B compatibility). For instance, we have a lot of Gondor subfaction armours that are just retextures of 1 armour piece. This is a great candidate for tableaus.

BJUc5.jpg
YAhjk.jpg
J5go2.jpg
yMDbE.jpg

You might find reply 40 of use
https://forums.taleworlds.com/index.php/topic,121012.30.html
 
Thanks all

@Leonion, (you are gonna hate me for this), we can't use that operation cause it doesn't exist in M&B 1.011, the reason why I'm trying the tableau way :sad:

GetAssista, one of the previous coders of TLD, used the Tableau system for Civilian tunics. He had a bunch of faction specific tableau meshes, and used a script + cur_tableau_add_mesh to determine the faction of the wearer and give them them the appropriate faction tunic tableau:

v8CU_.jpg

I guess he made those specifically with the tableau system in mind...

I want to do something similar but for the gondor armours. Probably going to be hard to do...

@NPC99, thanks, this is useful.
 
状态
不接受进一步回复。
后退
顶部 底部