Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
I am building a presentation with transparent black background. However some of the overlays inside are affected by the transparency, making buttons and such barely visible. How can I prevent this? The overlays should be *on top* of the background. Can I do something with container overlay to adjust hierarchy?
 
Quintillius said:
I am building a presentation with transparent black background. However some of the overlays inside are affected by the transparency, making buttons and such barely visible. How can I prevent this? The overlays should be *on top* of the background. Can I do something with container overlay to adjust hierarchy?

Try changing the printing order. Each visual element is "printed" on screen as you create them, so create the background manually.

A example:
Code:
  ("name_kingdom",0,0,[
      (ti_on_presentation_load,
        [(set_fixed_point_multiplier, 1000),
          
          ###mesh de fondo
          (create_mesh_overlay, reg0, "mesh_pic_troop_trees"),
          (position_set_x, pos1, -1),
          (position_set_y, pos1, -1),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, 1002),
          (position_set_y, pos1, 1002),
          (overlay_set_size, reg0, pos1),
instead of defining the background for the presentation, this one starts with none (see the "name", 0, 0) and later it adds one by defining the X,Y, height/width and printing a image. In the above example the mesh is the first thingy printed, but for your case you may need to try to add the overlays (buttons, etc) first.



Khamukkamu said:
Is it possible to have conditional inventory screen background imagery? For example, if player is of X faction, have them see Inventory Window A; if of faction Y, inventory window B?

Or am I messing with hardcoded stuff here.. ? :smile:
I think its hardcoded, yes. The presentation itself is part of the engine (not on modules).

If you want to have a couple UIs (one for "good" side, one for "bad" side) you could offer two downloads (each having a few unique textures), or a single download that has a setup folder that players can copy stuff and override the default files.
--> go to /modules/my_game/setup, choose the folder for your faction, copy that content over the game folder

/modules/my_game/setup/orcs
                                              /textures
                                              /sounds
                                              ...

just a suggestion  :mrgreen:



-Robin- said:
Does anyone know how the game engine works? game logic, network system, physics system, graphics system...
TW should know it  :razz:

If you want to learn about it then read all the tutorials, OSP section for examples, this entire thread for Q&A, the game source and experiment with it.

Bannerlord should be more open about its engine code (latest interviews), so you should be able to learn even more about the next game after a few months of study  :mrgreen:
 
Arthur_Pendragon said:
Code:
(team_give_order, team_bot_roman, grc_everyone, mordr_form_2_row),
when i give the order i get an invalid group id Error.
Ive tried almost everything possible with team operations and its always the same error.
Any help would be appriciated. I have not slept all night so i might be missing something.

Its a multiplayer Mod and i'm actually making the function inside module_items.py.
In multiplayer the team id equals the player id.
If you want to give orders to a player's team, then use it's id.
Code:
(team_give_order, ":player_id", grc_everyone, mordr_form_2_row),
 
Thanks kalarhan.

New question:

I'd like to learn about item modifiers and how they work.

Is there any documentation on this aside from what's in header_item_modifiers and module_items?

How does one decide that imodbit_sturdy would lead to + in certain item attributes?
 
Khamukkamu said:
How does one decide that imodbit_sturdy would lead to + in certain item attributes?

hardcoded. You could add other bonus/penalties with triggers on a MST, but you can't change the base values.

The price changes are on the file item_modifiers.txt, while the ingame display of the bonus/price are on scripts (just a display, not actual game effect)

You also have a script for skill bonus/penalties (actual gameplay effect) you can combine with imods
 
kalarhan said:
Khamukkamu said:
How does one decide that imodbit_sturdy would lead to + in certain item attributes?

hardcoded. You could add other bonus/penalties with triggers on a MST, but you can't change the base values.

The price changes are on the file item_modifiers.txt, while the ingame display of the bonus/price are on scripts (just a display, not actual game effect)

You also have a script for skill bonus/penalties (actual gameplay effect) you can combine with imods

Thanks kalarhan. Would it be : script_get_item_modifier_effects? It's only called in MTs to evaluate weapon breakage, not effects (if im reading it correctly)
 
I know there's a flag to prevent using a weapon while mounted. However, has anyone attempted doing something similar except that you can only use it while mounted?
 
Sherlock Holmes said:
I know there's a flag to prevent using a weapon while mounted. However, has anyone attempted doing something similar except that you can only use it while mounted?
Aslong as it is for melee weapons you can only set the horseback attack flags, such as;
Code:
itcf_horseback_thrust_onehanded
itcf_horseback_overswing_right_onehanded
itcf_horseback_overswing_left_onehanded
itcf_horseback_slashright_onehanded
itcf_horseback_slashleft_onehanded
itcf_thrust_onehanded_lance_horseback
itcf_horseback_slash_polearm

In case you need to apply it for ranged weapons, create an unusable dummy clone of the specific item and replace it once the player dismounts... and vise versa.
 
Khamukkamu said:
Thanks kalarhan. Would it be : script_get_item_modifier_effects? It's only called in MTs to evaluate weapon breakage, not effects (if im reading it correctly)

Like I said the base stats are hardcoded. Imod XXX gives +2 damage and thats it.

However, there is no restriction on you creating a ti_on_agent_hit trigger that adds another +5 to damage, or whatever effect you want. Just update the tooltip text (script).
-> VC, as a example, gives extra chance to decapitate a enemy if you are using a axe, instead of a sword. It gives extra damage if you attack from behind. And so on. You are free to design your feature around triggers.

There is no reason to do that tho if you keep weapons on a similar balance as Native (same damage range). If you start giving weapons 100+ damage, then of course a +2 bonus is just silly and pointless, but the engine was not created for those numbers. You are better off balancing module.ini defense rating, instead of upping the weapons stats.

the .txt file is for prices. You must sync it with the script, otherwise you won't get correct prices on a vendor.
 
Hey lads, I need a bit of help here.

I've been having this issue for a while now and I'm just not sure what the problem is and how to fix it.

The issue is that for one faction (Romans) the soldiers don't have their shields equipped once they spawn in a battle. I know for a fact that this has to do with the formations (Ranks/Shieldwall etc) Because I've tested it with and without the formations enabled. Now the weird thing is like I said, I've also tested it with various other factions and the formations work fine with the those factions as their troops do equip their shields when in battle like normally.

Does anyone with some more knowledge on how the (Brytenwalda) formations work perhaps have a clue where the problem could be? I can't recall that I've messed around with the formation scripts/templates so the problem should be somewhere in the either the troops or the items.

Any help would be greatly appreciated!

Cheers
 
Sim00n said:
Hi .o/
I'm trying to play with weather, but it seems that out of all the available functions, only set_fog_distance is working.
I've tried using set_rain, set_fog_distance, scene_set_day_time, set_global_cloud_amount, set_global_haze_amount and out of all of those, I was only able to create fog.
I'm using this on a multiplayer server and I tried triggering this from both the client and the server. Any ideas of what I might be doing wrong? Are there any specific callbacks where those functions have to be used?

From my research it looks like set_fog_distance can be used anywhere but all the other functions have to be used in before_mission_start. I was trying to play with skyboxes to accomplish my goals but guess what ... set_skybox can also only be used in before_mission_start. If anybody has any ideas, hit me up.
 
_Sebastian_ said:
Arthur_Pendragon said:
Code:
(team_give_order, team_bot_roman, grc_everyone, mordr_form_2_row),
when i give the order i get an invalid group id Error.
Ive tried almost everything possible with team operations and its always the same error.
Any help would be appriciated. I have not slept all night so i might be missing something.

Its a multiplayer Mod and i'm actually making the function inside module_items.py.
In multiplayer the team id equals the player id.
If you want to give orders to a player's team, then use it's id.
Code:
(team_give_order, ":player_id", grc_everyone, mordr_form_2_row),
Thank you I am not longer getting an error when i give the order but troops do not do anything when i do?


 
gokiller said:
Does anyone with some more knowledge on how the (Brytenwalda) formations work perhaps have a clue where the problem could be?

which version of "Formations OSP" are you using? The one from BW 1.41? A version you got from the OSP forum (v2, v3, .. ?)

--> keep in mind there is a new version that reduces lag, and VC code has a even better one with the DLC

Then check teh scripts used for whatever formation is having trouble (like shieldwall), they use certain conditions to test the gear of a agent to decide which combination of weapons to use at that moment
 
kalarhan said:
which version of "Formations OSP" are you using? The one from BW 1.41? A version you got from the OSP forum (v2, v3, .. ?)
The one from BW 1.41,

kalarhan said:
Then check teh scripts used for whatever formation is having trouble (like shieldwall), they use certain conditions to test the gear of a agent to decide which combination of weapons to use at that moment
Thanks, will do!
 
gokiller said:
The one from BW 1.41,

add debug messages (display_message) to the form infantry script, in special around this line (for shield wall):
Code:
(call_script, "script_equip_best_melee_weapon", ":agent", 1, 0, ":fire_order"),	#best weapon, force shield

and add debug messages to the "equip_best_melee_weapon" script. The 1 used above should force shield use if:

1) Weapon length is OK
2) Shield has shield flag
3) Troop has the flag to equip a shield, so the agent that spawns has a shield on any of the 4 slots for weapons
4) You have the correct non swing weapon to replace
 
