This tutorial assumes that you have taken a look at the link above and have decompiled the source xml files. It may also help to have taken a look at the xelarus modsite, linked to below. It contains many mods to play and learn from.

The easiest way to mod is to simply steal someone else's code, and put it into your own xml file. The two main sources to steal from are the decompiled source xml files, and the mods on xelarus.

So, down to modding. To mod you will need a WYSIWYG editor like notepad. A word processor like Microsoft Word will mess up your mod. Create a file and rename it to "FOO.xml" where 'FOO' is a name of your choice. Before we can actually make a ship, we have to make mod declarations. Here is the most basic mod (it doesn't actually *do* anything, just compiles ):

Lines 1 and 3 state things that are generally useless to modding, except for the fact that if you don't have line one, you can't do anything else, and if you don't have line 3, you lose a *very* helpful convenience from lines 4 and 5. Lines 4 and 5 are an empty list that will explained soon.

The mod actually begins on line 7 with the declaration of the Transcendence Extension itself. Our greatest interest here is: "UNID='0xD1110000". This UNiquely IDentifies your mod. By convention, the first three (hex) digits after the 'D' (currently are 1's) represent the identity of the modder, and the rest represent the identity of the mod and entities within the mod. Before you release a mod to the community (at xelarus), you should post the three digits that you will be using as your identity at the link below. After that is posted, ALWAYS use those same three digits for the UNID of your mod. Remember that since these digits are in hexadecimal, you can use anything from 0-9 and A-F (inclusive).

What's the difference? Instead of putting the numbers into line 7, we declared an ENTITY, and then put the ENTITY in place of the UNID in line 7. Entities are always of the form:

<!ENTITY FOO "BAR">

where FOO is the name you want to use in place of the UNID and BAR is the UNID itself.

Now that is done, lets go ahead and create a ship. Put the declaration code above into the file you created. Then, look at CharonPirates.xml (its one of the source xml files) and copy the corsair-class Gunship into line 8 of your file.

Now you have lots of code in those lines. I have added comments to the code below to explain what each line does. Comments in xml code are set off by <!-- and are closed by -->

fireRateAdj: how fast the ship fires in relation to the fireing rate of the weapons installed. fireRateAdj= "10" will cause the AI to fire at the firing rate of the weapon. fireRateAdj= "1" will cause the AI to fire at an insane rate (much greater than that of the weapons it wields).

fireAccuracy: How close the AI has to be to hitting to fire.

perception: Determines how close you need to be before the ship notices you. I am unsure of the relationship between Transcendence's unit if distance, lightseconds (abbreviated ls), and the perception value.-->

This adds four more lines. Every second line is the same except the first four lines have the option:

Quote:

nonCritical="general"

added before the end of each <ArmorSection /> tag. This option allows a segment of armor to be destroyed without destroying the ship. In this case, we used it to make the armor of the corsair about 3 times stronger.

This is good, but not much has happened yet. Try messing around with a few more values:

When you are destroyed by this ship, instead of "Corsair-class gunship", it will be called "Corsair-class modship".

Now lets change the weapon it uses. If you go into stdWeapons.xml, you will find a weapon called &itMakayevLauncher; Replace the laser cannon with this weapon.

Code:

<Devices> <Device deviceID="&itMakayevLauncher;"/> </Devices>

However, this weapon needs ammo. After the devices tag, add:

Code:

<Items> <Item count="100d100" item="&itStrelkaWhite;"/> </Items>

Finally, in the <AISettings /> tag, change the AI settings:

Quote:

fireRateAdj= "10"fireAccuracy= "95"

Go and be pwnd!

After you've had some fun with that, you will realize that the maneuverability of the Corsair modship has suffered. You can fix this by changing the cargoSpace option in the ShipClass tag from

Quote:

cargoSpace= "5"

to:

Quote:

cargoSpace= "50000"

Any other sufficiently large value will work (the value given is probably overkill).

Mess around with this until you feel comfortable or bored. Then copy another ship from the source, add it to your mod, and mess around with those values. You'll discover a few new options, feel free to ask on the forums what they do.

Part 2: Modding stations.

Modding stations is pretty much the same as modding ships. Go into CharonPirates.xml and copy the Charon Pirate Cache into your mod.

<!-- name: Dictates the name of the station type for when you are killed by or target this kind of station

abandonedScreen: Describes the dockscreen that is shown when the station is destroyed. Usually: "&dsAbandonedStation;"

dockScreen: Describes the dockscreen that is shown when the station is alive. If none, then it should be "&dsAbandonedStation;" by convention.

dockingPorts: Describes the number of docking ports.

canAttack: Generally = "true". I assume that if it is false then the station cannot attack.

armorID: Describes the resistances of the station by referring to the UNID of a certain armor type.

maxHitPoints: Describes the hit points of the station.

hitPoints: Describes the starting hit points of the station.

fireRateAdj: how fast the station fires in relation to the firing rate of the weapons installed. " fireRateAdj= "10" " will cause the AI to fire at the firing rate of the weapon. "fireRateAdj= "1" " will cause the AI to fire at an insane rate (much greater than that of the weapons it wields).

ejectaType: Describes the effect when you hit the station.

attributes: This is important if you wish to distinguish the item from others or wish it to be sold (or not to be sold) in certain stations. See Periculi's post later in the thread.

levelFrequency: Describes how often you will see this kind of station. The value is always of the form: "----- ----- ------ ----- -----" where each non-space character represents a level of system (Eridani being a level 1 system and St. K. being the first level 4 system). A dash means that station will not appear at that level, 'c' means very common, 'u' means uncommon, 'r' means rare, and 'v' means very rare.

locationCriteria: Describes where in a system a planet can be located.

<!--This tag, as I went over in part 1, describes the devices that this object can use. The only difference here is that stations cannot use any kind of shields. :( However, I left out a very important detail illustrated in the above devices tag. Additional arguments can be added after the UNID such as omnidirectional="true" which change the way the weapon behaves. The most frequent are listed below:

omnidirectional: This may be true or false, default is false. When true this causes the weapon to act as if it were omnidirectional

secondaryWeapon: This may be true or false, default is false. When true this allows the weapon to be fired concurrently with the main weapon.

posAngle: This may be a number from 0 to 360 (potentially more, but anything above that is useless), I don't know what the default is. This determines the polar angle coordinate to the position of the weapon

posRadius: This may be a number from 0 to 360 (potentially more, but anything above that is useless), I don't know what the default is. This determines the polar radius coordinate to the position of the weapon

minFireArc: This may be an number from 0 to 360, I don't know the default value. This determines the minimum angle at which the device (probably just weapons, I don't think it would effect an ICX) can fire. Incompatible with Omnidirectional

minFireArc: This may be an number from 0 to 360, I don't know the default value. This determines the maximum angle at which the device can fire. Incompatible with Omnidirectional

<!--This looks up some items. Chance describes the percent chance of that item, (in this case lookup item) or other entity actually being present. Remember that all tags with the same name share the same properties. If they are valid for both stations and ships they are no difference between placing them on stations or on ships. The <items> tag works the same here as it did for the strelka missiles.-->

<!--This creates bee-line attack ships at a frequency of "common" for every station of this type. If there are lots of stations, then expect LOTS of these encounters. Other values for frequency are "uncommon", "rare", and "very rare"-->

</StationType>

While much of this is the same as modding for ships, there are two sets of tags that are completely new. They are the <Encounters> and <Ships> tags, and the <table> tag.

The <Encounters> and <Ships> tags both have very similar formats, if you copy the inside of one to the other, it will work without error. The format is:

count: The number or range of numbers of ships that appear. This can be described in one of three forms: dice, range, and (constant) number. Dice takes the form of "XdY" where X is the number of dice, and Y is the number of sides each die has. The computer simulates rolling the die to determine the number of ships randomly. Range takes the form of "X-Y" where X is the minimum number, and Y is the maximum number. Unlike dice, each possible number of ships from X to Y has the same chance of being picked. (Constant) number takes the form of "X" where X is the number of ships to be created.

class: The UNID (unique identifier) of the type of ship to be created. Remember the ship we modified? The UNID of a ship can be found in the first line of the ship definition. For example: <ShipClass UNID="&scCorsair;"

orders: This tells the AI what it should do. The most common values are "attack" which will send ships after the player, "patrol" which will send the ship circling around a point in space (usually the station), and "guard", which will cause the ship to sit still and wait for the player. Another interesting value is "wander" which will send the ship wandering around the system. If "patrol" is given as an order, you may add another option patrolDist="FOO" where foo is the range in lightseconds that the ship will circle at.

sovereign: The UNID of the sovereign that the ship belongs to. This should be OMITTED if this is inside a <ships> tag, but is NECESSARY if this is inside a <Encounters> tag. This is the major difference between the <encounters> and the <ships> tags.

Note that ships inside <Escorts> tags always have the orders "escort" which causes them to follow lead ship. If the count of the lead ship is greater than one, each ship will have its own escort. You may place as many ships inside an escort tag as you wish.

Notice that the escort tag is not necessary. If escorts are not used, a slightly different shorthand may be substituted:

This code has a 75% chance of creating 1d3 Corsair-class gunships, and a 25% chance of creating 1 Viking-class gunship instead. In all the examples the values for chance add up to 100 within a table. I am not sure if this is necessary, but it is important to note.

This works identically with items.

There is one more feature of the <table> tag I need to mention.

Code:

<Table count="1d4"> <!-- A list of stuff--></Table>

This code will pick 1d4 items from the table according to their chances. The "count" inside the table works exactly the same as the count for ships, so you can put a constant (count="4") or range (count="1-4") instead of "1d4" if you wish.

description= "One of the most popular designs by the Earth Industries Conglomerate, the turbolaser cannon is a cheap, powerful, and reliable weapon." >

<!--name: The name of the item.

level: The "level" of the weapon. Lower-level weapons are found in earlier systems and higher-level weapons are found in more advanced systems. The player will often use the level of the weapon to determine it's relative strength.

value: How much a station will buy/sell it for

mass: The weight of the weapon for purposes of calculating acceleration and turning speed.

frequency: How often a weapon is likely to appear as random loot. Some missions use this as criteria for accepting items (Dvalin).

modifiers: see Periculi's post below. MajorItem should be on all weapons and EngergyWeapon allows Longhzu spheres to be used on it.

description: displayed along with the weapon's name. Helps the player understand the purpose of the weapon and sometimes furnishes the weapon with backstory.-->

lifetime: How long the weaponsfire lasts (in ticks, I believe). Helps to determine the range of the weapon

powerUse: the amount of power usage, in tenths of a MW, that the weapon uses when firing.

The rest are beam-specific and I'll need to ask Periculi about them.--> </Weapon>

</ItemType>

Making a simple weapon like this is easy, but don't worry, it gets harder.

About damage:

Damage is expressed in TYPE:NUMBER where type is the damage type of the weapon, and number can be a constant, range, or dice formula. Damage type can be any one of the list below. Betelguse made an attempt at giving "weights" to each damage type which is given in brackets after the damage type to help give you a rough idea of how good each damage type is.

Each armour, shield, and anything else that can be damaged has a "resistance value" to each damage type which is then multiplied by the damage number to produce the final damage result (certain exceptions apply, but they are outside of the scope of this tutorial).

THIS IS NO LONGER MAINTAINED, and is available under the WTFPL, reproduced below:

Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

DO WHAT THE @#$! YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE @#$! YOU WANT TO.

I should also add that I would welcome someone modifying the information in this guide for the latest version, I haven't kept up on the latest advances in the xml (name it what you want).

Last edited by F50 on Sun May 29, 2011 1:35 am, edited 24 times in total.

Sat Mar 08, 2008 9:50 pm

Betelgeuse

Fleet Officer

Joined: Sun Mar 05, 2006 6:31 amPosts: 1920

small point

Code:

<!DOCTYPE TranscendenceExtension[]>

isn't needed at all. It can be removed at the code would work just as well.

_________________Crying is not a proper retort!

Sat Mar 08, 2008 9:53 pm

F50

Militia Captain

Joined: Sat Mar 11, 2006 5:25 pmPosts: 995

bump. Much added. Part 2 of chapter 1 is almost done (except for possibly numerous revisions).

Tue May 06, 2008 6:38 pm

Lv4snobrdg

Anarchist

Joined: Thu Feb 07, 2008 8:43 pmPosts: 11

Good stuff here.

Thanks

_________________a modder is as a modder does.

Sat Jul 19, 2008 1:30 am

Lv4snobrdg

Anarchist

Joined: Thu Feb 07, 2008 8:43 pmPosts: 11

I copy the Charon Pirate cache into my extension edit it so it title is something else.

I set frequency to common for 4 systems and the problem I have is I haven't run in to any of them??

When I dock they should have a different name, I know this because I have extracted all the XML and editted the Charon Pirate Cache in the source code in the exact same way I editted in my extension and when I dock with the wreck it has the title I gave it.

My question is, why aren't my stations spawning from my extension?

I have been having a great time adding player ships from many movies and cartoons to the Transcendence game. But I really want to add some encounters from those same movies.

appreciate any and all feedback

Is building a module possible?

_________________a modder is as a modder does.

Sat Jul 19, 2008 3:14 am

Periculi

Fleet Officer

Joined: Sat Oct 13, 2007 7:48 pmPosts: 1259Location: By the beach

Yes, you can add a module. See below.

Stations:

I am assuming that if you edited the name you also created a valid UNID.

If you are expecting them in Starton Eridani, you would need to add them to the special table that the game uses for the Eridani star system. Eridani does not use the standard random placement draw.

If the stations aren't coming up in random systems there are a number of reasons.

One big one is: Does the station have the required placement attributes and location criteria that the system needs?

Since you copied the station, I will assume that you didn't alter the attributes or the location criteria.

This shows that that type of station will appear in a wide range of systems. Air, Earth, Fire and Water are a form of environmental filter used to place stations and other objects. If your station retained those settings, then there should be no problems with it showing up due to attributes filtering it out.

In many systems, the 'enemy' and envType attributes will be the deciding factor, 'populated' seems to be in most labels for planets. However, when the list of enemies is prepared, your station is in a pool of stations- and the enemy stations can be a large pool.

If your attributes and location criteria aren't set right, the station won't appear. Other problems could be that you have a station with some kind of error that prevents it from being used. Check your code for errors. Check the debug file to see if any errors are recorded there and check to see if your mod extension was loaded.

Another problem could be simply that your number hasn't come up. Even though the station is 'common' it just might not have been drawn yet in a game.

Try testing the station to see if it will show up by a direct reference. You mentioned that you unpacked the tdb files with transdata so you can handle this:
In the transcendence.xml, you can find the eridani system definition and add your station reference in a table (to make it randomly appear in eridani) or put the station into a tag to make it show up every time. Look for the Sisters of Domina station reference, and copy the format there.

To make a module for the game in similar fashion to the ones that were unpacked into the TranscendenceSource file, you can look at the modules in the folder to see the format they require- the head and closing tags are important to identify it. To activate the module, you must go to the bottom of the transcedence.xml file and find the module filenames list. Add the name of your xml module there, and the game will load it.

Last edited by Periculi on Sat Jul 19, 2008 4:16 am, edited 1 time in total.

Sat Jul 19, 2008 3:53 am

Lv4snobrdg

Anarchist

Joined: Thu Feb 07, 2008 8:43 pmPosts: 11

Thank you for the response.

I will work in what you described, in fine detail i might add.

I am highly experienced in HTML & XML, and a D&D nut from way back. I travel for my work alot, I work in IT, and this game is simply fun. When I started looking at the code I began to understand it very well. I have more questions but I am holding on to them in hopes that small amounts of light being shed will allow me to see the bigger picture. I will create new threads moving forward.

Admittedly I am also a Star Wars fan. I am not a lunatic or anything but I do love the stories and the vessels. I have built a clean YT1300 extension for Transcendence, the YT1300 is the nomenclature for the Millenium Falcon. I am polishing up the Ebon Hawk and will combine them in another mod.

The thing is it just doesn't feel right flying around in the Falcon with no Tie Fighters and that is what finally hung me up and brought me knocking to the forums.

thanks again for taking the time to respond and I will report back any success or failure.

Since sprite sheets may contain multiple ship type images, X and Y coordinates help define where the particular ship image is within the sprite sheet.
Hence: imageX="288" imageY="0"
If you were to check these coordinates within the sprite sheet in an image editor program, it is possible to change the image to another ship type, simply by checking the coordinates of that ship then replacing them in the tag. Just an example.

imageWidth="48" imageHeight="48" Defines the size of the ship based on its size within the sprite sheet.

rotationOffset="-10" Not real clear on this one but an uneducated guess would suggest it may have something to do with altering the ship's facings?

imageFrameCount="0" imageTicksPerFrame="0" This defines animation, or the lackthereof--which is the case in this example, so both are set to 0.
Depending on the animation you want, it'll be based on the sprite image itself.
Example; We'll use an animation with 4 sequences. So, imageFrameCount="0" would then be changed to imageFrameCount="4"

imageTicksPerFrame="0" defines the rate of speed of the animation, where set to "1" would be fast as to "6" being much slower. "0" means no speed or Nil

Hope this helps.

Sat Jul 19, 2008 6:54 pm

Lv4snobrdg

Anarchist

Joined: Thu Feb 07, 2008 8:43 pmPosts: 11

News from the front:

My extension is fixed my stations are spawning and as I need them too.

examining the systems definitions closely I was able to add enough attributes to force my system to spawn more often than any other and that helped me tweak everything since I could see my station and her minions quite often.

Thanks for the tips with the images and the frame counts, I picked up on the image structure when I disected the playership.xml for my first mod in transcendence.

I have successfully added 10 player ships to my transcendence and only recently realized that I need my own UNID in order to share my code with other players.

Which is what brings me here.

I guess now I must go to work on all the graphics now that the code is solid. I will create this first as an extension and attempt the module later. I have about 60 entities to create for what I want to do. I created a cool spread sheet that automatically creaes my entity table at the top of the mod. I will share.

Peace

Lv

_________________a modder is as a modder does.

Sat Jul 19, 2008 7:13 pm

Periculi

Fleet Officer

Joined: Sat Oct 13, 2007 7:48 pmPosts: 1259Location: By the beach

F50, hope you don't mind if I add this to your tutorial thread:

Some information on Modifiers, Attributes, and other object filtering values.

Modifiers are for items.

Modifiers are name tags [strings] that the game uses for sorting item classes and types into as fine of detail as you could ever need.

Alien Item is not found in Human Space AntiMatter Item is involved in AntiMatter industry Auton Item is an auton BlackMarketID This is a black market ID Bushido Item is sold by Bushido corp Food Item is human food or drink Fuel Item is starship fuel HaloGem Item is a halo gem ID Item is an ID Illegal Item is illegal in Human Space Info Item consists of digital information Lux Item is human luxury good Makayev Item is sold by Makayev corp Meds Item is human medicine Military Item is restricted to military in Human Space MilitaryID Item is a military ID Missile Item is ammo or missile Nuclear Item is involved in nuclear industry Rasiermesser Item is sold by Rasiermesser corp Res Item is a resource needed for industry RingerValuable Item is used by Ringers Soul Item contains (possibly dormant) intelligence of HIG III or above Specialty Item is not a commodity; for sale only in specific stations ZeroPoint Item is used in Zero-point energy industry

This allows us to have much greater control over the random selections of items and develop many other handy features like custom vendors and specialists.

You can place any string into the modifiers, and call for it in code later:

Code:

;place the new modifier in the modifiers value of the item

modifiers= "MyModify"

now you can use search functions to find the item(s) with that modifier

There are several functions that make use of a modifier filter.

Code:

(itmCreateRandom criteria string)

(itmEnumTypes criteria variable function)

(itmHasModifier itemStruct string)

To name a few. Criteria would include the modifier after the basic filter. (as in "* +MyModify" )
-itmHasModifier the string is the modifier your want to find)

Attributes are for space objects such as stations and planets.

Attributes are used by the system definitions to place objects.

The <Labels> in systems correspond to the attributes in the space object

Sun Jul 27, 2008 5:41 am

F50

Militia Captain

Joined: Sat Mar 11, 2006 5:25 pmPosts: 995

thanks periculi

Mon Jul 28, 2008 1:40 am

F50

Militia Captain

Joined: Sat Mar 11, 2006 5:25 pmPosts: 995

If you know weapons tags, I need your help. If you do, could you please read what is there of section 3 and explain the <weapon> tag in detail for me? Thanks!

Thu Aug 07, 2008 6:32 pm

george_12aerohawk12

Miner

Joined: Mon Jul 21, 2008 1:21 pmPosts: 44

whats the EI modifier? you can find it in the ion cannon

Thu Sep 04, 2008 5:49 pm

Periculi

Fleet Officer

Joined: Sat Oct 13, 2007 7:48 pmPosts: 1259Location: By the beach

You can also find it in the Laser Cannon and other weapons built by the Earth Industries manufacturing conglomerate. EI means Earth Industries. It is one of the game's weapon and item manufacturers, much like NAMI, Bushido, Raisermesser and others.

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum