Modding Q&A [For Quick Questions and Answers]

正在查看此主题的用户

状态
不接受进一步回复。
Tüfekçi Başı 说:
Hello, how can I remove player inventory chest in scene?

插入代码块:
      (ti_before_mission_start, 0, 0, [],
      [
        (call_script, "script_change_banners_and_chest"),
      ]),

use this.
 
Tüfekçi Başı 说:
Not works :sad:

open the code of that script, study it, learn how it works, modify it (a new script) to fit your case, call if from your mission template.
 
?️NS Marko 说:
Yes, we started using single large(2k-4k) textures for props in Bear Force.

It will significantly reduce the amount of draw calls for your props, items, et cetera. If you have the time to re-UV everything, go for it. Loading speed of 4k texture vs 16 1k texture difference is minimal, and won't make an impact compared to the amount of optimization previously mentioned.
Great, thanks.:smile:
With OpenBrf's 'Transform texture coords' it shouldn't take much time (I only plan to do it for weapons).
 
kalarhan 说:
Tingyun 说:
Thanks, do you know if they are rounded or truncated? Ie, in the example, would charisma 16 or charisma 20 be the breakpoint to get an additional 1 added?

different things

numbers are integers and truncated

engine entities like skill have a soft or hard limit, usually based on 2^n. For skills its 10 (+bonus).

I'm not sure I fully understand your response, except for the part about truncating.

My question was referring to this block of code that I posted directly above:

  (assign, ":upper_limit", 7),
    (store_attribute_level, ":charisma", "trp_player", ca_charisma),
      (val_div, ":charisma", 10),
      (val_add, ":upper_limit", ":charisma"),
      (store_skill_level, ":leadership", "skl_leadership", "trp_player"),
      (val_div, ":leadership", 5),
      (val_add, ":upper_limit", ":leadership"),

So the charisma divided by 10 would be truncated and not provide any benefit anywhere from charisma 11-19 at all, and the breakpoints for charisma to be beneficial would be 10 and 20?
 
Tingyun 说:
I don't understand what you mean by "different things"?

a local variable is just a number. A number that is a integer. A integer that gets truncated.

a skill is a entity controlled by the engine with its own restrictions and rules, that go above a simple number.

when you do math on a variable, even if you call it ":charisma", it is just a number.

when you try to apply a value to a skill using a operation, that is another thingy.

Tingyun 说:
So the charisma

charisma is a stat
leadership is a skill

they are under different rules
 
I understood all of that fully from the start--if I didn't, I wouldn't be asking about truncating.

My question was about the implications of charisma 11-19 for the particular codeblock I posted directly above, to confirm my understanding of how this all works. Again:

      (val_div, ":charisma", 10),
      (val_add, ":upper_limit", ":charisma"),

In other words, confirm that the charisma/10 line result would be immediately truncated to a value of 1 anywhere from Charisma 11-19, and so the player would need 20 Charisma before he saw any benefit to the "upper limit" variable, no matter what other things might be added later to it?
 
Leonion 说:
?️NS Marko 说:
Yes, we started using single large(2k-4k) textures for props in Bear Force.

It will significantly reduce the amount of draw calls for your props, items, et cetera. If you have the time to re-UV everything, go for it. Loading speed of 4k texture vs 16 1k texture difference is minimal, and won't make an impact compared to the amount of optimization previously mentioned.
Great, thanks.:smile:
With OpenBrf's 'Transform texture coords' it shouldn't take much time (I only plan to do it for weapons).

How do you use that feature? It seems like im just moving it randomly :sad:
 
Khamukkamu 说:
How do you use that feature? It seems like im just moving it randomly :sad:
Yeah, it's a little tricky.

For example, a couple of days ago I merged the textures of a sword (128x1024) and an armor (1024x1024, roughly 128x1024 of unused black space on the right).
h-314.jpg
So for "scale" it meant 12,5x100 (no idea what "U" and "V" stand for when it's X and Y in Cartesian coordinate system) because I decreased X eightfold (original UV was 100%x100% of the texture, now it's 12,5%x100% of the texture), and for 'translate' I needed U -0,125 (V 0).

Rescaling towards lower size moves the old uvmap to the left and/or top side of the new 'canvas' (in other words, it gravitates towards the top left corner). So if I only rescaled the UVmap, it would match the coordinates of the leftmost 128x1024 rectangle. But I had to move it to the rightmost rectangle, so it's either -0,125 or 0,875 along X.

Or another example - I attached a square 256x256 texture to the right bottom corner of a 1024x1024 texture (again, unused black space). So 'scale' is 25x25. As for 'translate', however, while I expected it to be +0,75 along X and -0,75 along Y; Y was actually +0,75, so I guess translating along Y is reversed.
 
Tingyun 说:
I understood all of that fully from the start--if I didn't, I wouldn't be asking about truncating.

already answered, unless you are not sure about what truncating is. Here is a link http://www.mathwords.com/t/truncating_a_number.htm

