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

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

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

Post by d3nd3 »

Thanks for the update, point 1 has been taken into consideration now. Many parts now can use variables before it did not support that. There might be still a few places its missed out. Let me know.
Acadie wrote:<float> random from [min] to [max]
On the random one, I dont see much problem here except for that i am not allowing the min and max to be variables, which I should be. But mind you they must be integers, integers = whole numbers without decimal. Its a mistake of mine to print them as floats, i will change that. Thats why you are getting strange behavior when you are using floats (not whole numbers). I mean, if the decompiler gives weird output, then sof will also have weird behavior too. So best just keep to good practises in that case.

New version will be posted very shortly.
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

Re: [Release].os script decompiler v2.0 [LastUpdate:01/05]

Post by Acadie »

I randomly came to this where sud2/outro.os has failed to decompile using v2.0 while v1.4 works fine. I ended up having a blank file.

sofos v2.0
Spoiler:
sofos v1.4
Spoiler:
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

Re: [Release].os script decompiler v2.0 [LastUpdate:01/05]

Post by d3nd3 »

@acadie Thanks for noticing this.

There was a major issue in my debug print function which is only noticeable in production version, so i never noticed it because i tested it never in this state lol. It seems to be solved.

I will post 2.1
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

Re: [Release].os script decompiler v2.0 [LastUpdate:01/05]

Post by Acadie »

3 bugs found. Examples that I've encounter are in the 'code' box
  • Vector for "move entity" doesn't work. For some reason, it is trying to fetch the floating point from "over 0.000 seconds" or will give an arbitrary big number.

Code: Select all

move entity goodguy4 by [0.200 ,0.000 ,0.000] over 0.200 seconds
move entity player1 to [0.000 ,0.000 ,2588346931139837300000000000000000.000]
move entity centerlift by [0.000 ,70696059927904986000000000000.000 ,1746593039144014300008ÛD
  • There should be an "endif" for every IF statement (and "endwhile" for WHILE).

Code: Select all

if app.health < 0
if bpp.health < 0
goto lab_00002
endif
  • Broken mathematic.

Code: Select all

tmp = pos + þÿÿÿ
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

Re: [Release].os script decompiler v2.0 [LastUpdate:01/05]

Post by d3nd3 »

Its helpful if you provide an example .os file that doesn't properly decompile for each case. This makes fixing it easier.
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

Re: [Release].os script decompiler v2.0 [LastUpdate:01/05]

Post by Acadie »

  • Vector for "move entity"
Spoiler:
  • "endif" for every IF statement
Spoiler:
  • Broken mathematic. Although, This only appear to have two instances.
Spoiler:
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

Re: [Release].os script decompiler v2.0 [LastUpdate:01/05]

Post by d3nd3 »

I proudly release sof os to ds, version 3.1.

As always, feedback and bugs reporting is welcome.

https://github.com/d3nd3/sof-os-to-ds
Last edited by d3nd3 on 20 Dec 2023, 12:30, edited 3 times in total.
Reactions: 0
Posts: 4
Joined: 01 Jan 2018, 20:06

Re: [Release].os script decompiler v3.0 [LastUpdate:19/12/2023]

Post by motorka »

Great job on this tool, I love going through the scripts to see how they made all the cool stuff happen. Been wondering though what else could it be used for, maybe making some fun custom scripts and compiling them back?
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

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

Post by d3nd3 »

Refer to the scripting documentation in the sof sdk, attached for reference.

Basically, there is an entity classname "script_runner", which when "used" executes the script it points to under "script".

So, using other trigger entities, you could move entities around the world based on conditions.

But you have access to :
"run console command <text>". -- If you pair this with sofplus by eg. sp_sc_func_exec some_sofplus_func. Or any console line ,you have far more options.

If the "script" is attached to the "worldspawn" entity, you have a script that is executed/parsed at map loadtime. It can in theory stay running in background I believe, as a listener, in a suspended state using "wait for any" "wait for all" "on ..." lines.

You have access to entity properties like position and speed. You can set them and also do vector math with them using "[0,0,0]" syntax.

You can make ghoul entities perform their animation sequences. Great for cinematic.

But ye, things like bunnytrack with a dynamic world is popular use case.
Attachments
Scripting Documentation.doc
(46 KiB) Downloaded 65 times
Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests