Author Topic: How to add a random troop to an entry point  (Read 3392 times)

Offline Diabelica

  • Apprentice
  • *
  • Posts: 10
    • View Profile
How to add a random troop to an entry point
« on: January 17, 2007, 02:08:12 am »
When I get into a scene I want to add a random troop from a defined troop list to be added to an exact entry point.
Is it possible?If possible how?

svaucher

  • Guest
Re: How to add a random troop to an entry point
« Reply #1 on: January 17, 2007, 03:13:52 am »
Have you tried these operations?

If this is for a city, you can probably execute the operations at the entrance menu.

add_troop_to_site = 10250   # (add_troop_to_site,<troop_id>,<scene_id>,<entry_no>)
remove_troop_from_site = 10251   # (remove_troop_from_site,<troop_id>,<scene_id>)

Offline Fisheye

  • Blues Brother
  • Moderator
  • *****
  • Posts: 427
  • My scalp's so bright, I gotta wear shades.
    • View Profile
Re: How to add a random troop to an entry point
« Reply #2 on: January 17, 2007, 07:35:58 am »
svaucher's way doesn't work for a random troop list where the same troop can be selected more than once.

If it's a battle, you have to set up a custom mission template. Take a look at how the arena mission template works.

If it's peaceful it's much easier since you can just use mt_town_default. Uset set_visitor, and make sure your entry points are between 17-31 inclusive. Example:

(modify_visitors_at_site,"scn_my_custom_scene"),
(reset_visitors),
(store_random_in_range, ":random_troop", "trp_swadian_peasant", "trp_swadian_sergeant"),
(set_visitor,17,":random_troop"),
(set_jump_mission,"mt_town_default"),
(jump_to_scene,"scn_my_custom_scene"),
(change_screen_mission),
« Last Edit: January 17, 2007, 07:37:31 am by Fisheye »