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 »Device Script not eating!!!!

Author Topic: Device Script not eating!!!! (6 messages, Page 1 of 1)
Moderators: Dennis

Head Noob
Joined: Oct 3, 2010

This difficulty is for noobs! Mythic is for pros


Posted: Dec 28, 2010 08:44 PM    Msg. 1 of 6       
This is what I have made for scripting a device
(script startup the_guy_from_next_door
(sleep_until (= (device_get_power alpha) 1) 15)
(device_set_power alphadoor 1)
)


Alpha is the device. It can only change once.
Alphadoor is the door. It does not operate automatically.
What happens is that the door does not open when i push the device.
When I add (device_operates_automatically_set alphadoor true)
It opens straight away.
PLZ HELP!!!!!!


d4rfnader
Joined: Jul 16, 2010

Open mouth, insert sandwhich.


Posted: Dec 28, 2010 10:11 PM    Msg. 2 of 6       
Try device_set_position.
Edited by d4rfnader on Dec 28, 2010 at 10:11 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Dec 28, 2010 11:23 PM    Msg. 3 of 6       
Close. Use device_get_position instead of device_get_power, because the control will most likely always be on. Think of it this way:

Let's say the device is a car. If it is off, you can't move the car while you're inside the car because the controls won't respond without power (and because you can't push the car from the inside due to Newton's first law). If the power's on, the car is free to move and change its position.

Your script checks for whether the control is on, and if it's on, it sets the door's power to 1. You want to check for position if you're pressing the button.


Head Noob
Joined: Oct 3, 2010

This difficulty is for noobs! Mythic is for pros


Posted: Dec 28, 2010 11:29 PM    Msg. 4 of 6       
Soooooo:
(script startup the_nibblets_are_for_cats
(sleep_until (= (device_get_position alpha) 1) 15)
(device_set_power alphadoor 1)
)


rerout343
Joined: Aug 7, 2010

Targeted and Firing


Posted: Dec 28, 2010 11:40 PM    Msg. 5 of 6       
Quote: --- Original message by: Head Noob
Soooooo:
(script startup the_nibblets_are_for_cats
(sleep_until (= (device_get_position alpha) 1) 15)
(device_set_power alphadoor 1)
)


No, you want:

(script startup the_nibblets_are_for_cats
(sleep_until (= (device_get_position alpha) 1) 15)
(device_set_position alphadoor 1)
)


The door will only open when its position is set to 1. Also make sure the starting power for the door is set to one in guerilla.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Dec 29, 2010 12:04 AM    Msg. 6 of 6       
Note: The door will automatically close after some time after being forcibly opened. As long as its power is 1, however, it will operate correctly upon close proximity to the player.

 

 
Previous Older Thread    Next newer Thread







Time: Mon May 25, 2020 7:31 AM 156 ms.
A Halo Maps Website