Help: spawning agents in new indoor scene (Warband)

Users who are viewing this thread

ares007

Master Knight
Ok, so I made a new indoor scene entry in module_scenes.py and then referenced it in the town menu in addition to creating a mission template for it (it is more or less empty so far, but I will be putting in a lot of code later). I also made a new passage for it in the town scene. I got the passage to work and I can access the scene from walking around town and edit it. So far so good.

Now I want to spawn the player character as well as another character within the scene. I placed two separate entry points, entry point 0 and entry point 1. I have tried a few different methods, but so far I haven't been able to get the agents to spawn when I enter the scene :???: No agents spawning and my camera is just floating in the air.

This is the code for the scene entry
Code:
("uxkhal_fighting_guild",sf_indoors, "interior_tavern_b", "bo_interior_tavern_b", (-100,-100),(100,100),-100,"0",
    ["exit"],[]),

Here is the code entry in module_game_menus.py (the commented out lines are other methods that I have tried previously)
Code:
("fighting_school",
      [
        (eq,1,0),
      ],"Enter the Fighting School.",
      [
        (eq, "$current_town", "p_town_7"),
        #(modify_visitors_at_site,"scn_tutorial_training_ground"),
        (reset_visitors, 0),
        #(set_player_troop, "trp_player"),
        (set_visitor,0,"trp_player"),
        (set_visitor,1,"trp_frederick"),
        (set_jump_mission,"mt_uxkhal_fighting_guild"),
        (jump_to_scene,"scn_uxkhal_fighting_guild"),
        #(entry_point_get_position, pos1, 0),
        #(set_spawn_position, pos1),
        #(spawn_agent,"trp_player"),
        #(entry_point_get_position, pos2, 1),
        #(set_spawn_position, pos2),
        #(spawn_agent,"trp_frederick"),
        #(add_visitors_to_current_scene,0,"trp_player",1,0,0),
        #(add_visitors_to_current_scene,1,"trp_frederick",1,0,0),
        (change_screen_mission),
      ],"Door to the Fighting School."),

code in mission templates:
Code:
  (
    "uxkhal_fighting_guild",mtf_arena_fight,-1,
    "You enter the fighting school.",
    [
      (0,mtef_visitor_source|mtef_team_0,af_override_weapons,0,1,[itm_heavy_practice_sword]),
      (0,mtef_visitor_source|mtef_team_0,af_override_weapons,aif_start_alarmed,1,[itm_heavy_practice_sword]),
      ],
    [
      
    ],
  ),
 
I'm not great with this at all yet, but since you have no replies yet I'll throw out some random ideas I had. Though I guarantee nothing.

First, you didn't define 1 in the mission template, looks like a cut-paste thing, you have two 'zero's

Code:
      (0,mtef_visitor_source|mtef_team_0,af_override_weapons,0,1,[itm_heavy_practice_sword]),
 ---> (0,mtef_visitor_source|mtef_team_0,af_override_weapons,aif_start_alarmed,1,[itm_heavy_practice_sword]),

Second, I heard a rumor once that the number used in set_visitor was not the entry point number, but some other reference number, MIGHT want to check that out, but i'm not sure I believe it.

And if that doesn't work, you could try a scene_source. I haven't done anything with visitor_sources but if you add scn_uxkhal_fighting_guild:entry(1) to trp_frederick in troops.py, Then change your mission template entry for that entry point to:

Code:
(1,mtef_scene_source|mtef_team_0,af_override_weapons,aif_start_alarmed,1,[itm_heavy_practice_sword]),

Then start a new game... assuming all the other stuff is correct, he should show up.
 
