Use cast_ray to check for collision meshes.HyperCharge said:My cannonball is not seeing the mission objects, its only cares about terrain level. how can i check that collision object kind ? is there any variable to check collision object kind ?
(cast_ray, <destination>, <hit_position_register>, <ray_position_register>, [<ray_length_fixed_point>]),
# Version 1.161+. Casts a ray starting from <ray_position_register> and stores the closest hit position into <hit_position_register> (fails if no hits). If the body hit is a scene prop, its instance id will be stored into <destination>, otherwise it will be -1.
_Sebastian_ said:Use cast_ray to check for collision meshes.HyperCharge said:My cannonball is not seeing the mission objects, its only cares about terrain level. how can i check that collision object kind ? is there any variable to check collision object kind ?
Code:(cast_ray, <destination>, <hit_position_register>, <ray_position_register>, [<ray_length_fixed_point>]), # Version 1.161+. Casts a ray starting from <ray_position_register> and stores the closest hit position into <hit_position_register> (fails if no hits). If the body hit is a scene prop, its instance id will be stored into <destination>, otherwise it will be -1.
Create a presentation with a number entry field. Use it to jump to a scene.
Or create a dynamic menu with all scenes in the game (there is a OSP pack for that) using Python.
Or if you can't get those two to work: use any shortcut (like a trigger with a key clicked operation) to jump to a specific scene. Change it on your txt or modules source.
Simpler is better. I'm just trying to add entry points.There's the old scene chooser that generates python tuples for each scene in menu format, might want to take a look at that. Basically you tackle a menu option onto the tutorial training ground in the main menu and you're good to go.
common_siege_question_answered = (
ti_question_answered, 0, 0, [],
[
(store_trigger_param_1,":answer"),
(eq,":answer",0),
(assign, "$pin_player_fallen", 0),
(get_player_agent_no, ":player_agent"),
(agent_get_team, ":agent_team", ":player_agent"),
(try_begin),
(neq, "$attacker_team", ":agent_team"),
(neq, "$attacker_team_2", ":agent_team"),
(str_store_string, s5, "str_siege_continues"),
(call_script, "script_simulate_retreat", 8, 15, 0),
(else_try),
(str_store_string, s5, "str_retreat"),
(call_script, "script_simulate_retreat", 5, 20, 0),
(try_end),
(call_script, "script_count_mission_casualties_from_agents"),
(finish_mission,0),
])
Bithon said:Can anyone explain to my why module_mission_template is not consistent with its description.
jacobhinds said:Those aren't the actual templates, they're blocks of code that get inserted in later on (so for example, the compiler replaces every instance of common_siege_question_answered with that block of code).
Scroll or search for mission_templates, and you'll find where the actual mission templates begin. They're in between two square brackets near the beginning and end of the file.
mission_templates = [
(
"town_default",0,-1,
"Default town visit",
("cf_free_play", # free mode
[
(eq, "$story", 0),
(display_message, "@free play mode isn't finished yet, expect bugs"),
(assign, ":save_reg0", reg0),
(assign, reg0, 0),
(set_show_messages, 0),
(try_for_parties, ":cur_party"),
(store_faction_of_party, ":party_faction", ":cur_party"),
(eq, ":party_faction", "fac_kingdom_2"),
(try_begin),
(is_between, ":cur_party", centers_begin, centers_end),
(call_script, "script_give_center_to_faction", ":cur_party", "fac_kingdom_4"),
(try_end),
(try_end),
(try_for_range, ":lord", 0, kingdom_ladies_end),
(call_script, "script_lord_find_alternative_faction", ":lord"),
(assign, ":new_faction", reg0),
(try_begin),
(neq, ":new_faction", "fac_kingdom_2"),
(call_script, "script_change_troop_faction", ":lord", ":new_faction"),
(else_try),
(call_script, "script_change_troop_faction", ":lord", "fac_kingdom_4"),
(try_end),
(try_end),
(faction_set_slot, "fac_kingdom_2", slot_faction_state, sfs_defeated),
(assign, reg0, ":save_reg0"),
(set_show_messages, 1),
]),
Cozur said:What program is used to edit mb.fx?
https://developer.nvidia.com/fx-composerCozur said:What program is used to edit mb.fx?
Cozur said:Looks like this:
when trying to open it in Notepad.
(ti_on_agent_killed_or_wounded, 0, 0,[
(store_trigger_param_1, ":dead_agent_no"),
(store_trigger_param_2, ":attacker_agent_no"),
(neg|agent_is_human, ":dead_agent_no"), # if is horse
(agent_get_rider, ":rider_agent", ":dead_agent_no"),
(agent_is_active, ":rider_agent"),
(try_begin),
(agent_is_active, ":attacker_agent_no"), # can be -1 if horse jumps from high altitude
(agent_deliver_damage_to_agent, ":attacker_agent_no", ":rider_agent", 123456),
(else_try),
(agent_deliver_damage_to_agent, ":rider_agent", ":rider_agent", 123456),
(try_end),
]),
The_dragon said:@HyperCharge
Code:(ti_on_agent_killed_or_wounded, 0, 0,[ (store_trigger_param_1, ":dead_agent_no"), (store_trigger_param_2, ":attacker_agent_no"), (neg|agent_is_human, ":dead_agent_no"), # if is horse (agent_get_rider, ":rider_agent", ":dead_agent_no"), (agent_is_active, ":rider_agent"), (try_begin), (agent_is_active, ":attacker_agent_no"), # can be -1 if horse jumps from high altitude (agent_deliver_damage_to_agent, ":attacker_agent_no", ":rider_agent", 123456), (else_try), (agent_deliver_damage_to_agent, ":rider_agent", ":rider_agent", 123456), (try_end), ]),