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

Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

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

Post 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.
Attachments
sofos_release_v3.1.zip
(1.62 MiB) Downloaded 36 times
sofos_v2.1.rar
silly mistake which cause incorrect behaviour fixed
(106.59 KiB) Downloaded 145 times
Last edited by d3nd3 on 20 Dec 2023, 12:29, edited 29 times in total.
Reactions: 2
Posts: 525
Joined: 23 May 2014, 10:09
Location: Samsung smart fridge

Re: [Release].os script decompiler v1 BETA

Post 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.
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

Re: [Release].os script decompiler v1 BETA

Post 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'
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

Re: [Release].os script decompiler v1 BETA

Post by d3nd3 »

Updated 04/04/2018 23:50 v1.1 released with new feature for all math operation.
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

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

Post by d3nd3 »

v1.3 released, Added new features, will decompile more scripts than before, less crashes etc.
Reactions: 0
Posts: 409
Joined: 04 Dec 2011, 12:07

Re: [Release].os script decompiler v1 BETA

Post 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)
Attachments
v13_batch_decompile.zip
(22.83 KiB) Downloaded 160 times
Reactions: 2
Posts: 525
Joined: 23 May 2014, 10:09
Location: Samsung smart fridge

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

Post 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?
Last edited by Sauron on 08 Apr 2018, 17:16, edited 1 time in total.
Reactions: 1
Posts: 1872
Joined: 22 Nov 2011, 15:34

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

Post by MinatO »

is this your new anti cheat dende? good thing that patience paid off
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

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

Post 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
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

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

Post 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.
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

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

Post by d3nd3 »

bump: 1.4 released.
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

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

Post by Acadie »

d3nd3 wrote:bump: 1.4 released.
The file got removed before I had the time to download it, lol.
Reactions: 2
Posts: 525
Joined: 23 May 2014, 10:09
Location: Samsung smart fridge

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

Post by Sauron »

dump-mappacks_os.rar
Source
(217.25 KiB) Downloaded 205 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
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

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

Post 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
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

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

Post by d3nd3 »

thanks guys, i'll update it more. Btw check out the readme file in the new version.
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

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

Post 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>
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

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

Post 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 ?
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

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

Post 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>
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

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

Post by d3nd3 »

Okay, I agree with you, I will fix it.
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

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

Post 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:
Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests