Some Troop should not display in Troop List in Game Note appeared.

Users who are viewing this thread

I add some troopers in module_troopers.py, but I found that some troopers should not display in the Troop list of game note screen appeared like farmers or merchant even some Troop which only used in internal display, their name start with "{!}"

So I would like to know what's going wrong.
 
Check that none of the added troops are between 'kingdom_heroes_including_player_begin' and 'heroes_end'. That's the range of the list for that particular harcode menu/presentation.
 
Upvote 0
Look for calls to troop_set_note_available, that's operation which operates on troop note visibility. Normally the range of heroes is what's marked as visible and by default everything else is hidden. A corrupted savegame can also result in all note pages showing up.
 
Upvote 0
Not, if you want them to show up, but it's rare for regular troops to do so if they're not in that range. As Somebody points out, at the beginning of the game, in 'script_game_start', the operation 'troop_set_note_available' determines which troops are shown in the list, along with the operation 'try_for_range' which creates the range:
kings_begin, kings_end
lords_begin, lords_end
kingdom_ladies_begin, kingdom_ladies_end
pretenders_begin, pretenders_end
All these constants in 'module_constants' represent a troop.
Did you change any of these constants and therefore the range?
You add the troops and start a new game, right? Because if the savegame gets corrupted as soon as you start a new game, there is really something wrong.
 
Upvote 0
Not, if you want them to show up, but it's rare for regular troops to do so if they're not in that range. As Somebody points out, at the beginning of the game, in 'script_game_start', the operation 'troop_set_note_available' determines which troops are shown in the list, along with the operation 'try_for_range' which creates the range:

All these constants in 'module_constants' represent a troop.
Did you change any of these constants and therefore the range?
You add the troops and start a new game, right? Because if the savegame gets corrupted as soon as you start a new game, there is really something wrong.
I don't change these constants and therefore the range.
I start a new game not use the savegames, every time I start a game, always Troop list broken.
 
Last edited:
Upvote 0
I don't change these constants and therefore the range.
I start a new game not use the savegames, every time I start a game, always Troop list broken.

are you aware how the ranges work?

Code:
first_one = "trp_ONE"
last_one = "trp_LAST"

trp_one
...
trp_LAST

those things are converted into numbers when you compile the game. A example

Code:
trp_one = 55
...
trp_LAST = 99

first_one = 55
last_one = 99

so ranges (the numbers) are updated automagicaly when you add new troops INSIDE them, or when you add things OUTSIDE them as well. The important thingy is: if you want the game to consider something as part of a range, put it INSIDE it. Check your ID_troops.py after you compile the code to see the IDs.

Also remember because the range operation is (max-1), you need to define your max limiter as (actual troop +1). That is why you have this
Code:
companions_begin = "trp_npc1"
companions_end = kings_begin
the last companion is defined as the first king, not the actual last companion :grin:


Now the point here: where did you insert the new troops for your game? Check the new troops IDs against the limiters (start and end) of the ranges and double check if you put them in the proper positions.

Code:
# id_troops.py a example
trp_npc16 = 209 # last companion
trp_kingdom_1_lord = 210 # first king
trp_kingdom_2_lord = 211
trp_kingdom_3_lord = 212
trp_kingdom_4_lord = 213
trp_kingdom_5_lord = 214
trp_kingdom_6_lord = 215 # last king
trp_knight_1_1 = 216 # first lord vassal of kingdom #1
trp_knight_1_2 = 217
trp_knight_1_3 = 218
trp_knight_1_4 = 219
 
Last edited:
Upvote 0
are you aware how the ranges work?

Code:
first_one = "trp_ONE"
last_one = "trp_LAST"

trp_one
...
trp_LAST

those things are converted into numbers when you compile the game. A example

Code:
trp_one = 55
...
trp_LAST = 99

first_one = 55
last_one = 99

so ranges (the numbers) are updated automagicaly when you add new troops INSIDE them, or when you add things OUTSIDE them as well. The important thingy is: if you want the game to consider something as part of a range, put it INSIDE it. Check your ID_troops.py after you compile the code to see the IDs.

Also remember because the range operation is (max-1), you need to define your max limiter as (actual troop +1). That is why you have this
Code:
companions_begin = "trp_npc1"
companions_end = kings_begin
the last companion is defined as the first king, not the actual last companion :grin:


Now the point here: where did you insert the new troops for your game? Check the new troops IDs against the limiters (start and end) of the ranges and double check if you put them in the proper positions.

Code:
# id_troops.py a example
trp_npc16 = 209 # last companion
trp_kingdom_1_lord = 210 # first king
trp_kingdom_2_lord = 211
trp_kingdom_3_lord = 212
trp_kingdom_4_lord = 213
trp_kingdom_5_lord = 214
trp_kingdom_6_lord = 215 # last king
trp_knight_1_1 = 216 # first lord vassal of kingdom #1
trp_knight_1_2 = 217
trp_knight_1_3 = 218
trp_knight_1_4 = 219
I know how the range works, ok? I have added the new knights INSIDE between trp_kingdom_lord_1 and heroes_end
And I also added some new faction troopers, for example , I added some additional German troopers before trp_german_messager.
 
Upvote 0
Back
Top Bottom