The player should never be set as a visitor. Instead, use set_jump_entry. If this scene will only ever be occupied by one npc, then do what Kahsm suggested.
Secondly, your menu option is a bit screwed up. If you want this option to be selectable from the town menu, then move (eq, "$current_town", "p_town_7"), to the condition and remove (eq, 1, 0), which is only necessary if you intend it to be accessible from the scene. (modify_visitors_at_site) is necessary for all visitor operations, but you're modifying "scn_tutorial_training_ground" rather than "scn_uxkhal_fighting_guild". If you've added the proper passage point (after all the existing ones) in Uxhal's scene and made sure your menu options is at the bottom of the list, then it shouldn't be accessible from any other town.
 
here is the code for the arena on floris, just need to change a little bit:


Code:
             (assign, "$g_mt_mode", abm_visit),
             (assign, "$town_entered", 1),
             (set_jump_mission, "mt_arena_melee_fight"),
             (party_get_slot, ":arena_scene", "$current_town", slot_town_arena),
             (modify_visitors_at_site, ":arena_scene"),
             (reset_visitors),
             (set_visitor, 43, "trp_veteran_fighter"),
             (set_visitor, 44, "trp_mercenary_crossbowman"),
             (set_jump_entry, 50),
             (jump_to_scene, ":arena_scene"),
             (scene_set_slot, ":arena_scene", slot_scene_visited, 1),
             (change_screen_mission),
yours should be like
Code:
             (set_jump_mission, "mt_uxkhal_fighting_guild"),
             (modify_visitors_at_site, "scn_uxkhal_fighting_guild"),
             (reset_visitors),
             (set_visitor, 1, "trp_frederick"),
             (set_jump_entry, 0),
             (jump_to_scene, "scn_uxkhal_fighting_guild"),
             (scene_set_slot, "scn_uxkhal_fighting_guild", slot_scene_visited, 1),
             (change_screen_mission),


obs: i might be wrong, I've never handled with scenes and MT's
 
Thanks guys; I got it working now.

Just in case anyone else needs this in the future, I'll post the corrections:

module_game_menus
Code:
("fighting_school",
      [
        (eq,1,0),
      ],"Enter the Fighting School.",
      [
        (eq, "$current_town", "p_town_7"),
        (set_jump_mission,"mt_uxkhal_fighting_guild"),
        (modify_visitors_at_site,"scn_uxkhal_fighting_guild"),
        (reset_visitors),
        (set_visitor,1,"trp_frederick"),
        (set_jump_entry, 0),
        (jump_to_scene,"scn_uxkhal_fighting_guild"),
        (change_screen_mission),
      ],"Door to the Fighting School."),

And mission templates:
Code:
(
    "uxkhal_fighting_guild",mtf_arena_fight,-1,
    "You enter the fighting school.",
    [
      (0,mtef_scene_source|mtef_team_0,af_override_weapons,0,1,[itm_heavy_practice_sword]),
      (1,mtef_visitor_source|mtef_team_0,af_override_weapons,aif_start_alarmed,1,[itm_heavy_practice_sword]),
      ],
    [
      
    ],
  ),
 
ares007 said:
module_game_menus
Code:
("fighting_school",
      [
        (eq,1,0),
      ],"Enter the Fighting School.",
      [
        (eq, "$current_town", "p_town_7"),
        (set_jump_mission,"mt_uxkhal_fighting_guild"),
        (modify_visitors_at_site,"scn_uxkhal_fighting_guild"),
        (reset_visitors),
        (set_visitor,1,"trp_frederick"),
        (set_jump_entry, 0),
        (jump_to_scene,"scn_uxkhal_fighting_guild"),
        (change_screen_mission),
      ],"Door to the Fighting School."),

you should change the (eq, "$current_town", "p_town_7"), to the conditions block, so that it won't appear in other towns.
 
I have a particular reason for putting that there.

This code is in the general town menu, so it is for all towns. I plan on adding fighting schools to more cities so I will eventually put this into a control block where the fighting school you wind up going to will depend on the city you are in. Each school will have a unique cast of characters, scene, dialog, quests, etc.

I'm currently keeping the school only accessible through the town scene via the (eq,1,0), I may change that, but I like having a reason to walk around town :grin:

