Walkers in Towns and Villages

Users who are viewing this thread

KaiserSkullz

Regular
I'm having some problems finding them in the Scripts, I think I found it under: #Initialize walkers
what I want to be able to do is write a sequence that will check the faction of the town and give them a specific troop to replace the walker, but I'm not that good, I need some help with this. I looked at how the code checks for the town guards and such and how it draws it from the faction, I would like to do something similar and replace the trp with a custom made one instead of default walker to reflect their faction and race. ANY HELP would be GREATLY APPRECIATED thanks much!
 
The script pulls the faction/culture from the center's slot or sometimes from the owner (town lord) faction/culture slot.

There are few places that you can test your idea:

1- module_troops: the walkers are defined there. You can customize your new walker troops type there.

2- module_constants: constant "town_walkers_begin", "town_walkers_end" ect, you may need to include your new walker troops in this range.

3- module_scripts: :game_start" script at the very beginning.
(faction_set_slot, "fac_culture_1", slot_faction_town_walker_male_troop, "trp_town_walker_1"),
You can assign your new troops here.

3- module_scripts: script "center_set_walker_to_type" is called from "game_start" for all centers using 3 parameters: center_no, walker_no and walker_type. You can insert a "try" block to check for your condition then replace troops as you want.

That's all I can think of.
 
Good afternoon. Help with this problem
I want to change the number of citizens in the city

I found the following solution:

in the file "module_scripts";
in script_init_town_walkers
Code:
("init_town_walkers",
  [
    (try_begin),
      (eq, "$town_nighttime", 0),
      (try_for_range, ":walker_no", 0, num_town_walkers),
        (store_add, ":troop_slot", slot_center_walker_0_troop, ":walker_no"),
        (party_get_slot, ":walker_troop_id", "$current_town", ":troop_slot"),
        (gt, ":walker_troop_id", 0),
        (store_add, ":entry_no", town_walker_entries_start, ":walker_no"),
        (set_visitors, ":entry_no", ":walker_troop_id", 10),
      (try_end),
    (try_end),
  ]),

this line
Python:
(set_visitor, ":entry_no", ":walker_troop_id")

I replaced it with
Python:
(set_visitors,":entry_no",":walker_troop_id", 10),

In script_set_town_walker_destination
in line
Python:
(assign, ":try_limit", 100),
I replaced the number with 200 and below in the line
Python:
(shuffle_range, 0, 11),
replaced by 22

The number of citizens has increased 10 times, but all the new NPCs are just standing still.
What could be the problem?
 
Last edited:
Check the spoilers at the Forge Scrap Yard for 'town walkers', you should be able to find something useful:
 
Check the spoilers at the Forge Scrap Yard for 'town walkers', you should be able to find something useful:
Thank you, I found it
 
Back
Top Bottom