The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
June 29, 2017, 03:53:55 am
Home Help Search Login Register
News: UQM development migrated from Subversion to Git

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  Technical Issues (Moderators: Michael Martin, fossil, Death 999)
| | |-+  Compiling / Source Code questions
« previous next »
Pages: [1] Print
Author Topic: Compiling / Source Code questions  (Read 124 times)
Nicholai
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Compiling / Source Code questions
« 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:

#define PLASMA_BIG_MASK_PMAP_ANIM "ship.mycon.graphics.plasma.large"
#define PLASMA_MED_MASK_PMAP_ANIM "ship.mycon.graphics.plasma.medium"
#define PLASMA_SML_MASK_PMAP_ANIM "ship.mycon.graphics.plasma.small"

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.   Sad

.... 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:

http://uqm.stack.nl/forum/index.php?topic=4022.0

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!
Logged

~ Nicholai
Death 999
Global Moderator
Enlightened
*****
Offline Offline

Gender: Male
Posts: 3462


We did. You did. Yes we can. No.


View Profile
Re: Compiling / Source Code questions
« Reply #1 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?
Logged
Nicholai
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: Compiling / Source Code questions
« Reply #2 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.
Logged

~ Nicholai
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!