Page 1 of 2

[Release].os script decompiler v3.1 [LastUpdate:20/12/2023]

Posted: 04 Apr 2018, 16:23
by d3nd3
https://github.com/d3nd3/sof-os-to-ds

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.

Now supports Drag and Drop of a folder tree onto the sofos.exe to created a decompiled directory.

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 : 3.1
Please find more faults if you want to improve it.

2.1 is there for historic sake, but highly recommended not to use it. It doesn't produce correct output.

changelog:
3.1 : fixed double iteration of directory bug.

Re: [Release].os script decompiler v1 BETA

Posted: 04 Apr 2018, 19:16
by Sauron
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.

Re: [Release].os script decompiler v1 BETA

Posted: 04 Apr 2018, 19:49
by d3nd3
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'

Re: [Release].os script decompiler v1 BETA

Posted: 04 Apr 2018, 23:57
by d3nd3
Updated 04/04/2018 23:50 v1.1 released with new feature for all math operation.

Re: [Release].os script decompiler v1.2 BETA

Posted: 05 Apr 2018, 17:14
by d3nd3
v1.3 released, Added new features, will decompile more scripts than before, less crashes etc.

Re: [Release].os script decompiler v1 BETA

Posted: 06 Apr 2018, 00:37
by CheaterSkeeter
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)

Re: [Release].os script decompiler v1.2 BETA

Posted: 06 Apr 2018, 21:45
by Sauron
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?

Re: [Release].os script decompiler v1.2 BETA

Posted: 06 Apr 2018, 23:03
by MinatO
is this your new anti cheat dende? good thing that patience paid off

Re: [Release].os script decompiler v1.2 BETA

Posted: 07 Apr 2018, 20:18
by Acadie
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

Re: [Release].os script decompiler v1.2 BETA

Posted: 07 Apr 2018, 22:17
by d3nd3
@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.

Re: [Release].os script decompiler v1.4 [LastUpdate:08/04]

Posted: 08 Apr 2018, 15:20
by d3nd3
bump: 1.4 released.

Re: [Release].os script decompiler v1.4 [LastUpdate:08/04]

Posted: 08 Apr 2018, 16:25
by Acadie
d3nd3 wrote:bump: 1.4 released.
The file got removed before I had the time to download it, lol.

Re: [Release].os script decompiler v1.4 [LastUpdate:08/04]

Posted: 08 Apr 2018, 17:14
by Sauron
dump-mappacks_os.rar
Source
(217.25 KiB) Downloaded 204 times
dump-mappacks_ds.rar
output
(235.03 KiB) Downloaded 207 times
SoF-Plat-ds.rar
Single player files
(413.92 KiB) Downloaded 208 times
SoF-v0.51_demo_ds.rar
(59.28 KiB) Downloaded 216 times

Re: [Release].os script decompiler v1.5 [LastUpdate:08/04]

Posted: 08 Apr 2018, 19:32
by Acadie
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

Re: [Release].os script decompiler v1.7 [LastUpdate:08/05]

Posted: 08 Apr 2018, 23:27
by d3nd3
thanks guys, i'll update it more. Btw check out the readme file in the new version.

Re: [Release].os script decompiler v1.8 [LastUpdate:08/05]

Posted: 14 Apr 2018, 22:54
by Acadie
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>

Re: [Release].os script decompiler v1.8 [LastUpdate:08/05]

Posted: 15 Apr 2018, 14:29
by d3nd3
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 ?

Re: [Release].os script decompiler v1.8 [LastUpdate:08/05]

Posted: 15 Apr 2018, 15:22
by Acadie
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>

Re: [Release].os script decompiler v1.8 [LastUpdate:08/05]

Posted: 15 Apr 2018, 16:11
by d3nd3
Okay, I agree with you, I will fix it.

Re: [Release].os script decompiler v1.8 [LastUpdate:08/05]

Posted: 26 Apr 2018, 18:08
by Acadie
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: