Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Ikaguia said:
in module_presentations, prsnt_banner_selection
I know that. I changed many things in this presentation, but have not received any effect.
I really can not understand what determines the number of pages.
Could you explain more specifically, please.


Damn! I edited the wrong presentation!
I changed 'game_profile_banner_selection'. Finally I understand why nothing worked!

Thank you! You sent me in right way... Now everything works!!! :mrgreen:
Number of pages just repeat this number (maybe someone wants to know):
(val_mod, "$g_presentation_page_no", 8),
 
I've got two quick questions.
The first one is one that I've been breaking my head over for some time now. If I want to add extra stuff to the HUD/UI during battle, like displaying the name of the weapon you're wielding above the healthbar, how would I do that? I figure I need to make changes to module_presentations.py, but I've been staring at that code for days and I still just don't know where I'm supposed to add my code.

Second question, how can I bind keys to trigger certain scripts during battle, like when you press "c" a message appears saying "You just pressed c, congratulations." (Or some other script, just giving an example here). I've managed to figure out all the other codes/files by looking at the already existing code, but the code relating to in-battle stuff etc. is like, really hard. For me, at the moment.
If I could see a simple piece of code, and know what it's output is I'll be able to figure out the rest, but I need some basis to start off with.

Thanks in advance,
~~ArcaneSaint
 
Got a little question. I've been working on a little Storage Room Project and one of the aspects is adding chests. The chests I added can be used in Jelkala, but when I add them to Praven, they all say Acces Baggage. Which isn't what I need? Anyone knows a solution?
 
in battle stuff should be added to module_mission_templates, look at the first comon_X = Y in the beggining of the file, copy and edit one of them, and then add it to the mission templates you want.
 
Carnivorious said:
Got a little question. I've been working on a little Storage Room Project and one of the aspects is adding chests. The chests I added can be used in Jelkala, but when I add them to Praven, they all say Acces Baggage. Which isn't what I need? Anyone knows a solution?
The chest must be added before the terrain border
module_scenes said:
  ("town_5_center",sf_generate,"none", "none",(0,0),(100,100),-100,"0x00000000300214100003ecfb00002b930000051900002c29",
    [],["bonus_chest_2"],"outer_terrain_plain"),
"bonus_chest_2" is the troop whose inventory you would like to access. If it's not set, it defaults to 0 (the player's own inventory).
Arcanesaint said:
I've got two quick questions.
The first one is one that I've been breaking my head over for some time now. If I want to add extra stuff to the HUD/UI during battle, like displaying the name of the weapon you're wielding above the healthbar, how would I do that? I figure I need to make changes to module_presentations.py, but I've been staring at that code for days and I still just know I'm supposed to add my code.

Second question, how can I bind keys to trigger certain scripts during battle, like when you press "c" a message appears saying "You just pressed c, congratulations." (Or some other script, just giving an example here). I've managed to figure out all the other codes/files by looking at the already existing code, but the code relating to in-battle stuff etc. is like, really hard. For me, at the moment.
If I could see a simple piece of code, and know what it's output is I'll be able to figure out the rest, but I need some basis to start off with.

Thanks in advance,
~~ArcaneSaint
  • The simplest presentation to look at would be arena_training - it simply has two text overlays, so you can easily modify their position and size to do what you want. Use agent_get_wielded_item to fetch the player agent's wielded weapon.
  • In the conditions of the trigger, add key_clicked (or whatever operation you need) with key_c as the parameter (full list in header_triggers) ad do whatever you want in the consequences. Again, look at common_battle_order_panel, and, although its conditions are in the wrong place, it makes almost no difference since the intervals are all 0.
 
don't know how to search for this, so:
does anyone know how the engine determine which troops are "archers" "infantries" and "cavaliers"?

Also, my multiplayer module crashes all clients out whenever a new map is started, any hunches on the causes?


Thanks
 
From the module system they are based on troop classes(or is it divisions?). In game it is the same as the option in the party screen for archers, infantry, cavalry, unassigned...

The crashes could be cause by a ti_on_mission_before/after_start trigger if it only happens when the server switches and guys can rejoin without a problem.
 
ithilienranger said:
From the module system they are based on troop classes(or is it divisions?). In game it is the same as the option in the party screen for archers, infantry, cavalry, unassigned...

The crashes could be cause by a ti_on_mission_before/after_start trigger if it only happens when the server switches and guys can rejoin without a problem.

