Player does not spawn in scene

Users who are viewing this thread

Janycz

Knight at Arms
Hello everybody!
I have a scene with entry points:
Code:
("start_lietuva", sf_generate, "none", "none", (0, 0), (100, 100), -100, "0x000000013000007f000ffd66000041ef00005ae800003c55",[], [], "outer_terrain_plain"),
The initialization of the situation on the stage is as follows:
Option in camp menu
Code:
("dbg_lietuva_start_battle", [], "DEBUG: Lietuva start battle",     
      [
      (call_script, "script_janycz_init_lietuva_start_battle"),
      (jump_to_scene, "scn_start_lietuva"),
      (change_screen_mission),
      ]),

Scripts:
Code:
("janycz_init_lietuva_start_battle", [
    (set_jump_mission,"mt_janycz_lietuva_start_battle"),
    (modify_visitors_at_site, "scn_start_lietuva"),
    (reset_visitors),
    (set_visitors, 0, "trp_player"),
    (try_for_range, ":entry", 1, 8),
      (set_visitors, ":entry", "trp_litva_std_castle_regular", 1),
    (try_end),
    (try_for_range, ":entry", 10, 18),
      (set_visitors, ":entry", "trp_lit_exp_archer", 1),
    (try_end),
    (set_visitors, 18, "trp_lit_castle_3", 1),
    (set_visitors, 19, "trp_lit_town_warrior", 1),
    (set_visitors, 20, "trp_lit_spearman", 1),
    (set_visitors, 21, "trp_teuton_brother", 1),
    (set_visitors, 22, "trp_teuton_squire", 1),
    (set_visitors, 23, "trp_teuton_veteran_footman", 1),
    (set_visitors, 24, "trp_teuton_spear_buerger_infantry", 1),
    (set_visitors, 25, "trp_teuton_town_infantry", 1),
    (set_visitors, 26, "trp_teuton_veteran_footman", 1),
    (set_visitors, 27, "trp_teuton_crossbow_guard", 1),
    (set_visitors, 28, "trp_teuton_veteran_footman", 1),
  ]),

