Community

SCI Programming => SCI Syntax Help => Topic started by: Doan Sephim on June 11, 2019, 05:39:00 PM

Title: Converting SetMotion: MoveTo from Studio to Sierra Script
Post by: Doan Sephim on June 11, 2019, 05:39:00 PM
I'm currently going through and fixing some errors in the conversion of Betrayed Alliance from Studio script to Sierra Script and I keep coming up against the same error message.
In Studio, I can can
Code: [Select]
(squirrel:setMotion(MoveTo(squirrel:x) (squirrel:y))) and it's all good to go
In Sierra,
Code: [Select]
(squirrel setMotion: MoveTo squirrel x? squirrel y?) is not something it likes at all.
Anyone have thoughts?
Title: Re: Converting SetMotion: MoveTo from Studio to Sierra Script
Post by: lskovlun on June 11, 2019, 05:48:26 PM
You need a few extra parentheses:
Code: [Select]
(squirrel setMotion: MoveTo (squirrel x?) (squirrel y?))
but why would you want to do this? It's just a null mover, that may or may not cue the script (haven't checked)...
Title: Re: Converting SetMotion: MoveTo from Studio to Sierra Script
Post by: Doan Sephim on June 11, 2019, 05:53:26 PM
I should have chosen a different example. It doesn't like it for moving to other actors either
Title: Re: Converting SetMotion: MoveTo from Studio to Sierra Script
Post by: troflip on June 11, 2019, 06:06:24 PM
Each statement needs to be enclosed in ().

Accessing a property on an object counts as a statement. Thus:

Code: [Select]
(someActor x?)  ; retrieves the x property from someActor

Calling a method on an object counts as a statemtn. Thus:

Code: [Select]
(someActor setMotion: statement1 statement2 statement3)

Code: [Select]
(someActor setMotion: (blah x?) (blah y?))

It's all very logical. I'm sorry the conversion doesn't work in your case... trying to compile/parse Brian's crazy syntax was super difficult, because it's all so adhoc and permissive.
Title: Re: Converting SetMotion: MoveTo from Studio to Sierra Script
Post by: Doan Sephim on June 11, 2019, 06:14:53 PM
That does it. Thanks.

The conversion works quite well, there were just a few hang-ups with some of my own bad coding and some Randoms that got a little mangled. All in all the conversion is nearly finished.