classes I think. eh well, the game seems to automatically determine which class troops are from different attributes u give it in troops.py, what are the rules that determine this?

hm, I was thinking that too, but the only code I have under those trigger is:
Code:
		(this_or_next|multiplayer_is_server), #Only run on server for multiplayer
		(neg|game_in_multiplayer_mode),
		(reset_mission_timer_c),
		(assign, "$last_t", 0),
so I guess it's due to another reason...
 
tf_guarantee_range (archer), tf_guarantee_horse (cavalry), others are infantry. Don't know if that have changed or there is anything new.
 
TheWhiteHand said:
Could anyone tell how to make a siege tower move? I've got all the entry points laid out with 110 at the start and 119 under it at the wall, yet it doesn't seem to be working when I run the siege map.

and, how do I make the teams switch sides after a round (in a siege) so the attackers become defenders and the defenders become attackers?
 
TheWhiteHand said:
Could anyone tell how to make a siege tower move?

In mission templates, search for:

common_siege_move_belfry = (
common_siege_rotate_belfry = (
common_siege_assign_men_to_belfry = (
 
Thanks for the help.

But ummm... now I've got another problem  :oops:, I'm trying to make a script to heal/damage the agent the player is looking at. Now, I can do the health-changing part, I've already got one that heals everybody around me (at least, I think it works for those around me, I can't see their health so I'm not sure if they're healed). But I'm stuck on the part where I get the agent. I've tried to use the following code which was already suggested in this thread:
(assign, ":target_agent", -1),
(assign, ":close_dist", 999),
(agent_get_look_position, pos1, ":player"),
(try_for_agents, ":agent"),
  #add in checks for agent being alive, human, ally, whatever you need
  (agent_get_position, pos2, ":agent"),
  (neg|position_is_behind_position, pos2, pos1),
  (position_has_line_of_sight_to_position, pos2, pos1),
  (get_distance_between_positions, ":distance", pos2, pos1),
  (lt, ":distance", ":close_dist"),
  (assign, ":close_dist", ":distance"), #My bad. Forgot this obvious line originally.
  (assign, ":target_agent", ":agent"),
(try_end),
But when I compile it I get "NameError: name' position_has_line_of_sight_to_position' is not defined", does this function only work with Warband or am I doing something wrong? (I'm using M&B, non-Warband/WFAS version). All I need is a script which returns the agent_id of the agent I'm looking at.

So, anyone willing to give a hand, again?
Thanks
~~ArcaneSaint
 
Somebody said:
Carnivorious said:
Got a little question. I've been working on a little Storage Room Project and one of the aspects is adding chests. The chests I added can be used in Jelkala, but when I add them to Praven, they all say Acces Baggage. Which isn't what I need? Anyone knows a solution?
The chest must be added before the terrain border
What do you mean?
 
Arcanesaint said:
But when I compile it I get "NameError: name' position_has_line_of_sight_to_position' is not defined", does this function only work with Warband or am I doing something wrong?
Check header_operations.py in your ms for the function availability.
In this partiular case yes, WB only
 
iggorbb said:
TheWhiteHand said:
Could anyone tell how to make a siege tower move?

In mission templates, search for:

common_siege_move_belfry = (
common_siege_rotate_belfry = (
common_siege_assign_men_to_belfry = (

Can't find it anywhere. But I meant making it move in a custom made map for multiplayer, got any idea how that works?
I followed this guide (http://forums.taleworlds.com/index.php?topic=112806.0) which told me to:

Placing siege towers

Siege towers can be tricky!  As with the ladders create them as how they would look on the wall they are attacking. (make sure and place the wheels facing the right way, else they'll spin backwards)
Place entry points 110-119 down for your first tower in the path you want it to follow.
Place entry points 120-129 down if you have a second tower and it will follow that path.
Place entry points 130-139 for a 3rd tower.

But, do I have to place 110 where it starts or do I have place it ,where the siege tower is, at the wall or something else?

 
GetAssista said:
Check header_operations.py in your ms for the function availability.
In this partiular case yes, WB only
Damn, any idea how I could get it to work? (Not the line_of_sight condition, but the "get-agent_id-I'm-looking-at"-script)
If I just remove that one line it would still work, right (but ignore stuff like walls etc.)?
 
Status
Not open for further replies.
Back
Top Bottom