The Ur-Quan Masters Discussion Forum

The Ur-Quan Masters Re-Release => Technical Issues => Topic started by: jesse on December 12, 2003, 12:24:26 am



Title: Ship Files
Post by: jesse on December 12, 2003, 12:24:26 am
I remember that with the original SC2, it was possible to exchange any ship with any ship by renaming the .SHP files. For example, if I wanted to start the game with a Ur-Quan Dreadnaught, rather than an Earthling Cruiser, I just had to change urquan.shp to human.shp (and vice versa).
I was wondering if it is possible to do the same in Ur-Quan Masters? Maybe by changing the file names in the content.zip file?

Thanks for the advice!
Jesse


Title: Re: Ship Files
Post by: Michael Martin on December 12, 2003, 01:22:08 am
You can't do this at the moment.  (SHP files were effectively DLLs; we link all ship data into the executable.)  Whether this becomes possible in the future or not remains to be seen.


Title: Re: Ship Files
Post by: meep-eep on December 12, 2003, 05:21:27 pm
I can't check it now, but I think this *is* actually possible to do this at this time.
The .cod files in uqm contain an index specifying which (linked-in) code to use.
If you replace a .shp file, you're also replace the reference to the .cod file.




Title: Re: Ship Files
Post by: Ace987 on December 12, 2003, 09:30:28 pm
One time I tried extracting the SHP files from one of the zip files (content.zip I believe). Then I tried several of the SHP editors found on PNF, but the editors never were able to edit the SHP files extracted from the zip file.

My plan was to edit a single ship and put it back into the zip file to see if that did anything. It could be that the editors just don't work anymore or that the SHP files have changed. Either way, with my meager programming skills, I couldn't get it working.


Title: It works!
Post by: Jesse on December 14, 2003, 02:38:04 am
It does in fact work. I extracted urquan.shp from the content.zip file. I then renamed the file "human.shp" and added it back to the zip file (thus over-writing the old human.shp). This gives you a Ur-quan ship at the start of the game.

Thanks very much for pointing me in the right direction.
PS. For those of you planning on trying this, remember to save your old ship files OR make a backup of the content.zip file.



Title: Re: It works!
Post by: Ace987 on December 15, 2003, 10:47:20 am
Quote
It does in fact work. I extracted urquan.shp from the content.zip file. I then renamed the file "human.shp" and added it back to the zip file (thus over-writing the old human.shp). This gives you a Ur-quan ship at the start of the game.


If that's the case, then modifying the SHP files should be possible. There's still the problem that there is no SHP file editor. The old ones don't appear to work anymore, perhaps I need to be in real DOS to do this. Maybe there's another editor out there I missed. Perhaps someone (with better programming skills than myself) will write a newer program that can properly edit SHP files.

Anyhow, I'm glad that it worked for you.


Title: Re: Ship Files
Post by: Zeep-Eeep on December 15, 2003, 11:24:18 am
I'm not sure where the stats for the ships are stored. However, I am fairly sure that they aren't in the .shp files. At least not anymore.  Whether they're in the code or in one of the other files, I'm not sure. Perhaps one of the developers would be kind enough to point us in the right direction.


Title: Re: Ship Files
Post by: Michael Martin on December 16, 2003, 08:18:34 am
It would appear that they're a pile of defines at the beginning of each ship's .c file.  src/sc2code/ships/human.c begins with the GPL and copyright notice, then...

Quote
#define MAX_CREW 18
#define MAX_ENERGY 18
#define ENERGY_REGENERATION 1
#define WEAPON_ENERGY_COST 9
#define SPECIAL_ENERGY_COST 4
#define ENERGY_WAIT 8
#define MAX_THRUST /* DISPLAY_TO_WORLD (6) */ 24
#define THRUST_INCREMENT /* DISPLAY_TO_WORLD (2) */ 3
#define TURN_WAIT 1
#define THRUST_WAIT 4
#define WEAPON_WAIT 10
#define SPECIAL_WAIT 9
                                                                               
#define SHIP_MASS 6
#define MISSILE_LIFE 60
#define MIN_MISSILE_SPEED DISPLAY_TO_WORLD (10)
#define MAX_MISSILE_SPEED DISPLAY_TO_WORLD (20)


Sounds like it's a good place to start, anyway.


Title: Editing Ship Stats
Post by: Zeep-Eeep on December 16, 2003, 09:19:23 am
That's great. Yeah, I looked over the stats for a couple of ships. It looks like it would be easy to change those values to anything resonable and re-compile the code. I think I'll start with the "lastbat" section, which appears to change the values for the Ur-quan battle platform. Just for an added challenge.

Thanks for the help.


Title: Re: Ship Files
Post by: confused on October 17, 2004, 01:26:04 am
where did you guys find the src/sc2code/ships/human.c  ?? ....i can't seem to locate it.


Title: Re: Ship Files
Post by: Megagun on October 17, 2004, 06:11:33 pm
It's in the source code, not in the actual game...