learn how you can run test code by using display_message (in-game or with rgl_log.txt), as this type of tingy is done quite easily and quickly (much faster than waiting a day for a answer). I wrote a short tutorial https://forums.taleworlds.com/index.php/topic,347990.msg8335287.html#msg8335287 for reference

a example: run a trigger with lots of values and see the result of the equations. Use operations to manipulate the atribute value of a character for the test.
 
Khamukkamu 说:
Leonion 说:
?️NS Marko 说:
Yes, we started using single large(2k-4k) textures for props in Bear Force.

It will significantly reduce the amount of draw calls for your props, items, et cetera. If you have the time to re-UV everything, go for it. Loading speed of 4k texture vs 16 1k texture difference is minimal, and won't make an impact compared to the amount of optimization previously mentioned.
Great, thanks.:smile:
With OpenBrf's 'Transform texture coords' it shouldn't take much time (I only plan to do it for weapons).

How do you use that feature? It seems like im just moving it randomly :sad:

It’s easiest to understand mtarini’s simple example in reply 1 https://forums.taleworlds.com/index.php/topic,366255.0.html

PS you could use this approach to assemble 4x4 textures and them assemble four of those 4x4 textures into a 16x16 one. However, I have never gone beyond 4x4. I use them for map icons where only one material can be assigned to the whole icon. I’ve never used them for optimisation.
 
NPC99 说:
It’s easiest to understand mtarini’s simple example in reply 1 https://forums.taleworlds.com/index.php/topic,366255.0.html

Thank you for bringing up this topic people...
I've been playing around with the idea of mod optimization a lot lately.
This link definitely deserves a place in my bookmarked pages.  :smile:

I've also been wondering one more thing related to .bfr files and loading times...
Is there any way to automatically find out which .bfr files from CommonRes aren't being used at all in your mod?
I'd simply like to remove the useless ones from the loading order in order to speed up the loading time a bit.
 
Silver Wolf 说:
Is there any way to automatically find out which .bfr files from CommonRes aren't being used at all in your mod?

are you using the option to detect which resources (F3 shortcut) are unused? It marks them so you can delete/remove from a .brf.

you can also F7 to see it listed (used + unused) assets
 
Silver Wolf 说:
NPC99 说:
It’s easiest to understand mtarini’s simple example in reply 1 https://forums.taleworlds.com/index.php/topic,366255.0.html

Thank you for bringing up this topic people...
I've been playing around with the idea of mod optimization a lot lately.
This link definitely deserves a place in my bookmarked pages.  :smile:

I've also been wondering one more thing related to .bfr files and loading times...
Is there any way to automatically find out which .bfr files from CommonRes aren't being used at all in your mod?
I'd simply like to remove the useless ones from the loading order in order to speed up the loading time a bit.

AFAIK you need to check brf files individually with ‘scan module for usages’. If a commonres file is empty delete it from your module.ini load order.
I have moved commonres brfs into my mod’s resource folder and deleted 80% of their content. It trades off an increased one-off downdload time for quicker loads of each game session. Obviously needs the module.ini references changed from load_resource to load_mod_resource.
 
Hi.
Why when i spawn an agent and use agent_set_group the agent doesn't listen for commands ?
插入代码块:
(set_spawn_position, pos12),
(spawn_agent, ":troop_no"),
(assign, ":new_agent", reg0),
(agent_set_team, ":new_agent", ":player_team"),
(agent_set_group, ":new_agent", ":player_no"),
 
kalarhan 说:
are you using the option to detect which resources (F3 shortcut) are unused? It marks them so you can delete/remove from a .brf.

you can also F7 to see it listed (used + unused) assets
NPC99 说:
AFAIK you need to check brf files individually with ‘scan module for usages’. If a commonres file is empty delete it from your module.ini load order.
I have moved commonres brfs into my mod’s resource folder and deleted 80% of their content. It trades off an increased one-off downdload time for quicker loads of each game session. Obviously needs the module.ini references changed from load_resource to load_mod_resource.

Thank you for the answers, that's exactly what I've been looking for!  :grin:
I completely forgot about these functions, as it's been a long time since I took a break from modding.
 
K.A. 说:

you need to show all the relevant code, as this is MP feature. Your snippet doesn`t show where your variables come from, if you are doing a server check, etc.
 
K.A. 说:
Hi.
Why when i spawn an agent and use agent_set_group the agent doesn't listen for commands ?
插入代码块:
(set_spawn_position, pos12),
(spawn_agent, ":troop_no"),
(assign, ":new_agent", reg0),
(agent_set_team, ":new_agent", ":player_team"),
(agent_set_group, ":new_agent", ":player_no"),
Check if reg0 has been manipulated by any ti_on_agent_spawn trigger and double check the values for the team and group.
Alternatively you can just use;
插入代码块:
add_visitors_to_current_scene   = 1265 # (add_visitors_to_current_scene,<entry_no>,<troop_id>,<number_of_troops>, <team_no>, <group_no>), #team no and group no are used in multiplayer mode only. default team in entry is used in single player mode
 
状态
不接受进一步回复。
后退
顶部 底部