My first (and only) scripting language is something called "HSC" that's based of of Lisp. I'm trying to learn Unreal Script now but I'm completely at a loss as to how it works. If you guys could translate some functions from Lisp to Uscript it would really help me understand how things are structured in Uscript.
// How do I create a command that continually checks a variable and then changes a value based on that.
(script continuous "checkfunction"
(if ( > var_short 4) //checks to see if this short is greater than 4
(begin (set var_boolean true) ) //if it's greater than 4 it sets this boolean true
(begin (set var_boolean false) ) //if it's less than 4 it sets that boolean false
)
(sleep 1) //after the check is complete the script sleeps for 1 game tick {1/30th of a second} and then starts over.
)
// How do I write commands that sleep until a certain amount of time has passed of a event occurs?
(script startup "waitfor"
(sleep_until (volume_test_objects "trig_volume" (players) ) ) //script stops and sleeps until a player to enter the trigger volume. then after a player has entered the volume it continues.
(object_create "blahblahblah") //creates a object afterwords
)
Additionally, can someone link me a tutorial on adding a key that when pressed(and held) sets a boolean true and when unpressed sets a boolean false? I've looked through a bunch of stuff on the UDN but none of it has helped me much.
Thanks.
// How do I create a command that continually checks a variable and then changes a value based on that.
(script continuous "checkfunction"
(if ( > var_short 4) //checks to see if this short is greater than 4
(begin (set var_boolean true) ) //if it's greater than 4 it sets this boolean true
(begin (set var_boolean false) ) //if it's less than 4 it sets that boolean false
)
(sleep 1) //after the check is complete the script sleeps for 1 game tick {1/30th of a second} and then starts over.
)
// How do I write commands that sleep until a certain amount of time has passed of a event occurs?
(script startup "waitfor"
(sleep_until (volume_test_objects "trig_volume" (players) ) ) //script stops and sleeps until a player to enter the trigger volume. then after a player has entered the volume it continues.
(object_create "blahblahblah") //creates a object afterwords
)
Additionally, can someone link me a tutorial on adding a key that when pressed(and held) sets a boolean true and when unpressed sets a boolean false? I've looked through a bunch of stuff on the UDN but none of it has helped me much.
Thanks.