Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
I feel that my answer was taken as an offense, I hope it is not so, do not stop asking when you do not know something. Also check all the information there is for modsys, and always have at hand header_operations, is the dictionary of wb code.  :wink:
 
BeefBacon said:
What I was confused by is the fact that module_parties assigns what I assume is an unlooted map model, and that module_scripts also assigns an unlooted map model as well as the appropriate looted and abandoned models

entities have a zero-time definition, or the moment when the campaign is created. After that is up to the dynamic rules in the module system to adapt them, so the initial definitions are no longer valid. Entities are things like troops, static parties, items, ...

think of the player troop. In module_troops.py you are level 1, no items, etc. That state changes at the moment you answer the questions on character creation. And dont change back. You can even choose between the inventory of a soldier-troop: use the default values, or be dynamic (module.ini).

or how the faction of a static center changes right in the "game_start" script and keep changing as events happen in the game.

so use the entities file for nominal values that make sense, but dont worry so much about them. The game is dynamic by nature.
 
Dj_FRedy said:
I feel that my answer was taken as an offense, I hope it is not so, do not stop asking when you do not know something. Also check all the information there is for modsys, and always have at hand header_operations, is the dictionary of wb code.  :wink:

It's all me - not your fault, I promise. I do appreciate the help.

kalarhan said:
BeefBacon said:
What I was confused by is the fact that module_parties assigns what I assume is an unlooted map model, and that module_scripts also assigns an unlooted map model as well as the appropriate looted and abandoned models

entities have a zero-time definition, or the moment when the campaign is created. After that is up to the dynamic rules in the module system to adapt them, so the initial definitions are no longer valid. Entities are things like troops, static parties, items, ...

think of the player troop. In module_troops.py you are level 1, no items, etc. That state changes at the moment you answer the questions on character creation. And dont change back. You can even choose between the inventory of a soldier-troop: use the default values, or be dynamic (module.ini).

or how the faction of a static center changes right in the "game_start" script and keep changing as events happen in the game.

so use the entities file for nominal values that make sense, but dont worry so much about them. The game is dynamic by nature.

Okay, I think that makes sense.

I've more or less got the basics lined up, in regards to the fact that everything compiles without any problems, but I'm keen on doing a bit of visual stuff for a while - modelling, textures, so on. Can you, or anyone else, tell me where I can edit font colours? I can change the colours of certain menus in module_game_menus but can't for the life of me find the values for the main menu and the loading screen. Being able to hide "multiplayer" on the main menu would also be a plus. I remember reading about how to remove it a while ago, but Google isn't my friend this day.
 
module.ini has variables to hide some buttons like
Code:
has_tutorial = 1

you can edit the hardcoded UI like main game menu on the file game_variables.txt. The coordinates, etc, are there. Rest is hardcoded. A example is to move the buttons around, either to use a new background or to hide them (move them to the corner and use a small font... no more buttons lol).
 
Hello everybody,
In lord hall scene, when player be  a vassal, he play an animation.
In visit_town_castle mission templates added,
(1, 0, ti_once, [(eq, "$derebey_ol",1),], [
  (get_player_agent_no,":player_agent"),(agent_play_sound,":player_agent", "snd_man_victory"),
(agent_set_animation, ":player_agent", "anim_molitva",1),
]),
!snd_man_victory working but animation not working.
module_animation
["molitva", 0, amf_play,
  [13.0, "molitva_h", 0, 228, arf_blend_in_5],
], 
module_dialogs
  [anyone,"lord_give_oath_go_on_3",
  [
    ],

  "You have done a wise thing, {playername}. Serve me well and I promise, you will rise high.", "lord_give_conclude", [(try_begin),(this_or_next|eq, "$g_talk_troop_faction", "fac_kingdom_1"),
  (this_or_next|eq, "$g_talk_troop_faction", "fac_kingdom_5"),
  (this_or_next|eq, "$g_talk_troop_faction", "fac_kingdom_12"),
  (this_or_next|eq, "$g_talk_troop_faction", "fac_kingdom_13"),
  (this_or_next|eq, "$g_talk_troop_faction", "fac_kingdom_14"),
  (this_or_next|eq, "$g_talk_troop_faction", "fac_kingdom_15"),
  (eq, "$g_talk_troop_faction", "fac_kingdom_16"),(assign, "$derebey_ol",1),
  (try_end),
  ]],

