Can't load my weapons mod images

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Xanthe V
Miner
Miner
Posts: 36
Joined: Sat Aug 18, 2012 3:38 am
Location: CSC Terra

Can't get my weapon image loaded 4 my mod. How do i exactly fixit?!
by the way, i made the mod plus i can't get the image working cuz the game is just too stupid!!
Last edited by Xanthe V on Tue Oct 16, 2012 12:16 pm, edited 4 times in total.
Let's get this show on the road.

By the way, my username on Xelerus is Alfael X. heheheh... ;-)

Stats:

-A pilot of a Stalwart-class gunship

-Fleet Lieutenant of the Commonwealth Fleet

-A new Xelerus user
User avatar
Xanthe V
Miner
Miner
Posts: 36
Joined: Sat Aug 18, 2012 3:38 am
Location: CSC Terra

Anyway, I didn't download it, i created it so anyone i need ur help!! :( :( :( :( :( :cry:
Let's get this show on the road.

By the way, my username on Xelerus is Alfael X. heheheh... ;-)

Stats:

-A pilot of a Stalwart-class gunship

-Fleet Lieutenant of the Commonwealth Fleet

-A new Xelerus user
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

[Thread splitted]
Xanthe V, please don't hijack threads.


About your problem, well, it seems you have a problem with loading an image resource.
So, you need at least 2 UNIDs, one for the image resource type and one for the type using it.
User avatar
Shivan Hunter
Commonwealth Pilot
Commonwealth Pilot
Posts: 81
Joined: Tue Nov 29, 2011 3:07 am

To load an image, you need a UNID and a unique number for it, and you need to actually load the image at some point. Here is how to do that.

Let's say you have an image that you'll refer to as rsRanxTurret. You also have two images, RanxTurret.jpg and RanxTurretMask.bmp, in your resources folder (transcendence/Extensions/Resources), and your xml file is in transcendence/Extensions.

You need this at the top of your xml file:

<!ENTITY rsRanxTurret "0xD0080004">

This goes along with other UNIDs for anything else you define (new ships, weapons, etc). These all go in a !DOCTYPE TranscendenceExtension tag, like so:

<!DOCTYPE TranscendenceExtension
[
<!ENTITY UNIDExtensionRanxStuff "0xD0080001">
<!ENTITY scRanxBomber "0xD0080002">
<!ENTITY scRanxFrigate "0xD0080003">
<!ENTITY stRanxTurret "0xD0080004">
<!ENTITY rsRanxBomber "0xD0080005">
<!ENTITY rsRanxFrigate "0xD0080006">
<!ENTITY rsRanxTurret "0xD0080007">
]>

The one I have here defines three images and three ships, and a UNID for the TranscendenceExtension itself.

* Why are we calling it rsRanxTurret?

Most UNIDs are prefixed with initials stating what type of thing the UNID refers to. The "rs" means that this is a resource- like an image or a sound.

* What is the number?

The UNID number is a hexadecimal number, represented by 0x########, where # can be any of 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f. UNIDs for mods are split into two sections: the first four numbers are the UNID Range, which all UNIDs in the mod must use. I have reserved D008- you'll need to reserve another one. The second part of the number is any hexadecimal number that you define. You should make sure that no two UNIDs share the same number (This is why UNID ranges are reserved- to make sure no two mods use the same one).

* Now how do we load the image?

You'll need an <Image> tag. What this does is make an image in the Transcendence engine that points to your jpg for the color data, and your Mask bmp fr opacity data (what parts of the image are transparent). An example image tag loading the Ranx turret image would look like this:

<Image UNID="&rsRanxTurret;" bitmap="Resources/RanxTurret.jpg" bitmask="Resources/RanxTurretMask.bmp" />

The UNID references the same name you defined at the top of the file. the bitmap attribute points to the color data (NOTE! This doesn't have to be a bitmap or /bmp file. It's usually a jpg), and the bitmask attribute points to the mask data.

Now that you have this image defined, you can use it. For instance, in the <StationType> tag that defines the Ranx Turret itself, I have

<Image imageID="&rsRanxTurret;" imageX="0" imageY="0" imageWidth="64" imageHeight="64"/>

Again, this points to the image (make sure you have the & and ; - this is what tells the parser that you're pointing at a UNID), and defines some coordinates. imageX and imageY say that the top-left corner of the image to be drawn is at the top-left corner (0, 0) of the image file. This is useful since some images comtain graphics for multiple ships or stations. imageWidth and imageHeight say that the image to be drawn is 64 by 64 pixels.

[EDIT] Oh, and "cuz the game is just too stupid": I spent all yesterday trying to get TLisp to work, so I won't say this game is the pinnacle of best practices, but what you're doing is XML. And Trans's XML is clear, understandable and very well-defined. If there's an XML problem, it's likely on your end.
I'm here to shift paradigms and chew bubblegum... and I'm all out of bubblegum.

<+The_Shrike> If you install 2 solar panels, you will have 2 solar panels installed.
<DarthGeek|2> :o
User avatar
Xanthe V
Miner
Miner
Posts: 36
Joined: Sat Aug 18, 2012 3:38 am
Location: CSC Terra

digdug wrote:[Thread splitted]
Xanthe V, please don't hijack threads.


About your problem, well, it seems you have a problem with loading an image resource.
So, you need at least 2 UNIDs, one for the image resource type and one for the type using it.
kk. thank u!
Let's get this show on the road.

By the way, my username on Xelerus is Alfael X. heheheh... ;-)

Stats:

-A pilot of a Stalwart-class gunship

-Fleet Lieutenant of the Commonwealth Fleet

-A new Xelerus user
Post Reply