Hard Light Productions Forums
Modding, Mission Design, and Coding => The Scripting Workshop => Topic started by: Kusanagi on December 31, 2010, 08:49:29 am
-
Dear gentlemen,
What exactly is the syntax of this command? There are a few things I need to have a script do that are in FRED but not in scripting such as set-object-facing-object and change-iff. I would think that the command takes several arguments such as the name of the SEXP and the other arguments would be handles inserted where they would go in FRED, no? Such as
mn.runSEXP('set-object-facing-object',ship1,ship2)?
I've tried variations of this but it makes FSO freeze, not crash.
-
Just use the same syntax as in normal mission files. :)
Look below for an example(but I'm not sure if it will work :nervous:) or you could simply create a mission with the wanted SEXP.
[code=]mn.runSEXP("set-object-facing-object ship1 ship2")
-
That doesn't seem to work, it just crashes. :(
I'd like to be able to input values into the SEXP but I just can't get the damned syntax right for things defined in scripts.
-
Here's some examples:
mn.runSEXP("show-subtitle !20! !-40! !writeyoursubtitlehere! !2000!")
mn.runSEXP("set-camera-host !" .. tostring(player) .. "!")
mn.runSEXP("change-ai-class !None! !Alpha 2!")
What's up with the !'s? No idea. I guess it's just some rather unfortunately undocumented alternative style of quoting that's necessary in this case.
-
So I was right in assuming everything between each pair of exclamation points is the different arguments in a sexp? awesome.
-
Ah, figured it out.
The reason the ! is needed is because the sexp commands are strings and would be read as such in the runSEXP command.