edit fixed, changed like: (agent_set_animation, ":player_agent", "anim_molitva"),


Another quest
In a siege scene have fog, I did not add fog to scene, but scene is foggy.
In edit mode fog not seem,
i3erGj.jpg
edit mode
po7XPZ.jpg
So, how can I remove the fog from the scene?
I add a temporary solution like this but not work.
In castle_attack_walls_ladder mission_templates

(ti_before_mission_start, 0, 0, [(mission_cam_set_screen_color, 0xFF000000),], [ # (try_begin),
  # (eq,"$current_town","p_castle_10"),
  (set_fog_distance, 150, 0xFF736252),
  # (try_end),
  (mission_cam_animate_to_screen_color, 0x00000000, 3000)]),
 
frozenpainter said:
So, how can I remove the fog from the scene?
Check these 2 operations.
Code:
get_global_haze_amount     =   92  # (get_global_haze_amount, <destination>),
                                   # Returns current fogginess (value between 0..100).
set_global_haze_amount     =   93  # (set_global_haze_amount, <value>),
                                   # Sets current fogginess (value is clamped to 0..100).
(get_global_haze_amount, ":cur_fog_amount"),
(assign, ":cur_fog_amount", 0), #0..100
(set_global_haze_amount, ":cur_fog_amount"),
After each scene the value of the fog will remain for the whole campaign map, keep it in mind, then the future will make it change, as you know.
 
@Dj_FRedy
Tested, working for all scenes but not work for p_castle_10 scene. In this scene, firstly everywhere fog, player climb height fog is disappear.
So look like, player starting height level is 1(scene is fog)
player climb up example after height 20 fog disappear.
 
Does someone know if the encumberancy system mentioned in this mod from 2009 is the encumberancy system of Native or have they created one by themselves? If it has been done by themselves, does someone know how (if existent) the one of Native is working?
Chel said:
How exactly does the encumberance system work?
  The total weight of your equipment (armor, weapons/shield/ammo, gloves/boots/helm) is calculated. Only what you bring into battle matters, your inventory contents does not.

Lets say the total weight is 52 kg ingame.
You can carry up to 5 + (2 x [Weapon Master skill]) + ([Strength above 10]/2) kg without an effect on your proficiencies.
Lets say you have lvl2 weapon master and 16 strength.
That means you can carry up to 5+2x2+(16-10)/2 = 10 kg without effect on proficiencies.
So everything above that, in this case encumberance of 52-10 = 40 kg, will weight you down.

Given encumberance of 40, your proficiencies are going to be reduced in the following way:

Crossbow: -1x(40+10)=-50 points
One-handed, Two-handed, Polearm: -2x(40+10) = -100 points
Archery, Throwing: -3x(40+10) = -150 points

Note also that with lower proficiencies when encumbered, they train up faster when fighting, so you can train yourself up by fighting with lots of gear (carry 3 sets of stones for example, and fight with sword), then take it off for a lighter set and have higher weapon skill!

With a total equipment weight of 30 kg, for example, and lvl8 weapon master skill and 24 strength,
your encumberance would be 30-(5+2x8+(24-10)/2) = 2 kg
you weapon proficiencies would be affected:

Crossbow: -1x(2+10)=-12 points
One-handed, Two-handed, Polearm: -2x(2+10) = -24 points
Archery, Throwing: -3x(2+10) = -36 points

With a total equipment weight of 28 kg, for example, and lvl8 weapon master skill and 24 strength,
your encumberance would be 26-(5+2x8+(24-10)/2) = 0
and there would be no effect on weapon proficiencies!

So there is a noticeable difference between not being encumbered at all and being slightly encumbered as well. Train your weapon master skill and stength to increase the limit of weight that does not encumber you.
 