Mission templates:
Code:
  ("janycz_lietuva_start_battle", mtf_battle_mode, -1, "The battle has begun.",
  [
    (0, mtef_visitor_source | mtef_team_0, af_override_weapons, 0, 1, []), #player
    (1, mtef_visitor_source | mtef_team_1, af_override_everything, 0, 1, [itm_peasant_b]), #dead lietuva warrior
    (2, mtef_visitor_source | mtef_team_1, af_override_everything, 0, 1, [itm_peasant_c, itm_hide_boots]), #dead lietuva warrior
    (3, mtef_visitor_source | mtef_team_1, af_override_everything, 0, 1, [itm_balt_shirt_a]), #escape lietuva warrior
    (4, mtef_visitor_source | mtef_team_1, af_override_everything, 0, 1, [itm_balt_shirt_b]), #escape lietuva warrior
    (5, mtef_visitor_source | mtef_team_1, af_override_everything, 0, 1, [itm_balt_fur_coat_a, itm_hunter_boots]), #escape lietuva warrior
    (6, mtef_visitor_source | mtef_team_1, af_override_everything, aif_start_alarmed, 1, [itm_noble_cloak, itm_wrapping_boots, itm_euro_sword_b]), #lietuva warrior
    (7, mtef_visitor_source | mtef_team_1, af_override_everything, aif_start_alarmed, 1, [itm_peasant_tunic_a, itm_euro_sword_c, itm_tab_shield_heater_a]), #lietuva warrior
	
	(10, mtef_visitor_source | mtef_team_1, 0, 0, 1, []), #lietuva archer
	(11, mtef_visitor_source | mtef_team_1, 0, 0, 1, []), #lietuva archer
	(12, mtef_visitor_source | mtef_team_1, 0, 0, 1, []), #lietuva archer
	(13, mtef_visitor_source | mtef_team_1, 0, 0, 1, []), #lietuva archer
	(14, mtef_visitor_source | mtef_team_1, 0, 0, 1, []), #lietuva archer
	(15, mtef_visitor_source | mtef_team_1, 0, 0, 1, []), #lietuva archer
	(16, mtef_visitor_source | mtef_team_1, 0, 0, 1, []), #lietuva archer
	(17, mtef_visitor_source | mtef_team_1, 0, 0, 1, []), #lietuva archer
	(18, mtef_visitor_source | mtef_team_1, 0, 0, 1, []), #lietuva pikeman
	(19, mtef_visitor_source | mtef_team_1, 0, 0, 1, []), #lietuva pikeman
	(20, mtef_visitor_source | mtef_team_1, 0, 0, 1, []), #lietuva pikeman
	
	(21, mtef_visitor_source | mtef_team_2, 0, 0, 1, []), #rittenbruder
	(22, mtef_visitor_source | mtef_team_2, 0, 0, 1, []), #rittenbruder
	
	(23, mtef_visitor_source | mtef_team_2, 0, 0, 1, []), #dead teutonic warrior
	(24, mtef_visitor_source | mtef_team_2, 0, 0, 1, []), #dead teutonic warrior
	(25, mtef_visitor_source | mtef_team_2, 0, 0, 1, []), #dead teutonic warrior
	(26, mtef_visitor_source | mtef_team_2, 0, 0, 1, []), #dead teutonic warrior
	(27, mtef_visitor_source | mtef_team_2, 0, 0, 1, []), #dead teutonic warrior
	(28, mtef_visitor_source | mtef_team_2, 0, 0, 1, []), #dead teutonic warrior
	
	(29, mtef_visitor_source | mtef_team_2, 0, aif_start_alarmed, 40, []), #teutonic horsemans
	(30, mtef_visitor_source | mtef_team_2, 0, aif_start_alarmed, 40, []), #teutonic horsemans
	
	
  ],
  [
    (ti_after_mission_start, 0, 0, [], 
	[ 
	  (team_set_relation, 0, 1, 1), 
	  (team_set_relation, 0, 2, -1), 
	  (team_set_relation, 1, 2, -1),   
	  (team_give_order, 2, grc_everyone, mordr_charge),
	  (entry_point_get_position, pos3, 22),
      (set_spawn_position, pos3),
      (spawn_horse, "itm_sumpter_horse", 0),
	  (entry_point_get_position, pos3, 0),
      (set_spawn_position, pos3),
      (spawn_item, "itm_euro_sword_a", 0),
	]),
	
	(0.5, 0, ti_once, 
	[
	  (assign, ":t", 0),
      (try_for_agents, ":agent"),
        (neq, ":agent", -1),
        (agent_is_alive, ":agent"),
        (agent_get_entry_no, ":entry", ":agent"),
        (is_between, ":entry", 3, 6),
        (val_add, ":t", 1),
      (try_end),
      (eq, ":t", 3),
	],
	[
	  (try_for_agents, ":agent"),
        (neq, ":agent", -1),
        (agent_is_alive, ":agent"),
        (agent_get_entry_no, ":entry", ":agent"),
        (is_between, ":entry", 3, 6),
        (agent_start_running_away, ":agent"),
      (try_end),
	]
	),
	
	(0.5, 0, 0, [],
	[
	  (try_for_agents, ":agent"),
	    (neq, ":agent", -1),
        (agent_is_alive, ":agent"),
        (agent_get_entry_no, ":entry", ":agent"),
		(try_begin),
		  (this_or_next|is_between, ":entry", 1, 3),
		  (is_between, ":entry", 23, 29),
		  (agent_deliver_damage_to_agent, ":agent", ":agent", 1000),
		(try_end),
	  (try_end),
	]),
	
	(ti_on_agent_killed_or_wounded, 0, 0, [
	  (store_trigger_param_1, ":dead_agent_no"),
	  (agent_is_human, ":dead_agent_no"),
	  (agent_get_troop_id, ":troop", ":dead_agent_no"),
	  (eq, ":troop", "trp_teuton_brother"),
	],
	[
	  (store_current_scene, ":cur_scene"),
      (modify_visitors_at_site, ":cur_scene"),
	  (set_visitors, 29, "trp_teuton_halfbrother", 40),
      (set_visitors, 30, "trp_teuton_squire", 40),
      (str_store_string, s1, "str_lit_start_battle_message"),
      (str_store_string, s2, "str_lit_start_battle_message_title"),
      (dialog_box, "@{s1}", "@{s2}"),
	]),

	(1, 0, ti_once, [], [(play_track, "track_tantaradei", 1), ]),

    (0, 0, ti_once, 
    [
      (tutorial_message_set_size, 15, 15),
      (tutorial_message_set_position, 500, 650), #650 for tutorial or mission msg, 450 for dialogs
      (tutorial_message_set_center_justify, 0),
    ], []),

    (0.25, 4, ti_once, [], 
    [
      (tutorial_message_set_background, 1),
      (tutorial_message, "str_captain_speech"),
    ]),

    (1, 4, ti_once,
    [
      (main_hero_fallen),
      (assign,"$g_battle_result",-1),
    ],
    [
      (call_script, "script_equip_player_after_starting_battle"),
      (call_script, "script_set_lord_info_at_game_start"),#lord info searching addition, GNK
      (call_script, "script_set_center_info_at_game_start"),#center info searching addition, GNK
      (str_store_string, s1, "str_lit_start_battle_end"),
      (str_store_string, s2, "str_lit_start_battle_end_title"),
      (dialog_box, "@{s1}", "@{s2}"),
      (finish_mission,2), (assign,"$g_in_mission", 0),
      (change_screen_return), #just in case
    ]),
], ),
In the game I go to the camp menu, I choose 'DEBUG: Lietuva start battle', I get on the stage. But was something strange going on with the camera:
a224e87b94eb84d58b6a680e0c39f2e8.png
I look at the actions from the height. Reason: I understand that the player did not spawn.
But why? Why player did not spawn? How to fix it?
 
You usually use set_jump_entry for the player. Sometimes Native code uses
Code:
(set_visitor, 0, "trp_player"),
not set_visitors. In your code you are also using set_visitors without specifying the amount of "trp_player" to spawn.
 
Somebody said:
You usually use set_jump_entry for the player. Sometimes Native code uses
Code:
(set_visitor, 0, "trp_player"),
not set_visitors. In your code you are also using set_visitors without specifying the amount of "trp_player" to spawn.
Thanks. It works.
 
Back
Top Bottom