The Dark Robin said:I am creating a new backstory, and have run into a problem. After modifying some stuff, I've ended up with this mission template:
Code:( "alley_fight", mtf_battle_mode,charge, "Alley fight", [ (0,mtef_team_0|mtef_use_exact_number,0,aif_start_alarmed,1,[]), (1,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]), (2,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]), (3,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]), (4,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]), (5,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]), (6,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]), (7,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]), (8,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]), (9,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]), (10,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]), (11,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]), (12,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]), ], [ common_inventory_not_available, (ti_on_agent_spawn, 0, 0, [], [ (store_trigger_param_1, ":agent_no"), (get_player_agent_no, ":player_agent"), (try_begin), (neq, ":agent_no", ":player_agent"), (agent_ai_set_aggressiveness, ":agent_no", 199), (try_end), (assign, "$g_main_attacker_agent", "trp_slaver_chief"), ]), # Health regen for the player (5, 0, 0, [ (neg|main_hero_fallen), (get_player_agent_no, ":agent"), (agent_is_alive, ":agent"), ], [ (get_player_agent_no, ":agent"), (store_agent_hit_points, ":health", ":agent", 1), (val_add, ":health", 1), (agent_set_hit_points, ":agent", ":health", 1), ]), (ti_tab_pressed, 0, 0, [], [ (display_message, "str_cannot_leave_now"), ]), (0, 0, ti_once, [], [ (set_party_battle_mode), ]), (0, 0, ti_once, [ (neg|main_hero_fallen), (this_or_next|neg|agent_is_alive, "$g_main_attacker_agent"), (agent_is_wounded, "$g_main_attacker_agent"), ], [ (jump_to_menu, "mnu_first_backstory_player_won"), (finish_mission), ]), (0, 0, ti_once, [ (main_hero_fallen), ], [ (jump_to_menu, "mnu_first_backstory_player_lost"), (finish_mission), ]), ]+ common_sprint, ),
However, on entering the mission, the player is immediately sent to the first_backstory_player_won menu, even though the slaver chief is clearly still alive.
And here is the script that starts the mission:
Code:#script_prepare_alley_to_fight ( "prepare_alley_to_fight", [ #(store_faction_of_party, ":faction_no", "$current_town"), (stop_all_sounds, 1), (play_track, "track_children_of_the_future", 1), (modify_visitors_at_site, "scn_first_forest_fight"), (reset_visitors), (set_visitor, 0, "trp_player"), (set_visitor, 1, "trp_manhunter"), (set_visitor, 2, "trp_manhunter"), (set_visitor, 3, "trp_manhunter"), (set_visitor, 4, "trp_manhunter"), (set_visitor, 5, "trp_manhunter"), (set_visitor, 6, "trp_manhunter"), (set_visitor, 7, "trp_manhunter"), (set_visitor, 8, "trp_manhunter"), (set_visitor, 9, "trp_manhunter"), (set_visitor, 10, "trp_manhunter"), (set_visitor, 11, "trp_slave_driver"), (set_visitor, 12, "trp_slaver_chief"), #(try_begin), # (eq, ":faction_no", "fac_kingdom_1"), #swadian # (assign, ":bandit_troop", "trp_steppe_bandit"), #(else_try), # (eq, ":faction_no", "fac_kingdom_2"), #vaegir # (assign, ":bandit_troop", "trp_taiga_bandit"), #(else_try), # (eq, ":faction_no", "fac_kingdom_3"), #khergit # (assign, ":bandit_troop", "trp_mountain_bandit"), #(else_try), # (eq, ":faction_no", "fac_kingdom_4"), #nord # (assign, ":bandit_troop", "trp_sea_raider"), #(else_try), # (eq, ":faction_no", "fac_kingdom_5"), #rhodok # (assign, ":bandit_troop", "trp_forest_bandit"), #(else_try), # (eq, ":faction_no", "fac_kingdom_6"), #sarranid # (assign, ":bandit_troop", "trp_desert_bandit"), #(try_end), #(set_visitor, 3, ":bandit_troop"), (jump_to_scene, "scn_first_forest_fight"), (set_jump_mission,"mt_alley_fight"), (change_screen_mission), ]),
Code is really badly formatted, (I have a headache so yeah. ) but it should work.
The Dark Robin said:Perhaps this got lost in the off topic stuff.
(assign, "$g_main_attacker_agent", "trp_slaver_chief"),
(this_or_next|neg|agent_is_alive, "$g_main_attacker_agent"),
(agent_is_wounded, "$g_main_attacker_agent"),
(assign, "$g_main_attacker_agent", "trp_slaver_chief"),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(eq, ":troop_no", "trp_slaver_chief"),
(assign, "$g_main_attacker_agent", ":agent_no"),
Waldzios said:The Dark Robin said:Perhaps this got lost in the off topic stuff.
First you are assigning troop id (trp_slaver_chief) as $g_main_attacker_agent:
then you using it as agent id:Code:(assign, "$g_main_attacker_agent", "trp_slaver_chief"),
it will not work.Code:(this_or_next|neg|agent_is_alive, "$g_main_attacker_agent"), (agent_is_wounded, "$g_main_attacker_agent"),
Instead of:
You need something like that:Code:(assign, "$g_main_attacker_agent", "trp_slaver_chief"),
Code:(agent_get_troop_id, ":troop_no", ":agent_no"), (eq, ":troop_no", "trp_slaver_chief"), (assign, "$g_main_attacker_agent", ":agent_no"),
["plate_boots2", "Silver Plate Boots", [("plate_boots2",0)], itp_merchandise| itp_type_foot_armor | itp_attach_armature,0, 3470 , weight(4.5)|abundance(70)|head_armor(0)|body_armor(0)|leg_armor(39)|difficulty(12) ,imodbits_plate ],
McBeanie said:After adding some new armors to my game, I loaded it up and this happened. Anyone know what I did wrong?
#script_game_get_item_extra_text:
# This script is called from the game engine when an item's properties are displayed.
# INPUT: arg1 = item_no, arg2 = extra_text_id (this can be between 0-7 (7 included)), arg3 = item_modifier
# OUTPUT: result_string = item extra text, trigger_result = text color (0 for default)
("game_get_item_extra_text",
[
(store_script_param, ":item_no", 1),
(store_script_param, ":extra_text_id", 2),
(store_script_param, ":item_modifier", 3),
(try_begin),
(is_between, ":item_no", food_begin, food_end),
(try_begin),
(eq, ":extra_text_id", 0),
(assign, ":continue", 1),
(try_begin),
(this_or_next|eq, ":item_no", "itm_cattle_meat"),
(this_or_next|eq, ":item_no", "itm_pork"),
(eq, ":item_no", "itm_chicken"),
(eq, ":item_modifier", imod_rotten),
(assign, ":continue", 0),
(try_end),
(eq, ":continue", 1),
(item_get_slot, ":food_bonus", ":item_no", slot_item_food_bonus),
(assign, reg1, ":food_bonus"),
(set_result_string, "@+{reg1} to party morale"),
(set_trigger_result, 0x4444FF),
(try_end),
# Modification Begin
(else_try),
(try_begin),
(eq, ":item_no", "itm_unique_sword"),
(eq, ":extra_text_id", 0),
(set_result_string, "@This sword was forged by a drunk blacksmith, hence it's uniqueness."),
(set_trigger_result, 0xFFEEDD),
(try_end),
# Modification End
(else_try),
(is_between, ":item_no", readable_books_begin, readable_books_end),
(try_begin),
(eq, ":extra_text_id", 0),
(item_get_slot, reg1, ":item_no", slot_item_intelligence_requirement),
(set_result_string, "@Requires {reg1} intelligence to read"),
(set_trigger_result, 0xFFEEDD),
(else_try),
(eq, ":extra_text_id", 1),
(item_get_slot, ":progress", ":item_no", slot_item_book_reading_progress),
(val_div, ":progress", 10),
(assign, reg1, ":progress"),
(set_result_string, "@Reading Progress: {reg1}%"),
(set_trigger_result, 0xFFEEDD),
(try_end),
(else_try),
(is_between, ":item_no", reference_books_begin, reference_books_end),
(try_begin),
(eq, ":extra_text_id", 0),
(try_begin),
(eq, ":item_no", "itm_book_wound_treatment_reference"),
(str_store_string, s1, "@wound treament"),
(else_try),
(eq, ":item_no", "itm_book_training_reference"),
(str_store_string, s1, "@trainer"),
(else_try),
(eq, ":item_no", "itm_book_surgery_reference"),
(str_store_string, s1, "@surgery"),
(try_end),
(set_result_string, "@+1 to {s1} while in inventory"),
(set_trigger_result, 0xFFEEDD),
(try_end),
(try_end),
]),
Lumos said:For God's sake...xPearse said:Looked in the osp but didn't find anything, searched here and found this. Im not good at this and don't know how to set this up for the zombies troops I have, any help on how to.
Easy as pie.Code:(ti_on_agent_spawn, 0, 0, [ (store_trigger_param, ":agent", 1), (agent_get_troop_id, ":troop", ":agent"), (troop_get_type, ":race", ":troop"), (eq, ":race", tf_ZOMBIE_MOTHER_****ER), # Whatever you've got them defined as in header_troops and module_skins (agent_set_speed_limit, ":agent", 4), ], []),