Jump to content
ANGRY_FARMER

sqs to sqf converter program ?

Recommended Posts

hello guys, is there any *.sqs to *.sqf converter program ?
i tried to do it manually, but its a mess...i'm not used to "goto" command and have lot of troubles re-thinking the logic behind the script !
thanks for any help!

Share this post


Link to post
Share on other sites
2 minutes ago, ANGRY_FARMER said:

hello guys, is there any *.sqs to *.sqf converter program ?
i tried to do it manually, but its a mess...i'm not used to "goto" command and have lot of troubles re-thinking the logic behind the script !
thanks for any help!

At this point with the plethora of new script commands introduced during the lifetime of A3 I'd say rewrite it and use the opportunity to learn the new commands.

If you can't rethink the logic of your own script it's probably due anyway.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

...so the answer is "no, there' isnt any way to automatically convert it" ?
 

Share this post


Link to post
Share on other sites
17 minutes ago, ANGRY_FARMER said:

...so the answer is "no, there' isnt any way to automatically convert it" ?
 

No, there isn't.

 

Once you get your head around the lack of goto and such like, it's much the same, only bigger.

  • Like 1

Share this post


Link to post
Share on other sites

I think there are many cases where people don't understand SQS, but need to convert multiple SQS scripts to SQF which they do understand. The OP indicated lack of understanding of SQS, not the latter, and yeah SQS is confusing to read.

  • Like 1

Share this post


Link to post
Share on other sites

:y::uzi::shoot::hang:SQS   

  • Haha 3

Share this post


Link to post
Share on other sites

yeah Haz, i agreee :)
to cut it short i have to resume this piece of old work exactly as it is, so i really have to convert it somehow.
what you suggest guys...convert goto with functions seems not covering all the possible situations....in fact goto keeps the potential changes in its code and carry them back to the top of the code, seems quite complex to me to reproduce this logic for a complex script...

Share this post


Link to post
Share on other sites

i post the file i have to convert, just in case its useful to understand better my trouble:

 

Spoiler

_count = 0
_total = Count clientCommandPV

_param1 = 0
_param2 = 0
_param3 = 0

#CheckForCommand
~0.1

    _command = Call Compile Format["%1",clientCommandPV Select _count]
    
    if (_command != 0) then {Goto "RunCommand"};

    #CheckForNextCommand

        _count = _count + 1
        if (_count < _total) then {Goto "CheckForCommand"};

    _count = 0
    goto "CheckForCommand"

#RunCommand

    clientCommandsSent = clientCommandsSent + 1

    _side = 0
    _parameters = 0
    
    if (_command >= CMDPARAMETERBIT1) then {_parameters = 2;_command = _command - CMDPARAMETERBIT1};
    if (_command >= CMDPARAMETERBIT0) then {_parameters = _parameters + 1;_command = _command - CMDPARAMETERBIT0};

    if (_command >= WESTID) then {_side = WESTID;_command = _command - WESTID};
    if (_command >= EASTID) then {_side = EASTID;_command = _command - EASTID};

    if (_side != 0 && _side != sideID) then {Goto "ClearCommand"};

    if (_command != 0 && _command != clientID) then {Goto "ClearCommand"};

    _params = []

    if (_parameters > 0) then {Call Compile Format["_param1 = %1P1",clientCommandPV Select _count];_params = _params + [_param1]};
    if (_parameters > 1) then {Call Compile Format["_param2 = %1P2",clientCommandPV Select _count];_params = _params + [_param2]};
    if (_parameters > 2) then {Call Compile Format["_param3 = %1P3",clientCommandPV Select _count];_params = _params + [_param3]};

    Call Compile Format["_params Spawn CLTFNC%1",clientCommandPV Select _count]

    #ClearCommand

        publicVariablesSent = publicVariablesSent + _parameters + 2

        Call Compile Format["%1 = 0",clientCommandPV Select _count]

    Goto "CheckForNextCommand"

 

Share this post


Link to post
Share on other sites

I'm pretty sure then won't work in sqs.  It needs to be :

? = if

! = not

: = then

@ = wait until

 

  • Confused 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×