getAlert() setAlert() "EAlertLevel level" string ?
We are stuck in our script documentation of getAlert() and setAlert().
To see what the strings are, we used getAlert() and assigned string to a ship's callsign as we cycled through alert levels in Relays station.
The results were:
NORMAL
YELLOWALERT
REDALERT
Due to the interface (All caps) we can't tell if the actual string is lower case etc..
If the function is case sensitive this would matter.
There may even be a space in there we are missing...
To further test if these are the correct strings we made a test....
If getAlert() = "Normal" then do stuff...
It works! Huzzah!
if getAlert() = "yellowalert" then do stuff...
It doesn't work.
We've tried "yellowalert", "Yellowalert", "YellowAlert", "Yellow Alert", "YELLOWALERT"
Can't get anything to work except "Normal"...
We searched all included game scripts, the scriptreference.html and the forum, found nothing hence this post.
Does anyone know the proper strings in the proper case that DOES work please.
To see what the strings are, we used getAlert() and assigned string to a ship's callsign as we cycled through alert levels in Relays station.
The results were:
NORMAL
YELLOWALERT
REDALERT
Due to the interface (All caps) we can't tell if the actual string is lower case etc..
If the function is case sensitive this would matter.
There may even be a space in there we are missing...
To further test if these are the correct strings we made a test....
If getAlert() = "Normal" then do stuff...
It works! Huzzah!
if getAlert() = "yellowalert" then do stuff...
It doesn't work.
We've tried "yellowalert", "Yellowalert", "YellowAlert", "Yellow Alert", "YELLOWALERT"
Can't get anything to work except "Normal"...
We searched all included game scripts, the scriptreference.html and the forum, found nothing hence this post.
Does anyone know the proper strings in the proper case that DOES work please.
Comments
did you try "yellow" or "red" for commandSetAlertLevel
EAlertLevel -> lua conversion
"RED ALERT", "YELLOW ALERT", "Normal" for getAlertLevel
This works:
player:commandSetAlertLevel("yellow")
The check values for getAlert() are "Normal", "YELLOW ALERT" and "RED ALERT"
The set values for commandSetAlertLevel are "normal", "yellow" and "red"
Just for completeness and because people might search for it:
The latest version of EE has constants that can be used in LUA code like so: