Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » Singleplayer scripts
Singleplayer scripts [message #492512] Thu, 07 September 2017 13:47 Go to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
TL;DR See bottom of post

EDIT: Using this post as overall progress report. The completed/uncompleted lists now contain all the scripts I have.

Hello, here I am again after some time. I am re-releasing M13 reversed engineered scripts. Why? You may ask.. Well because of the following:

- I was bored and wanted to learn more and improve upon myself
- The first release was total shit (http://www.renegadeforums.com/index.php?t=msg&goto=470778& and http://www.renegadeforums.com/index.php?t=tree&th=39557&) It was one big file, non-compileable maybe like 60-70% accurate decompilation and no code flow analyzation had been done.
- Because I can.

This release should be like 99.99% close to what the original scripts were. I have a lot of confidence that you could replace all original scripts with these and make M13 run normal. I pretty much decompiled every. single. script. that is used in some way in M13 (Including, but not limited to some M00 scripts). I even included some scripts that mention M13, but aren't used in any way.

Also note: the release contains 2 txt files: Completed.txt and Uncompleted.txt. What these files mean is that completed has FULL code flow analysis (e.g. proper local/member variable names and comments). The uncompleted file contains some scripts that are still missing some parts. This is because I was unable to find the code flow for those parts. I've marked those parts with TODO labels, in-case I find them later, or somebody else does. So again, the scripts marked uncompleted will function correctly/the same as the original.

Also, Also, I included all cinematic files that are used (that I know of)

Now a list of released scripts:

Completed
Toggle Spoiler


Uncompleted:
Toggle Spoiler


Now this took me some time to do, but don't be a party pooper and steal my shit and claim it as yours. I've put the GPL-3.0 licence on here, which basically means you can do anything you want but you've got to mention my credits. I might plan on continuing, but I might not. Maybe in a day/week/month/year, who knows.

Feel free to contact me for any mistakes/additions/changes that need to be made.

Disclaimer: I have not tested any script whatsoever, but again I'm pretty confident this time around. I've put alot more care in my analyzation this time

Note #2: I compiled this in VS2017 Enterprise with VS2012 XP build tools. However you should be able to open it in express too, just be sure you have VS2012 with at least update 1 to enable the VS2012 XP build tools in later versions.

Note #3: @JonWil or somebody else from TT feel free to add this to the scripts release. If you'd like to change the licence header to that of all the other files that is no problem, but can it atleast have my name in it Smile? It would be really cool to see something I've made come in a release of TT scripts.

GitHub link: https://github.com/Neijwiert/C-C-Renegade-Mission-Scripts

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

Report message to a moderator

Re: Singleplayer scripts [message #492514 is a reply to message #492512] Fri, 08 September 2017 15:41 Go to previous messageGo to next message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
Cool stuff. Wonder if you can look into figuring out the crazy scripts like the m02_respawn_controller. It seems to be one giant megascript that controls all of the maps cinematics. It has a bunch of scriptzones all over the map. M02_Objective_Zone is attached on most of the zones but with no parameters. It seems like m02_respawn_controller has a bunch of hardcode zone ids that it uses to trigger things.

I actually have very good versions of m02, m07, and m11 that are tailored for a coop server that I made although I am not running them on an actual server at the moment. I have them installed on my test server. If you have a chance let me know and I'll show them to you.

[Updated on: Fri, 08 September 2017 16:24]

Report message to a moderator

Re: Singleplayer scripts [message #492516 is a reply to message #492514] Sat, 09 September 2017 02:52 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
Ok I'll continue with M02 then instead of M01. Not sure how looking at a modded version of the original level would help me though. I can just open up the original ones. Do you know where this respawn controller is located? or maybe the object id? Mind you, its pretty tough to do an analysis if its situated at the end of the level, altough decomlilation should be no problem

EDIT: lol you're not wrong that it does alot. Member fields alone makes it 276 bytes big. It's probably gonna take some time to do this one.

[Updated on: Sat, 09 September 2017 08:08]

Report message to a moderator

Re: Singleplayer scripts [message #492517 is a reply to message #492516] Sat, 09 September 2017 05:13 Go to previous messageGo to next message
sla.ro(master) is currently offline  sla.ro(master)
Messages: 610
Registered: September 2010
Location: Romania
Karma: 0
Colonel
I would love to see how M03_Goto_Star is done ;p

awesome work Thumbs Up


Creator of Mutant Co-Op
Developer of LuaTT
Re: Singleplayer scripts [message #492518 is a reply to message #492517] Sat, 09 September 2017 07:33 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
sla.ro(master) wrote on Sat, 09 September 2017 05:13

I would love to see how M03_Goto_Star is done ;p

awesome work Thumbs Up


Sure will look at that one too, again the same here. May not be able to do proper analysis of the code flow without all the other scripts. But decompilation should be no problem.

EDIT: Done, see GitHub

[Updated on: Sat, 09 September 2017 08:00]

Report message to a moderator

Re: Singleplayer scripts [message #492519 is a reply to message #492517] Sat, 09 September 2017 12:10 Go to previous messageGo to next message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
sla.ro(master) wrote on Sat, 09 September 2017 05:13

I would love to see how M03_Goto_Star is done ;p

awesome work Thumbs Up


Jerad has a clone of that script with a bunch of fixes on it as well. It doesn't break if the closest player is in an area with no pathfinding. It will go to the next closest player in that case. Its probably a better one to use for any coop maps since it was designed with multiple players in mind.

JMG_Utility_AI_Goto_Player

[Updated on: Sat, 09 September 2017 12:29]

Report message to a moderator

Re: Singleplayer scripts [message #492520 is a reply to message #492514] Sat, 09 September 2017 13:33 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
dblaney1 wrote on Fri, 08 September 2017 15:41

Cool stuff. Wonder if you can look into figuring out the crazy scripts like the m02_respawn_controller. It seems to be one giant megascript that controls all of the maps cinematics. It has a bunch of scriptzones all over the map. M02_Objective_Zone is attached on most of the zones but with no parameters. It seems like m02_respawn_controller has a bunch of hardcode zone ids that it uses to trigger things.

I actually have very good versions of m02, m07, and m11 that are tailored for a coop server that I made although I am not running them on an actual server at the moment. I have them installed on my test server. If you have a chance let me know and I'll show them to you.




I have decompiled M02_Respawn_Controller, see GitHub. as mentioned before, no code flow analysis has been done (so no proper member field naming yet and comments). I believe this script does not interact that much with the script zones but the other way around. M02_Objective_Zone is pretty big too and I haven't checked out M02_Objective_Controller. I will in the future and when I get to M02 I'll do some proper code flow analysis too.
Re: Singleplayer scripts [message #492521 is a reply to message #492520] Sat, 09 September 2017 18:50 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 Sat, 09 September 2017 13:33

dblaney1 wrote on Fri, 08 September 2017 15:41

Cool stuff. Wonder if you can look into figuring out the crazy scripts like the m02_respawn_controller. It seems to be one giant megascript that controls all of the maps cinematics. It has a bunch of scriptzones all over the map. M02_Objective_Zone is attached on most of the zones but with no parameters. It seems like m02_respawn_controller has a bunch of hardcode zone ids that it uses to trigger things.

I actually have very good versions of m02, m07, and m11 that are tailored for a coop server that I made although I am not running them on an actual server at the moment. I have them installed on my test server. If you have a chance let me know and I'll show them to you.




I have decompiled M02_Respawn_Controller, see GitHub. as mentioned before, no code flow analysis has been done (so no proper member field naming yet and comments). I believe this script does not interact that much with the script zones but the other way around. M02_Objective_Zone is pretty big too and I haven't checked out M02_Objective_Controller. I will in the future and when I get to M02 I'll do some proper code flow analysis too.


Yeah sorry, I meant m02_objective_controller and M02_Objective_Zone interact with each other a bunch.
Re: Singleplayer scripts [message #492522 is a reply to message #492512] Mon, 11 September 2017 04:25 Go to previous messageGo to next message
XD_ERROR_XD is currently offline  XD_ERROR_XD
Messages: 37
Registered: June 2015
Location: Citadel Station
Karma: 2
Recruit
May I ask, what do you use to decompile scripts? and do you decompile the whole scripts.dll file at once, or is it possible to decompile a single script at a time?

Thanks!


Professional moron. Nice to meet ya.
Re: Singleplayer scripts [message #492523 is a reply to message #492512] Mon, 11 September 2017 05:23 Go to previous messageGo to next message
dubstar is currently offline  dubstar
Messages: 49
Registered: October 2012
Location: England, UK
Karma: 0
Recruit
I read somewhere that IDA and Hex-Rays Decompiler are the best tools to use.

Re: Singleplayer scripts [message #492524 is a reply to message #492523] Mon, 11 September 2017 07:25 Go to previous messageGo to next message
sla.ro(master) is currently offline  sla.ro(master)
Messages: 610
Registered: September 2010
Location: Romania
Karma: 0
Colonel
dubstar wrote on Mon, 11 September 2017 15:23

I read somewhere that IDA and Hex-Rays Decompiler are the best tools to use.




Yes and no, it's far from perfect, its good that you can have asm file, but in rest is manually done Sad


Creator of Mutant Co-Op
Developer of LuaTT
Re: Singleplayer scripts [message #492525 is a reply to message #492522] Mon, 11 September 2017 07:36 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
XD_ERROR_XD wrote on Mon, 11 September 2017 04:25

May I ask, what do you use to decompile scripts? and do you decompile the whole scripts.dll file at once, or is it possible to decompile a single script at a time?

Thanks!


dubstar wrote on Mon, 11 September 2017 05:23

I read somewhere that IDA and Hex-Rays Decompiler are the best tools to use.




Yeah I use IDA Pro + Hex rays. No I just target the scripts that I need. I use the Linux build of the 'scripts' file to decompile, since that one has debug information. The debug information saved a lot of function names.

Also update: I will use this post to post my progress and stuff. Progress for this comment has been M02_objective_Controller, again see GitHub.
Re: Singleplayer scripts [message #492526 is a reply to message #492512] Mon, 11 September 2017 14:46 Go to previous messageGo to next message
dubstar is currently offline  dubstar
Messages: 49
Registered: October 2012
Location: England, UK
Karma: 0
Recruit
alternatively

rec studio Thumbs Up
http://www.backerstreet.com/rec/rec.htm
Re: Singleplayer scripts [message #492527 is a reply to message #492512] Mon, 11 September 2017 14:54 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

IDA Pro + HexRays is the only way to go when reverse engineering complex things like Renegade. Nothing else even comes close Smile


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 #492528 is a reply to message #492512] Mon, 11 September 2017 21:30 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
Very nice.

http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: Singleplayer scripts [message #492529 is a reply to message #492514] Tue, 12 September 2017 06:42 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
dblaney1 wrote on Fri, 08 September 2017 15:41

Cool stuff. Wonder if you can look into figuring out the crazy scripts like the m02_respawn_controller. It seems to be one giant megascript that controls all of the maps cinematics. It has a bunch of scriptzones all over the map. M02_Objective_Zone is attached on most of the zones but with no parameters. It seems like m02_respawn_controller has a bunch of hardcode zone ids that it uses to trigger things.

I actually have very good versions of m02, m07, and m11 that are tailored for a coop server that I made although I am not running them on an actual server at the moment. I have them installed on my test server. If you have a chance let me know and I'll show them to you.




I have finished M02_Objective_Zone. You can look at the hardcoded customs and ids now if you want. it is still missing full code flow analysis though.
Re: Singleplayer scripts [message #492530 is a reply to message #492529] Tue, 12 September 2017 10:26 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, 12 September 2017 06:42

dblaney1 wrote on Fri, 08 September 2017 15:41

Cool stuff. Wonder if you can look into figuring out the crazy scripts like the m02_respawn_controller. It seems to be one giant megascript that controls all of the maps cinematics. It has a bunch of scriptzones all over the map. M02_Objective_Zone is attached on most of the zones but with no parameters. It seems like m02_respawn_controller has a bunch of hardcode zone ids that it uses to trigger things.

I actually have very good versions of m02, m07, and m11 that are tailored for a coop server that I made although I am not running them on an actual server at the moment. I have them installed on my test server. If you have a chance let me know and I'll show them to you.




I have finished M02_Objective_Zone. You can look at the hardcoded customs and ids now if you want. it is still missing full code flow analysis though.



Cool thanks. If you don't mind m02_nod_apache would be cool as well.
Re: Singleplayer scripts [message #492531 is a reply to message #492512] Tue, 12 September 2017 13:19 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
I have completed M02_Nod_Apache. I see that it used WaypathSplined too from ActionParamsStruct but I have no idea what that actually does. Could @JonWil explain perhaps?

[Updated on: Tue, 12 September 2017 13:19]

Report message to a moderator

Re: Singleplayer scripts [message #492532 is a reply to message #492512] Thu, 14 September 2017 13:00 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
Completed:
M02_Nod_Jet_Waypath
M02_Mendoza

On a side note, I decompiled Set_Camera_Host aswell

void Set_Camera_Host(GameObject *obj)
{
	if (obj)
	{
		PhysicalGameObj *pObj = obj->As_PhysicalGameObj();
		if (pObj)
		{
			CCameraClass::Set_Host_Model(CombatManager::MainCamera, pObj->Peek_Model());
		}
	}
	else
	{
		CCameraClass::Set_Host_Model(CombatManager::MainCamera, NULL);
	}
}
Re: Singleplayer scripts [message #492533 is a reply to message #492512] Thu, 14 September 2017 13:46 Go to previous messageGo to next message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
Good, my clone I made with the netcall to send to client is pretty much identical to that.
Re: Singleplayer scripts [message #492534 is a reply to message #492512] Fri, 15 September 2017 05:14 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
Completed:
M02_Player_Vehicle
M02_Nod_Vehicle

Uncompleted:
M02_Nod_Jet
M02_Nod_Sakura
M02_GDI_Helicopter
M02_Reset_Spawn
M02_Destroy_Vehicle
Re: Singleplayer scripts [message #492535 is a reply to message #492512] Sat, 16 September 2017 11:10 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
Completed:
DLS_Where_Am_I
M02_Helipad
M01_Barn_Truck_JDG
M02_Destroy_Objective
M02_Nod_Convoy_Truck
M02_Dam_MCT

Uncompleted:
M02_Nod_Soldier
M02_GDI_Soldier
M07_Disable_Hibernation
M02_Stationary_Vehicle
M02_Approach_Vehicle
Re: Singleplayer scripts [message #492536 is a reply to message #492512] Sun, 17 September 2017 04:09 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

Good job so far, at this rate you will have a clone of every script in the original scripts.dll by the time its all said and done Smile


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

[Updated on: Sun, 17 September 2017 04:10]

Report message to a moderator

Re: Singleplayer scripts [message #492537 is a reply to message #492512] Mon, 18 September 2017 13:20 Go to previous messageGo to next message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma: 0
Recruit
I've completed all scripts used/related to M02. I will start code flow analysis now. But can anybody help me with the following:

- How can you play a soldier animation in the W3DViewer that is started in a script with Action_Play_Animation? Since I want to comment what kind of animation it is.

- Is there a way to check in LE if a certain preset, or even better, script is present in a preset? If not, could somebody prepare some mixes for me that are basically clones of the singleplayer maps but can be run on multiplayer so I can check these things out? Since I might have missed some scripts and mistakenly marked them as 'not used'.

- I have submitted an issue on GitHub some time ago about float precision. Sometimes a float is passed to some function but it is very nearly a whole number (i.e. 4.999999 or something like that). Does anybody know if this is a precision error?

- Sometimes the Renegade developers used Get_Random instead of the logical Get_Random_Int to put through a switch to check against, for example, 1/2/3 etc. Obviously it is cast to an integer somewhere. Does anybody know how I can check in IDA where this is being done? (I had exceptional problems in M02_Nod_Soldier::Timer_Expired with this to make sense of the code).

EDIT: Also, to stop spamming I guess, I'll just post updates when a complete map has been done or a request of somebody.

[Updated on: Mon, 18 September 2017 13:24]

Report message to a moderator

Re: Singleplayer scripts [message #492538 is a reply to message #492512] Mon, 18 September 2017 13:42 Go to previous messageGo to previous message
dblaney1 is currently offline  dblaney1
Messages: 358
Registered: March 2014
Location: United States
Karma: 0
Commander
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.

[Updated on: Mon, 18 September 2017 13:52]

Report message to a moderator

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


Current Time: Tue Nov 26 01:01:08 MST 2024

Total time taken to generate the page: 0.01223 seconds