Hi there,

How does the game assign Men to the Infantry, Archers, and Cavalry groups?

I've had a look through the code, but all I can find is agent_get_group/agent_get_glass
grc_cavalry etc, but nothing regarding setting their group
 
Possibly a question best asked in WSE thread but thought I would check here first.

WSE has a couple of operations for set_player_banner and set_player_username. This works from serverside (after you restart the map). My question is, can the changed username or flag/banner info be sent to clients without having to restart the mission/map or is that always something that has to be called before the mission starts? Ultimately I want to be able to change player username and send the changed info to all players so they can see it (without map restart).
 
[Bcw]Btm_Earendil said:
Does someone know if the encumbrance system mentioned in this mod from 2009 is the encumbrance system of Native or have they created one by themselves? If it has been done by themselves, does someone know how (if existent) the one of Native is working?
I was going to post this in the discord, but the character limit wouldn't allow me to. As far as I can tell, the game gets your equipment weight and then slows your footspeed based on that. This system will slow your attack speed and your aiming accuracy, which is a way better incentive to stay light.

Code:
new_encumberance_system = (
  ti_on_agent_spawn, 0, 0, [], [
	
	(store_trigger_param_1, ":agent"),
	(agent_get_troop_id, ":cur_troop", ":agent"),
	
	(store_attribute_level, ":strength", ":cur_troop", ca_strength),
	(store_skill_level, ":wpm_level", skl_weapon_master, ":cur_troop"),
	
	(set_fixed_point_multiplier, 100),
	
	(try_for_range, ":item_slot", 0, 7),
		(agent_get_item_slot, ":item", ":agent", ":item_slot"),
		(item_get_weight, ":item_weight", ":item"),
		(val_add, ":total_weight", ":item_weight"),
	(try_end),
	
	# Store affected proficiencies in order to save their true values
	(store_proficiency_level, ":one_handed", ":cur_troop", wpt_one_handed_weapon),
	(store_proficiency_level, ":two_handed", ":cur_troop", wpt_two_handed_weapon),
	(store_proficiency_level, ":polearm", ":cur_troop", wpt_polearm),
	(store_proficiency_level, ":archery", ":cur_troop", wpt_archery),
	(store_proficiency_level, ":crossbow", ":cur_troop", wpt_crossbow),
	(store_proficiency_level, ":throwing", ":cur_troop", wpt_throwing),
	
	# Store original proficiencies in slots so they can be preserved.
	(troop_set_slot, ":cur_troop", encumberance_one_handed_weapon, ":one_handed"),
	(troop_set_slot, ":cur_troop", encumberance_two_handed_weapon, ":two_handed"),
	(troop_set_slot, ":cur_troop", encumberance_polearm, ":polearm"),
	(troop_set_slot, ":cur_troop", encumberance_archery, ":archery"),
	(troop_set_slot, ":cur_troop", encumberance_crossbow, ":crossbow"),
	(troop_set_slot, ":cur_troop", encumberance_throwing, ":throwing"),
	
	# Provided formula for encumbrance
	# 5 + (2 x ":wpm_level") + ((":strength" - 10) /2)
	(val_mul, ":wpm_level", 2),
	(val_sub, ":strength", 10),
	(val_div, ":strength", 2),
	(store_add, ":carry_limit", ":wpm_level", ":strength"),
	(val_add, ":carry_limit", 5),
	
	(val_sub, ":total_weight", ":carry_limit")
	
	# To do final encumbrance you must now add ten and multiply by a value
	# Crossbow: -1*(40+":total_weight")
	# One-handed, Two-handed, Polearm: -2*(40+":total_weight")
	# Archery, Throwing: -3*(40+":total_weight")
	
	(store_add, ":crossbow_encumberance", ":total_weight", 10),
	(store_add, ":melee_encumberance", ":total_weight", 10),
	(store_add, ":ranged_encumberance", ":total_weight", 10),
	
	(val_mul, ":crossbow_encumberance", -1),
	(val_mul, ":melee_encumberance", -2),
	(val_mul, ":ranged_encumberance", -3),

	# Now, FINALLY, lower the proficiencies
	
	(troop_raise_proficiency_linear, ":cur_troop", wpt_crossbow, ":crossbow_encumberance"),
	
	(troop_raise_proficiency_linear, ":cur_troop", wpt_one_handed_weapon, ":melee_encumberance"),
	(troop_raise_proficiency_linear, ":cur_troop", wpt_two_handed_weapon, ":melee_encumberance"),
	(troop_raise_proficiency_linear, ":cur_troop", wpt_polearm, ":melee_encumberance"),
	
	(troop_raise_proficiency_linear, ":cur_troop", wpt_archery, ":ranged_encumberance"),
	(troop_raise_proficiency_linear, ":cur_troop", wpt_throwing, ":ranged_encumberance"),
	
	
    ])