It will look something like
Code:
("fighting_school",
      [
        (eq,1,0),
      ],"Enter the Fighting School.",
      [
        (try_begin),
          (eq, "$current_town", "p_town_7"),
          (set_jump_mission,"mt_uxkhal_fighting_guild"),
          (modify_visitors_at_site,"scn_uxkhal_fighting_guild"),
          (reset_visitors),
          (set_visitor,1,"trp_frederick"),
          (set_jump_entry, 0),
          (jump_to_scene,"scn_uxkhal_fighting_guild"),
          (change_screen_mission),
        (else_try),
          (eq, "$current_town", "p_town_4"),
          (set_jump_mission,"mt_praven_fighting_guild"),
          (modify_visitors_at_site,"scn_praven_fighting_guild"),
          (reset_visitors),
          (set_visitor,1,"trp_johanne"),
          (set_jump_entry, 0),
          (jump_to_scene,"scn_praven_fighting_guild"),
          (change_screen_mission),
        (else_try),
          ...blah blah blah... more else_try's for more towns... etc
        (try_end),
      ],"Door to the Fighting School."),
 
ares007 said:
I have a particular reason for putting that there.

This code is in the general town menu, so it is for all towns. I plan on adding fighting schools to more cities so I will eventually put this into a control block where the fighting school you wind up going to will depend on the city you are in. Each school will have a unique cast of characters, scene, dialog, quests, etc.

I'm currently keeping the school only accessible through the town scene via the (eq,1,0), I may change that, but I like having a reason to walk around town :grin:

It will look something like
Code:
("fighting_school",
      [
        (eq,1,0),
      ],"Enter the Fighting School.",
      [
        (try_begin),
          (eq, "$current_town", "p_town_7"),
          (set_jump_mission,"mt_uxkhal_fighting_guild"),
          (modify_visitors_at_site,"scn_uxkhal_fighting_guild"),
          (reset_visitors),
          (set_visitor,1,"trp_frederick"),
          (set_jump_entry, 0),
          (jump_to_scene,"scn_uxkhal_fighting_guild"),
          (change_screen_mission),
        (else_try),
          (eq, "$current_town", "p_town_4"),
          (set_jump_mission,"mt_praven_fighting_guild"),
          (modify_visitors_at_site,"scn_praven_fighting_guild"),
          (reset_visitors),
          (set_visitor,1,"trp_johanne"),
          (set_jump_entry, 0),
          (jump_to_scene,"scn_praven_fighting_guild"),
          (change_screen_mission),
        (else_try),
          ...blah blah blah... more else_try's for more towns... etc
        (try_end),
      ],"Door to the Fighting School."),

you could make it simpler:


Code:
("fighting_school",
      [
        (eq,1,0),
      ],"Enter the Fighting School.",
      [
        (try_begin),
          (eq, "$current_town", "p_town_7"),
          (assign, ":jump_mission","mt_uxkhal_fighting_guild"),
          (assign, ":scene", "scn_uxkhal_fighting_guild"),
          (assign, ":visitor_1","trp_frederick"),
        (else_try),
          (eq, "$current_town", "p_town_4"),
          (assign, ":jump_mission","mt_praven_fighting_guild"),
          (assign, ":scene","scn_praven_fighting_guild"),
          (assign, ":visitor1","trp_johanne"),
        (else_try),
          ...blah blah blah... more else_try's for more towns... etc
        (try_end),
          (set_jump_mission,":jump_mission"),
          (modify_visitors_at_site,":scene"),
          (reset_visitors),
          (set_visitor,1,":visitor_1"),
          (set_jump_entry, 0),
          (jump_to_scene,":scene"),
          (change_screen_mission),

      ],"Door to the Fighting School."),


also, you could change the (eq, 1,0), by (scene_slot_eq, ":arena_scene", slot_scene_visited, 1), so that you'll have to visit the scene by yourself and then be able to visit it trough the menus.
 
Back
Top Bottom