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 »New problem

Author Topic: New problem (9 messages, Page 1 of 1)
Moderators: Dennis

Co1t3r
Joined: Dec 13, 2008


Posted: Sep 27, 2009 12:48 PM    Msg. 1 of 9       
Ok so I added a subscript to my map to to stop the player from going out of bounds. It does:
(script dormant check_boundries_p1
(sleep_until (volume_test_objects part_1 (players))0)
(game_lost)
)

to see whether or not the player has gone out of the trigger volume. Apparently though this will return true if there is a player in the volume. How do I get this to work properly?


chrisk123999
Joined: Aug 10, 2008

=CE= Chris [Captain] [=]


Posted: Sep 27, 2009 03:40 PM    Msg. 2 of 9       
The 0 is in the wrong spot.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Sep 27, 2009 04:12 PM    Msg. 3 of 9       
The 0 is in the right spot. The problem is the 0. You're checking to see if a player's inside a trigger volume every 0 seconds, which means that you're never checking it. Change the 0 to a 1, or another integer higher than 0.


Co1t3r
Joined: Dec 13, 2008


Posted: Sep 27, 2009 04:31 PM    Msg. 4 of 9       
Ok I go it now I think.
(if (= (volume_test_objects part_1 (players))false)(game_lost))

Edited by colter13 on Sep 27, 2009 at 04:39 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Sep 27, 2009 04:49 PM    Msg. 5 of 9       
Do people not format anymore? Anyway, this is what you get if you format it:

(if
(= (volume_test_objects part_1 (players)) false)
(game_lost)
)


You'll probably notice the missing parentheses. Also, your intended purpose was to keep the player inside the trigger volume. However, unless you're using this in a continuous script, the if command will execute once and only once at the time of reference. So if you call the if command in a startup, if the player spawns inside the trigger volume, then it'll never lose. I recommend you don't mess around with if commands if you're a beginner to scripting.


The ideal script would be:

(script continuous stay_inside
(if
(not (volume_test_objects part_1 (players)) false))
(begin
(game_lost)
)
)
)

Edited by Gamma927 on Sep 27, 2009 at 04:51 PM


Co1t3r
Joined: Dec 13, 2008


Posted: Sep 27, 2009 05:17 PM    Msg. 6 of 9       
I actually found this to work better:
(script continuous stay_inside
(if
(!= (volume_test_objects part_1 (players)) true)
(game_lost)
)
)

Thanks for the help once again. I added you on Xfire so would mind if I messaged you next time I run into scripting problems?


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Sep 27, 2009 05:42 PM    Msg. 7 of 9       
Yea go ahead, but hardly ever use the gamma927 account much nowadays. And I looked at my script again, and I accidentally set it to "if not false", instead of "if not true". Also, your script is missing a parentheses, to close the !=. Other than that, it works.


Co1t3r
Joined: Dec 13, 2008


Posted: Sep 27, 2009 07:49 PM    Msg. 8 of 9       
Actually my scripts compiled and worked yet it wouldn't compile your's :-/ Also I have run into yet
another few problems.

#1: Eventually I need to pause my first 'stay_inside' scripts since I need to move the player to a new location. When I use (pause # script) I need to specify the amount of time to pause for, but I want it to pause infinitely.

#2: Instead of game_revert I wanted to use something more interesting; unit_kill. I don't know what unit to apply it though if I want it to work on the player. Player, player0 and players don't work.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Sep 27, 2009 08:18 PM    Msg. 9 of 9       
For case one, I'd usually have a boolean set to true, and have the 'stay_inside' script only run while the boolean is true. To turn off the script, I'd just set the boolean to false, and the script would cease to run.

For case 2, if this is a Single player map, to refer to the player, you would use:
(unit (list_get (players) 0))
You can define it as a static unit, so you don't have to type (unit (list_get (players) 0)) every time you want to refer to it.

(script static unit player
(unit (list_get (players) 0))
)


Copy that somewhere into your script. Whenever you want to refer to the player, type "player". This is only for single player though. If it's multiplayer, you'd have to put (unit (list_get (players) 1)), or 2, or so on, to refer to the specific player. The player numbers start counting from 0, just for your information.

 

 
Previous Older Thread    Next newer Thread







Time: Fri January 20, 2023 6:10 PM 93 ms.
A Halo Maps Website