_Sebastian_ said:
Arthur_Pendragon said:
Thank you I am not longer getting an error when i give the order but troops do not do anything when i do?
Did you select any troops on the equipment screen?
I guess not...


Its not native its a completely rewritten module system.
There is no troop selection instead the bot is Spawned in
Code:
def itm_bot_roman_spawn():
  return (ti_on_missile_hit, 
   [(multiplayer_is_server),
    (store_trigger_param_1, ":shooter_agent"),
    (agent_get_player_id, ":player_id", ":shooter_agent"),
    (assign, ":min", 500),
    (player_get_gold, ":gold_amount", ":player_id"),
    (try_begin),
        (gt, ":gold_amount", ":min"),
        (player_is_admin, ":player_id"),
        (set_spawn_position, pos1),
        (spawn_agent, "trp_roman_bot"),
        (agent_set_group, reg0, ":player_id"),
        #(try_for_agents, ":bot_agents"),
         #   (agent_is_non_player, ":bot_agents"),
          #  (agent_get_troop_id, ":troop_id", ":bot_agents"),
           # (eq, ":troop_id", "trp_roman_bot"),
        (agent_set_team, reg0, team_bot_roman),
        (agent_set_wielded_item, reg0, -1),
        (val_sub, ":gold_amount", ":min"),
        (player_set_gold, ":player_id",":gold_amount"),
 
_Sebastian_ said:
Arthur_Pendragon said:
Thank you I am not longer getting an error when i give the order but troops do not do anything when i do?
Did you select any troops on the equipment screen?
I guess not...

If I would like this to work in multiplayer, do I only have to switch the get_player_agent_no operation to agent_get_player_id operation?
also, does agent_get_team work in multiplayer?

Code:
player_crouch = (0, 0, 2,
  [(neg|main_hero_fallen),(key_clicked,"$key_crouch"),
   (get_player_agent_no, ":player_agent"), (agent_get_horse, ":horse", ":player_agent"), (le, ":horse", 0), 
   (gt,  ":player_agent", -1), 
   (try_begin),
      (agent_get_slot, ":crouching", ":player_agent", slot_agent_crouching),
      (eq, ":crouching", 0),
      (agent_set_animation, ":player_agent", "anim_stand_to_crouch"),
      (agent_set_slot, ":player_agent", slot_agent_crouching, 1),
   (else_try),         
      (agent_set_animation, ":player_agent", "anim_crouch_to_stand"),
      (agent_set_slot, ":player_agent", slot_agent_crouching, 0),
   (try_end)], [])
 
I can put any item mod on any item, right? It's not restricted by item type?

Like I can put "rotten" on an armour, or a "lame" on a sword? :smile:

If I can, will the effects of 'lame' occur on the sword? (i am assuming not, but you never know!)
 
Status
Not open for further replies.
Back
Top Bottom