
test01
Joined: Sep 29, 2011
|
Posted: Nov 6, 2011 12:21 AM
Msg. 1 of 1
After literally hours and hours of trying to get a simple script working, i've given up and decided to let the community help me. Anyways, basically what i'm trying to do is "replace" flashlight for active camouflage, but i'm getting a lot of errors from sapien and i don't even think i'm doing my scripts right...
(script continuous flash_camo (if (= (unit_get_current_flashlight_state (unit (list_get (players) 0))) true) (cheat_all_powerups) (unit_set_desired_flashlight_state (unit (list_get (players) 0)) false) (sleep 700) ) )
Sapien error: 11.06.11 13:59:08 i expected (if <condition> <then> [<else>]).: (if (= (unit_get_current_flashlight_state (unit (list_get (players) 0)) false)(cheat_all_powerups)(sleep 700))))
I've already edited globals.globals and set all_powerups to only spawn active camo, then i edited active camo so that it has a larger "bounding radius" so it takes effect immediately rather than trying to find where the powerup spawned. This all worked perfectly in-game when i used cheat_all_powerups, it's just the script i need help with.
I guess i'm using the wrong type of scripts, according to halo script bible the description of unit_get_current_flashlight_state doesn't look like it matches what i did here, but i just can't work out any other better ways
EDIT:: Never mind. My friend kirby_422 on xfire fixed it for me. I'll just post it as a reference in case someone else might want to do something similar to what i'm doing
(script continuous flash_camo (sleep_until (= (unit_get_current_flashlight_state (unit (list_get (players) 0))) true) 10) (cheat_all_powerups) (unit_set_desired_flashlight_state (unit (list_get (players) 0)) false) (sleep 700) ) Edited by test01 on Nov 6, 2011 at 12:54 AM
|