A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE Technical / Map Design »Help with RPG scripting

Author Topic: Help with RPG scripting (5 messages, Page 1 of 1)
Moderators: Dennis

Muscl3r
Joined: May 22, 2010

dont pray 4 easy lives...pray to be STRONGER MEN


Posted: Apr 10, 2012 04:32 AM    Msg. 1 of 5       
I downloaded Noobyourmom's Rpg tutorial but i'm having trouble understanding some of it.

(if (= (player_action_test_primary_trigger) 0) (camera_set camera_marker 0))
(if (= (player_action_test_primary_trigger) 0) (show_hud_help_text true))
(if (= (player_action_test_primary_trigger) 0) (hud_set_help_text obj_x))
(if (= (player_action_test_primary_trigger) 0) (player_action_test_reset))
(if (= (player_action_test_primary_trigger) 0) (sleep_until (= (or
(player_action_test_jump) (player_action_test_primary_trigger)) true) 15))

Does all of this happen when the player presses the primary trigger? Or does each line require the player to press the trigger?


The Cereal Killer
Joined: Mar 18, 2011

Scripts, AI, cutscenes, ui_widgets, animation.


Posted: Apr 10, 2012 10:26 AM    Msg. 2 of 5       
Each line tests for the primary trigger but the test for a player action does not reset to false until (player_action_test_reset) is used, so it causes all of those conditionals to return "true" and execute. A more easily readable script, however, would be this:

(if (= (player_action_test_primary_trigger) 0) (begin
(camera_set camera_marker 0)
(show_hud_help_text true)
(hud_set_help_text obj_x)
(player_action_test_reset)
))

I'm not sure what the point of the last conditional is, but I'd assume it is a link to more of the script, so just leave it the way it is.
Edited by The Cereal Killer on Apr 10, 2012 at 10:29 AM


Muscl3r
Joined: May 22, 2010

dont pray 4 easy lives...pray to be STRONGER MEN


Posted: Apr 10, 2012 04:54 PM    Msg. 3 of 5       
yeah it is a link. I am also a bit confused about the decision script:


(if (= (player_action_test_primary_trigger) 0) (camera_set odst1 0))
(if (= (player_action_test_primary_trigger) 0) (hud_set_help_text obj7))
(if (= (player_action_test_primary_trigger) 0) (player_action_test_reset))
(sleep_until (or (or (= (player_action_test_zoom) true) (= (player_action_test_action)
true)) (= (player_action_test_primary_trigger) true)) 15)
(if (or (= (player_action_test_zoom) true) (= (player_action_test_primary_trigger) true))
(wake no))
(if (= (player_action_test_action) true) (wake reach))

Do i have to make two new scripts each time there is a desicion? If i had a conversation with a lot of desicions, there would be a lot of scripts. I guess I could put up with that but is there another way?


The Cereal Killer
Joined: Mar 18, 2011

Scripts, AI, cutscenes, ui_widgets, animation.


Posted: Apr 10, 2012 06:43 PM    Msg. 4 of 5       
It could easily be all contained within one script if it is only a conversation and your response just decides what dialogue comes next, while decisions which lead to two possible actions fork off into two new scripts with the outcomes.


Muscl3r
Joined: May 22, 2010

dont pray 4 easy lives...pray to be STRONGER MEN


Posted: Apr 15, 2012 12:44 AM    Msg. 5 of 5       
ok this is making a lot more sense now.

So for linear sections of the conversation, I could just use:

(hud_set_help_text obj1)
(player_action_test_reset)
(sleep_until (player_action_test_jump)15)
(hud_set_help_text obj2)

Would that work?

 

 
Previous Older Thread    Next newer Thread







Time: Fri January 20, 2023 10:28 AM 125 ms.
A Halo Maps Website