Soldier of Fortune 1 Forums
https://www.sof1.org/

[Release].os script decompiler v2.0 [LastUpdate:01/05]
https://www.sof1.org/viewtopic.php?f=163&t=4376
Page 1 of 2

Author:  d3nd3 [ 04 Apr 2018, 15:23 ]
Subject:  [Release].os script decompiler v2.0 [LastUpdate:01/05]

Command line program that tries to convert .os files back into .ds file form.

Could be useful for trying to reverse or edit already existing script files.

When it doesnt' work correctly please let me know and i will try to fix it and release an updated version.

Credits: Acadie, Chin, Sauron and CheaterSkeeter.
EDit: Cleared this post up. There is now a README file supplied with the tool. Use notepad.
Current Ver : 2.0
Please find more faults if you want to improve it.

Attachments:
File comment: silly mistake which cause incorrect behaviour fixed
sofos_v2.1.rar [106.59 KiB]
Downloaded 20 times

Author:  Sauron [ 04 Apr 2018, 18:16 ]
Subject:  Re: [Release].os script decompiler v1 BETA

Wow, how can I batch this? Preferably with output in separated folder from input but with the same folder structure.)
Got around 230 of those files nested in multiple folders.

Author:  d3nd3 [ 04 Apr 2018, 18:49 ]
Subject:  Re: [Release].os script decompiler v1 BETA

You'd need to write a script that can do that.  CheaterSkeeter might release one soon cos he is interested in doing something similar, you could stay tuned for that i guess, or figure it out yourself with google.

Edit. 1st argument to program is the input file, second argument is the output file, but output file is optional, and will default to decompiled.ds if left out. And i think you can pass in forwardslash and relative like ./ ../

Btw did you ever get the batch mode of sofds.exe to work? i couldnt'

Author:  d3nd3 [ 04 Apr 2018, 22:57 ]
Subject:  Re: [Release].os script decompiler v1 BETA

Updated 04/04/2018 23:50 v1.1 released with new feature for all math operation.

Author:  d3nd3 [ 05 Apr 2018, 16:14 ]
Subject:  Re: [Release].os script decompiler v1.2 BETA

v1.3 released, Added new features, will decompile more scripts than before, less crashes etc.

Author:  CheaterSkeeter [ 05 Apr 2018, 23:37 ]
Subject:  Re: [Release].os script decompiler v1 BETA

Sauron wrote:
Wow, how can I batch this? Preferably with output in separated folder from input but with the same folder structure.)
Got around 230 of those files nested in multiple folders.


Put those "230~ files nested in multiple folders" :eek: in the os folder and run the python script (v1.3 seems to be crashing on some files still)

Attachments:
v13_batch_decompile.zip [22.83 KiB]
Downloaded 39 times

Author:  Sauron [ 06 Apr 2018, 20:45 ]
Subject:  Re: [Release].os script decompiler v1.2 BETA

Spoiler:

It seems to have problems with decompiling these sofos.exe crashes
there where a lot more unrecognized but the python window already closed.
The file count is the same for in/out-put, might be some of them are corrupt?

Author:  MinatO [ 06 Apr 2018, 22:03 ]
Subject:  Re: [Release].os script decompiler v1.2 BETA

is this your new anti cheat dende? good thing that patience paid off

Author:  Acadie [ 07 Apr 2018, 19:18 ]
Subject:  Re: [Release].os script decompiler v1.2 BETA

Found an error. In the 'animation' line. Holding in seconds can't have the 'seconds' after the value

Wrong:
animate entity john performing action STD_IGUNUP_N_A_N signaling sig holding for 1.000 seconds

Right:
animate entity john performing action STD_IGUNUP_N_A_N signaling sig holding for 1.000

Author:  d3nd3 [ 07 Apr 2018, 21:17 ]
Subject:  Re: [Release].os script decompiler v1.2 BETA

@thanks acadie, @minato hehe, nice to see you're still around. @sauron .rds might be roff files, which are specific files for motion only during cinematics i believe. Haven't looked into it too much tho.  Stick to .os files only please.

cheers.

Author:  d3nd3 [ 08 Apr 2018, 14:20 ]
Subject:  Re: [Release].os script decompiler v1.4 [LastUpdate:08/04]

bump: 1.4 released.

Author:  Acadie [ 08 Apr 2018, 15:25 ]
Subject:  Re: [Release].os script decompiler v1.4 [LastUpdate:08/04]

d3nd3 wrote:
bump: 1.4 released.