Code:
# ######### Encumbrance Slots ##############
# # Make sure these numbers are unused ######
# ###########################################
encumberance_one_handed_weapon = 165 # ######
encumberance_two_handed_weapon = 166 # ######
encumberance_polearm           = 167 # ######
encumberance_archery           = 168 # ######
encumberance_crossbow	       = 169 # ######
encumberance_throwing          = 170 # ######
# ###########################################

If you read through it, you'll see the issue I ran into was not knowing when to restore the original values maybe on ti_switch_to_map do something like

Code:
# Check the current proficiency for each, hear I only show one-handed because I'm typing this on the forums instead of np++
	(store_proficiency_level, ":one_handed", ":cur_troop", wpt_one_handed_weapon),
# make it negative
	(val_mul, ":one_handed", -1),
# clear the proficiency level
	(troop_raise_proficiency_linear, ":cur_troop", wpt_one_handed_weapon, ":one_handed"),
# pull the TRUE value from the slot
	(troop_get_slot, ":one_handed", ":cur_troop", encumberance_one_handed_weapon ),
# restore the troop
	(troop_raise_proficiency_linear, ":cur_troop", wpt_one_handed_weapon, ":melee_encumberance"),
 
SupaNinjaMan said:
[Bcw]Btm_Earendil said:
Does someone know if the encumbrance system mentioned in this mod from 2009 is the encumbrance system of Native or have they created one by themselves? If it has been done by themselves, does someone know how (if existent) the one of Native is working?
As far as I can tell, the game gets your equipment weight and then slows your footspeed based on that. This system will slow your attack speed and your aiming accuracy, which is a way better incentive to stay light.
Ok, the first sentence is for how it currently works and the second for what your code snippet is doing now I assume. Nice that you rewrote it nearly  :grin:

Also this is worth an own thread where it can later be moved to the OSP Code section  :fruity:
 
set_ally_collision_threshold    = 3602 #(set_ally_collision_threshold, <low_boundary>, <high_boundary>), #Changes the animation progress boundaries (in percents) that determine if attacks on allies will collide (default: 45% <= x <= 60%)

Trying to set allied collision to be the same as enemies. Is (default: 45% <= x <= 60%) the default for allies or enemies? If it's for allies, what would I need to change to make it match that of an enemy?
 
Hello,
In a sea scene, troops spawn on a ship, ship moving and troops drop off the back of the ship, troops drop to sea, because ship is moving.
So I want to when ship moved troops hold on the ship, I added this to mission templates but troops still drop to sea.
(0, 0, ti_once,
      [
        (set_show_messages, 0),
        (team_give_order, 0, grc_everyone, mordr_stand_ground),
        (team_give_order, 0, grc_everyone, mordr_stand_closer),
        (team_give_order, 1, grc_everyone, mordr_stand_ground),
        (team_give_order, 1, grc_everyone, mordr_stand_closer),
        (set_show_messages, 1),

        ], []),
I used
mordr_hold
but not work, troops holding but they drop the ship.
 
It may be triggering before the troops are being spawned due to your 0 frame trigger.

I'd suggest using a global var instead:

