The Ur-Quan Masters Discussion Forum

The Ur-Quan Masters Re-Release => Technical Issues => Topic started by: Nicholai on March 27, 2017, 12:38:42 am

Title: Compiling / Source Code questions
Post by: Nicholai on March 27, 2017, 12:38:42 am
Hello all!

Is there anyone still active on this forum who is relatively familiar with the UQM source code / C in general who might be able to help me with a resource question?

There's something I'm not understanding when it comes to modifying resources...... let's say I want to change the Mycon plasma blob into an Earthling missile (for no reason.)  I know there's some coding changes necessary for this in Mycon.c, but I'm speaking strictly to getting UQM to load proper the RESOURCES/graphics right now, not the actual behavior in battle:

1. I copy all of the .png and .ani files relevant to the Earthling Saturn missile into the Mycon directory.
2. : I go into "/ships/mycon/resinst.h" and there are a few lines:


Leaving the first instance of PLASMA alone for now, since this is how it is referenced by Mycon.c and I don't want to screw with that yet...... I simply change the second "plasma" to "saturn"--and...

Third step: now UQM crashes (well, resets, actually) every time I get into a battle with a Mycon.   :(

.... Now, interestingly, if I simply RENAME the Earthling Saturn files I've moved into "/ships/mycon"  to be "plasma-000.png" etc instead, overwriting the original plasma.pngs, it works fine.  It seems like literally the problem is with the executable rejecting the idea of me looking for something other than "plasma" in those lines of resinst.h, which makes no sense.  Why can't I change this? 


Psst psst--
Some folks might remember a mod I was working on about 10 years ago (yikes) which unfortunately was consumed by a failed hard drive:

Much more casually, I've been tinkering with the code again in recent weeks... but of course, even the most meager ambitions exceed my skill when it comes to programming (an area in which I have no formal--hell, even informal--training.)  But if anyone could help me out with the question above, I'd really appreciate it!

Title: Re: Compiling / Source Code questions
Post by: Death 999 on March 27, 2017, 04:22:22 am
That is weird. I would speculate that there's another reference to the name, perhaps constructed at runtime, somewhere. Where else does 'plasma' show up in the mycon code?

Title: Re: Compiling / Source Code questions
Post by: Nicholai on March 27, 2017, 07:14:52 am
The only other use of the word "plasma" anywhere in the UQM code are a few variables/pointers within "mycon.c" that are defined within it; they're not directly related to resource file names.  (I did try changing them, out of desperation, but no effect.)

It's a really bizarre thing; typically the only way I really know how to chase this sort of issue is by--as you suggested--doing a search for the word in question.  But the idea that the code needs something other than just the one reference to the file path seems really odd to me.