
rerout343
Joined: Aug 7, 2010
Targeted and Firing
|
Posted: Dec 15, 2010 05:08 AM
Msg. 1 of 7
I've run into yet another scripting problem. Does anyone know the proper way to set up the sleep command for this script?
(sleep_until (condition 1) and (condition 2) = 1/true)
The problem is that I have TWO conditions but it only waits until the first is completed. Edited by rerout343 on Dec 15, 2010 at 05:51 AM
|
|
|

MoooseGuy
Joined: Aug 10, 2008
I Approve This Message.
|
Posted: Dec 15, 2010 05:42 AM
Msg. 2 of 7
(sleep_until (= (condition) short/boolean))
|
|
|

rerout343
Joined: Aug 7, 2010
Targeted and Firing
|
Posted: Dec 15, 2010 05:51 AM
Msg. 3 of 7
Quote: --- Original message by: MoooseGuy (sleep_until (= (condition) short/boolean)) The problem is that I have TWO conditions but it only waits until the first is completed.
|
|
|

MoooseGuy
Joined: Aug 10, 2008
I Approve This Message.
|
Posted: Dec 15, 2010 05:54 AM
Msg. 4 of 7
(sleep_until (and (= (condition) short/boolean) (= (condition) short/boolean)))
or
(sleep_until (or (= (condition) short/boolean) (= (condition) short/boolean)))
depending on what you want
|
|
|

rerout343
Joined: Aug 7, 2010
Targeted and Firing
|
Posted: Dec 15, 2010 06:03 AM
Msg. 5 of 7
This is what have:
(sleep_until (and (= (unit_has_weapon_readied (unit (list_get (players) 0)) det) 1)) (= (player_action_test_primary_trigger) 1)))
I based it off what you said but I keep getting:
12.15.10 06:00:05 [test line 3] the and call requires at least 2 arguments.: (and (= (unit_has_weapon_readied (unit (list_get (players) 0)) det) 1)) (= (player_action_test_primary_trigger) 1)))
12.15.10 06:00:05 recompiling scripts after scenarios were merged. 12.15.10 06:00:05 the and call requires at least 2 arguments.: (and (= (unit_has_weapon_readied (unit (list_get (players) 0)) det) 1)) (= (player_action_test_primary_trigger) 1)))
|
|
|

rerout343
Joined: Aug 7, 2010
Targeted and Firing
|
Posted: Dec 15, 2010 06:43 AM
Msg. 6 of 7
I tried your method Juan but it still skips the second condition and runs as soon as the weapon is picked up not fired.
EDIT: Nevermind, after I tried your updated script it worked perfectly. Thanks for the help. Edited by rerout343 on Dec 15, 2010 at 06:48 AM
|
|
|

MoooseGuy
Joined: Aug 10, 2008
I Approve This Message.
|
Posted: Dec 15, 2010 08:46 AM
Msg. 7 of 7
Oh lol, silly me. I forgot that and and or are used for if statements....
|
|
|