Code:
  (3, 0, 0, [(lt,"$telling_counter",3)],[ # need to repeat orders several times for the b*tches to listen
    (val_add, "$telling_counter",1),
    (set_show_messages, 0),
    (assign,":defteam","$defender_team"),
    (assign,":atkteam","$attacker_team"),
    (assign,":entry2",60),
    (try_for_range,":entry",41,44), # cycle through flanks and assign teams' destinations 
      (entry_point_get_position, pos10, ":entry"), #TLD, was 10
      (team_give_order, ":defteam", grc_infantry, mordr_hold), 
      (team_give_order, ":defteam", grc_infantry, mordr_stand_closer),
      (team_give_order, ":defteam", grc_infantry, mordr_stand_closer),
      (team_give_order, ":defteam", grc_archers, mordr_stand_ground),
      (team_give_order, ":defteam", grc_cavalry, mordr_hold), 
      (team_give_order, ":defteam", grc_cavalry, mordr_stand_closer),
      (team_give_order, ":defteam", grc_cavalry, mordr_stand_closer),
      (team_set_order_position, ":defteam", grc_infantry, pos10), 
      (team_set_order_position, ":defteam", grc_cavalry, pos10), 
      (team_give_order, ":atkteam", grc_infantry, mordr_charge),
      (team_give_order, ":atkteam", grc_cavalry, mordr_charge), #InVain: Let's try this instead. Less prone to attackers getting stuck.
      (entry_point_get_position, pos10, ":entry2"), #TLD, was 10
      (team_give_order, ":atkteam", grc_archers, mordr_hold),
      (team_set_order_position, ":atkteam", grc_archers, pos10),
    (try_end),
]),
 
@khamukkamu
tiggers work, mordr_hold and mordr_stand_ground working, but troops still drop the ship.
Look like, troop spawn and hold on ship, but ship moving and troops stand behind of ship.
Iwill upload a video wait.

@edit
In video, stand_ground order working for all troops, In static ships no problem troops holding succesfuly but in moveable ships troops goingt to behind of ship.
 
frozenpainter said:
@khamukkamu
tiggers work, mordr_hold and mordr_stand_ground working, but troops still drop the ship.
Look like, troop spawn and hold on ship, but ship moving and troops stand behind of ship.
Iwill upload a video wait.

@edit
In video, stand_ground order working for all troops, In static ships no problem troops holding succesfuly but in moveable ships troops goingt to behind of ship.


I think you need to move the agents with the ship by setting their position each X seconds/frame.
They seem to be "stuck" at the position so the ship moves and hits them and so they end up at the back of the ship in a big group.
 
kalarhan said:
module.ini has variables to hide some buttons like
Code:
has_tutorial = 1

you can edit the hardcoded UI like main game menu on the file game_variables.txt. The coordinates, etc, are there. Rest is hardcoded. A example is to move the buttons around, either to use a new background or to hide them (move them to the corner and use a small font... no more buttons lol).

There seems to be a whole load of text that I can't change the colour of. Am I missing something, or is it such a mess that I can change the colour in the first character creation screen, but not the next? That surely can't be the case. I change colours by editing the 0xFF hex values - is there some other way to change colours that I've just not seen, or have I somehow missed the colour value for like half the UI?
 
BeefBacon said:
kalarhan said:
module.ini has variables to hide some buttons like
Code:
has_tutorial = 1

you can edit the hardcoded UI like main game menu on the file game_variables.txt. The coordinates, etc, are there. Rest is hardcoded. A example is to move the buttons around, either to use a new background or to hide them (move them to the corner and use a small font... no more buttons lol).

There seems to be a whole load of text that I can't change the colour of. Am I missing something, or is it such a mess that I can change the colour in the first character creation screen, but not the next? That surely can't be the case. I change colours by editing the 0xFF hex values - is there some other way to change colours that I've just not seen, or have I somehow missed the colour value for like half the UI?

Which one are you trying to change? And give us also the snippet of the lines which you have put in (together with the ones from the whole block of the respective UI which you want to change)
 
Status
Not open for further replies.
Back
Top Bottom