The file got removed before I had the time to download it, lol.

Author:  Sauron [ 08 Apr 2018, 16:14 ]
Subject:  Re: [Release].os script decompiler v1.4 [LastUpdate:08/04]

Attachment:
File comment: Source
dump-mappacks_os.rar [217.25 KiB]
Downloaded 37 times
Attachment:
File comment: output
dump-mappacks_ds.rar [235.03 KiB]
Downloaded 40 times
Attachment:
File comment: Single player files
SoF-Plat-ds.rar [413.92 KiB]
Downloaded 39 times
Attachment:
SoF-v0.51_demo_ds.rar [59.28 KiB]
Downloaded 38 times

Author:  Acadie [ 08 Apr 2018, 18:32 ]
Subject:  Re: [Release].os script decompiler v1.5 [LastUpdate:08/04]

Here's two more errors:

1. Might be a tricky one because both can be applied but SIB2_INTRO.ds is an example. It should have the "to" after "by moving". It can be easier to guess when the value answers to a big vector.
animate entity sib2_commander performing action STD_WNORMAL_N_PK_A by moving [1990.000 ,1128.000 ,-344.000] signaling sig
animate entity sib2_commander performing action STD_WNORMAL_N_PK_A by moving to [1990.000 ,1128.000 ,-344.000] signaling sig

2. I don't know how this numerical value is called after a #defined variable. But there's a sequence that is wrongfully used for the animation.
#define DEATHTHROWN 6
animate entity sib2_commander performing action DEATHTHROWN holding for 2.000
-->
#define EMOTION_TALK 6
animate entity sib2_commander showing emotion EMOTION_TALK holding for 2.000

Author:  d3nd3 [ 08 Apr 2018, 22:27 ]
Subject:  Re: [Release].os script decompiler v1.7 [LastUpdate:08/05]

thanks guys, i'll update it more. Btw check out the readme file in the new version.

Author:  Acadie [ 14 Apr 2018, 21:54 ]
Subject:  Re: [Release].os script decompiler v1.8 [LastUpdate:08/05]

Here's 2 more bugs

1. Seems like the emotion problem hasn't fully fixed.
X: animate entity johntalk performing action DUCK_DN showing emotion EMOTION_TALKANGRY holding for 6.800
O: animate entity johntalk showing emotion EMOTION_TALKANGRY holding for 6.800

2. Missing the word 'entity' after a <enable/disable> trigger use
X: <enable/disable> trigger <variable>
O: <enable/disable> trigger entity <variable>

Author:  d3nd3 [ 15 Apr 2018, 13:29 ]
Subject:  Re: [Release].os script decompiler v1.8 [LastUpdate:08/05]

I was under the impression that "performing action" is not an optional part of that command.  The Scripting documentation.doc suggests that.
animate entity <variable> performing action <variable / value>

And the SoF SDK also backs that up the way it extracts data.  Can you describe further why its a problem ?

Author:  Acadie [ 15 Apr 2018, 14:22 ]
Subject:  Re: [Release].os script decompiler v1.8 [LastUpdate:08/05]

The scripting documentation doesn't mention the use of "showing emotion" which I have no idea if it was on purpose or they simply forgot.

Here's what the compiler answers simply with the line:
animate entity johntalk performing action DUCK_DN showing emotion EMOTION_TALKANGRY holding for 6.800
Spoiler:


They are two separate things. So from now, I will go by using this statement without adding the optional part except the "holding for <value>"
- animate entity <variable> showing emotion <variable / value>

Author:  d3nd3 [ 15 Apr 2018, 15:11 ]
Subject:  Re: [Release].os script decompiler v1.8 [LastUpdate:08/05]

Okay, I agree with you, I will fix it.

Author:  Acadie [ 26 Apr 2018, 17:08 ]
Subject:  Re: [Release].os script decompiler v1.8 [LastUpdate:08/05]

Found two more error and one of them is not well covered in the scripting documentation.doc

1.
[ holding for <float> ]
[ holding for <variable / float> ]
I have no idea why this hasn't been explained correctly. Though, the variable must be a float number (as far I know). Maybe <float> meant to be a variable already but reading the documentation is confusing.


2.
First, I'll print what's wrong with this statement.
<float> random from [min] to [max]
<variable / float> random from [min] to [max]
Maybe <float> meant to be a variable already but reading the documentation is confusing.

Second. When I use a decimal value for "[min] to [max]", the decompiler will reverse a weird intergral value which make no sense.

Example:
Spoiler:

Page 1 of 2 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/