Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » Singleplayer scripts
Re: Singleplayer scripts [message #492539 is a reply to message #492538] Mon, 18 September 2017 14:13 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
dblaney1 wrote on Mon, 18 September 2017 13:42

Open the model that gets animated and then click and drag the animation w3d into the w3dviewer window.

The easiest way to find out if a script is on a preset is to open the objects.ddb in a hexeditor and search for the script name.


Ok, I'll try that. On a side note, I'm getting an error: mss32.dll was not found when trying to start W3dview.exe. Yeah I know how to check if its already on the preset, but I mean if its attached in the level. You know, you can add more scripts to a preset in a level when its that preset is created.
Re: Singleplayer scripts [message #492540 is a reply to message #492539] Mon, 18 September 2017 14:44 Go to previous messageGo to next message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
Neijwiert wrote on Mon, 18 September 2017 14:13

dblaney1 wrote on Mon, 18 September 2017 13:42

Open the model that gets animated and then click and drag the animation w3d into the w3dviewer window.

The easiest way to find out if a script is on a preset is to open the objects.ddb in a hexeditor and search for the script name.


Ok, I'll try that. On a side note, I'm getting an error: mss32.dll was not found when trying to start W3dview.exe. Yeah I know how to check if its already on the preset, but I mean if its attached in the level. You know, you can add more scripts to a preset in a level when its that preset is created.



Do the same hexedit trick but on the .ldd file for that level.

[Updated on: Mon, 18 September 2017 14:44]

Report message to a moderator

Re: Singleplayer scripts [message #492541 is a reply to message #492512] Tue, 19 September 2017 07:14 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
I have completed all scripts of M02, including the full code flow analysis.

dblaney1 wrote on Mon, 18 September 2017 14:44

Neijwiert wrote on Mon, 18 September 2017 14:13

dblaney1 wrote on Mon, 18 September 2017 13:42

Open the model that gets animated and then click and drag the animation w3d into the w3dviewer window.

The easiest way to find out if a script is on a preset is to open the objects.ddb in a hexeditor and search for the script name.


Ok, I'll try that. On a side note, I'm getting an error: mss32.dll was not found when trying to start W3dview.exe. Yeah I know how to check if its already on the preset, but I mean if its attached in the level. You know, you can add more scripts to a preset in a level when its that preset is created.



Do the same hexedit trick but on the .ldd file for that level.



Okay, that works nicely. But I don't really know the layout of an LDD file. I have been able to find preset Ids and object Ids. And also the scripts with their params, but I don't know how I can associate an object id with a script. Object ids are declared in the beginning of the file and scripts etc at the end. Would you happen to know what field or how many bytes offset of something where the relation is at?
Re: Singleplayer scripts [message #492542 is a reply to message #492512] Tue, 19 September 2017 07:41 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

Unless you understand the inner workings of the Renegade data files and classes (and I suspect you dont) then you will not be able to match scripts to objects.

If you explain what you are trying to identify or figure out, I might be able to help.


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: Singleplayer scripts [message #492543 is a reply to message #492542] Tue, 19 September 2017 08:18 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
jonwil wrote on Tue, 19 September 2017 07:41

Unless you understand the inner workings of the Renegade data files and classes (and I suspect you dont) then you will not be able to match scripts to objects.

If you explain what you are trying to identify or figure out, I might be able to help.



I'm trying to find if I missed any scripts that are present in the LE on the presets that are created. And if I can match an object id to that script then I can put proper comments in said script when/where it is used
Re: Singleplayer scripts [message #492544 is a reply to message #492543] Tue, 19 September 2017 10:01 Go to previous messageGo to next message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
Neijwiert wrote on Tue, 19 September 2017 08:18

jonwil wrote on Tue, 19 September 2017 07:41

Unless you understand the inner workings of the Renegade data files and classes (and I suspect you dont) then you will not be able to match scripts to objects.

If you explain what you are trying to identify or figure out, I might be able to help.



I'm trying to find if I missed any scripts that are present in the LE on the presets that are created. And if I can match an object id to that script then I can put proper comments in said script when/where it is used


Anything created by scripts during a game only will spawn with scripts on the object in the ddb file where the preset exists and by the scripts themselves. What was attached to the presets in leveledit only applies to objects placed on the map during export. Those scripts will be shown in the ldd file.

[Updated on: Tue, 19 September 2017 10:01]

Report message to a moderator

Re: Singleplayer scripts [message #492545 is a reply to message #492512] Tue, 19 September 2017 22:57 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

Which levels in particular are you trying to do it for? All the single player levels? All the maps that come with Renegade? Other maps beyond that?


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: Singleplayer scripts [message #492546 is a reply to message #492545] Wed, 20 September 2017 02:09 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
jonwil wrote on Tue, 19 September 2017 22:57

Which levels in particular are you trying to do it for? All the single player levels? All the maps that come with Renegade? Other maps beyond that?



All the singleplayer mapa (mission maps) and I guess the skirmish map and tutorial map too.
Re: Singleplayer scripts [message #492547 is a reply to message #492546] Wed, 20 September 2017 05:15 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

I cant help you with the skirmish level since Westwood never released a .lvl file for that but here are some dumps for all the levels they did release as part of the SinglePlayerLVLs.zip as well as the stock objects.ddb.

The dumps were taken via a specially hacked up (and not shippable) 4.x ttle.dll file and then loading each .lvl file into LE to produce the dump output.

The level dumps contain an entry for each object that exists in the scene followed by entries for every script that has been placed on that object in LE (as opposed to being there because its on the preset in objects.ddb)
The objects.ddb dump contains an entry for each preset followed by entries for every script that has been placed on that preset.

Hopefully this helps you out in figuring out all the scripts the stock single player missions actually use.
  • Attachment: dumps.zip
    (Size: 132.79KB, Downloaded 114 times)


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: Singleplayer scripts [message #492548 is a reply to message #492547] Wed, 20 September 2017 05:21 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
jonwil wrote on Wed, 20 September 2017 05:15

I cant help you with the skirmish level since Westwood never released a .lvl file for that but here are some dumps for all the levels they did release as part of the SinglePlayerLVLs.zip as well as the stock objects.ddb.

The dumps were taken via a specially hacked up (and not shippable) 4.x ttle.dll file and then loading each .lvl file into LE to produce the dump output.

The level dumps contain an entry for each object that exists in the scene followed by entries for every script that has been placed on that object in LE (as opposed to being there because its on the preset in objects.ddb)
The objects.ddb dump contains an entry for each preset followed by entries for every script that has been placed on that preset.

Hopefully this helps you out in figuring out all the scripts the stock single player missions actually use.



YES! Thank you that helps alot!. It is essential that I put comments on created events so that the code flow is clear to people. But I'm only human and it's easy to miss objects when going through the level. For example, on M02 I missed all the data disks and thought the script M02_Data_Disk wasn't used at first. I will verify all existing scripts to make sure all comments are correct. Will probably make a small program that checks the txt files for me.

[Updated on: Wed, 20 September 2017 15:32]

Report message to a moderator

Re: Singleplayer scripts [message #492549 is a reply to message #492512] Wed, 20 September 2017 14:32 Go to previous messageGo to next message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
Keep in mind that this won't give you stuff that gets spawned by spawners once the map actually starts. You will still need to check all the objects that get spawned by spawners etc preset scripts.
Re: Singleplayer scripts [message #492570 is a reply to message #492512] Thu, 05 October 2017 14:45 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
M01 Has been completely reversed engineered with code flow.

The release contains the following scripts (May contain scripts that were missed in previous releases):

Toggle Spoiler


A couple of notes on this release:
- The guy at Westwood with the initials JDG did not know the principles of re-using code. This mission contains a buttload of code that is duplicate.
- I think it is possible to make a script that will enable you to evac X amount of soldiers via chinook. See the scripts with evac in them. It contains some interesting code
- Apparantly the coders of this mission left a substantial amount of unused code in the binary. For example: it seems that the 'tailgun alley' used to have soldiers that would actually enter the gun emplacements. Also the prisoners at the end of the level used to be evacuated via a chinook.

See GitHub for the source code.
Re: Singleplayer scripts [message #492571 is a reply to message #492512] Fri, 06 October 2017 04:08 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

I suspect based on credits.txt (but can't be sure) that JDG is Joseph Gernert (listed under designers)


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: Singleplayer scripts [message #492572 is a reply to message #492571] Fri, 06 October 2017 08:44 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
jonwil wrote on Fri, 06 October 2017 04:08

I suspect based on credits.txt (but can't be sure) that JDG is Joseph Gernert (listed under designers)



I see. Well he also didnt know how to use script parameters. I believe only one script in the entirety of M01 code has script parameters. Its a real pain to decompile something and find out that youre practically reversing the same code.

Edit: Well if he is a designer that could explain a few things.

[Updated on: Fri, 06 October 2017 08:46]

Report message to a moderator

Re: Singleplayer scripts [message #492593 is a reply to message #492512] Fri, 13 October 2017 10:26 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
Well I'm impressed on how much you have done in a short amount of time. Good Job.

http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: Singleplayer scripts [message #492596 is a reply to message #492593] Fri, 13 October 2017 12:20 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
Gen_Blacky wrote on Fri, 13 October 2017 10:26

Well I'm impressed on how much you have done in a short amount of time. Good Job.


Why thank you, much apreciated. I'm curently working on m03 and I have everything up to and including the big gun.
Re: Singleplayer scripts [message #492611 is a reply to message #492512] Tue, 24 October 2017 13:35 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
M03 Has been completely reverse engineered with code flow.

The release contains the following scripts (May contain scripts that were missed in previous releases):

Toggle Spoiler


Notes for this release:
The devs used local variable address sharing through Send_Custom_Event. This is very unsafe and should not be used in any new scripts. (See M03_Area_Troop_Counter.cpp and M03_Reinforce_Area.cpp)

See GitHub for the source code.

[Updated on: Tue, 24 October 2017 13:39]

Report message to a moderator

Re: Singleplayer scripts [message #492617 is a reply to message #492611] Wed, 25 October 2017 17:12 Go to previous message
Jerad2142 is currently offline  Jerad2142
Messages: 3809
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
Neijwiert wrote on Tue, 24 October 2017 14:35


The devs used local variable address sharing through Send_Custom_Event.

That sounds like the best type of awful!


Previous Topic: [SSGM Plugin] EvacPlugin
Next Topic: Dragonade 1.9
Goto Forum:
  


Current Time: Fri Nov 22 08:38:58 MST 2024

Total time taken to generate the page: 0.01116 seconds