Modding stations is quite simple. One thing to be aware of is that there are many different types of stations, and they each have slightly different formats. There is no way to write down every type of station possible, so we will just detail the elements a station can contain, write up some tips and gotcha's, and let you, the modder, decide what your station should be like. As always one of the best references is the vanilla source, where there are tons of stations defined. Unpack the source and have a look. Use an editor that can search an entire directory (eg. Notepad++) and study the xml. There are many mods on Xelerus that use stations. Have a look there, and you may learn many interesting things. And final point of reference is **always** Transcendence itself. Build the xml, load up the xml and test it. If it runs, good, if not, debug it, and share your knowledge. **Remember to edit this post if you possess any additional information.** I will start with laying out the skeleton of a station, and then describe the elements briefly. Note, this is a very basic and boring station, and definitely not the only simple station you can make. (lines prefixed with ;; are comments) ===== Skeleton ===== ;; All objects must have a UNID, stations are no different ;; a standard image resource. Can be any image you have set up yourself. ;; (just like you would for a ship) ;; The dockscreen we defined above. Making Dockscreens is another topic ;; so i wont be covering that here at all
;; here we define the ports that we want on the station. the 'x' and 'y' attributes ;; define where the ship will dock relative to the center of the station. Getting these ;; values right takes a bit of fiddling, and is mostly trial and error.
Ok, that't a very basic uninterresting station, that wont occur anywhere in game, and cant really do anything. You can put it in a mod though, and load it up and then spawn the station via script and dock with it, and everything will be as expected. =====Attributes===== Here are some more attributes you can set on a station. Some of them i know what do, some of them i am not sure... Information here will be updated as we leaarn more ;; yaddayadda Now, many of the above attributes are mutually exclusive and may crash your game, so it will take some fiddling to get it all together. The possible combinations are too many for me to begin to compile a list here, so it will take some experimentation on the modders part. =====Elements===== Apart from attributes, a station can have alot of different elements. I will go over some of them here. ====Trade==== The element defines how this station will buy/sell items. You can have multiple and tags with different criteria, to make a station pay more for illegal goods for example. * currency can be either 'credits' or 'rins' and is self explanatory. * `creditConversion` determines how the station handles credits. If you buy an item for 5000 credits and creditConversion=100, the station's balance will be increased by 5000 credits. (pretty obvious). If creditConversion=0 and you buy that same 5000 cred item, the station's balance will be reduced by 5000 creds thus limiting the amount of items the player can buy from the station while allowing the player to sell as much as they want to the station. Tis does not affect the price the player sees either for buy or sell, only how the station handles their side of the finances. * `max` how many credits the station has available. It wont be able to pay more for an object than this. * `replenish` how fast the station regains credits. This amount is added to the station's balance every 12500 ticks or 6.66 minutes. The element can be overriden using gMargin. (block Nil (setq gPrevScreen "Main") (setq gPrevPane "Exchange") (setq gMargin intTeratonBuyMargin) ;; intTeratonBuyMargin is a function defined in Teratons.xml (scrShowScreen gScreen "&dsRingerBuy;") ) gMargin must be set in the dockscreen prior to entering the buy or sell dockscreen and must be a global function. This method offers a much MUCH more detailed method of setting prices as the function can be as simple or complex as you choose. You can have the station offer a discount if the player has done missions for Korolov, or will pay much less for items that are abundant in the current system. ====Items====
This defines what items the station will have onboard. The tag is similar to the one used on ships. ====ImageVariants==== This defines a station that has multiple image variants. Each can refer to any image resource you have set up, and when the station is spawned you can set which variant the individual station will use. In game this is used for barricades and barriers. You can also change the variant in game through script using the (staSetImageVariant) function. This can create some very cool effects where the station changes based on some event. ====Devices==== This defines the items that are installed on the station. Mostly weapons make sense //Expand on the element?// ====Ships====
The ships that this station comes with. In this example, the station will have 1 Hurin Destroyer patrolling around the station at a distance of 40 lightseconds and 2-6 RoninC ships escorting it. There will also be 1-4 other ships docked with the station. A 50% chance of an EI100 that will run away if the station is attacked, a 40% chance that one of those 1-4 ships will be a Borer ship that will also run, and a 10% chance that a Ronin C will appear but if it is present it will attack enemy ships if they get too close to the station. //Expand on the element?// ====Reinforcements==== The ships that this station can call as reinforcements. //Expand on the element?// ====Satellites==== A station can have other stations surrounding it, these are known as satellites. In this example (taken from the CommonWealth Colony Armed station) will place 4 Commonwealth Turrets around the station. The cargo containers around the Korolov Stations and the annoying walls around the small sung stations are examples of station satellites. ====Encounters==== This adds extra encounters to a system where this station is present. //Expand on the element?// ====Names==== NavBeacon %s-%0%0%0 Or... DemoStation1; DemoStation2; SomeOtherStationName Provides a list of names from which the actual name of the station will be chosen. In the first example, %s is replaced with the current systems name, %0 is substituted by a random number from 0-9, so %0%0%0 could be any number from 000-999. ====StaticData==== my string of data Static data is useful for storing all kinds of information on an object that can then be retrieved later through script. You can have any amount of tags inside the staticdata element. Static data can also contain script elements, which can be run later. This is a common way of storing mission scripts and similar ====Events==== (sysAddObjRecurringTimerEvent (random 250 500) gSource "Bark") (plyMessage gPlayer "Come to "(objGetName gSource)" for the best prices in the galaxy!!") (sysCancelTimerEvent gSource "Bark") Events can be a powerful tool in stations. This set of events will start when the station is first created, and every 250-500 ticks will display a message on your screen that says "Come to (MyStationsName) for the best prices in the galaxy!!" until the station is destroyed. Events can also be used to control ships for missions, or generate new inventory in the station, scan the system for items or ships. The Events can do just about anything you can write in code. Be careful how many recurring events you use in stations as they can eat up your system resources and slow down your game if too many events are firing too often. =====Georges Notes===== These are some notes taken from Transcendence.xml on the vanilla stations attributes STATION ATTRIBUTES anarchists: anarchists commonwealth: commonwealth station commonFleet: Commonwealth Fleet commonMilitary: either Commonwealth militia or Commonwealth Fleet enemy: enemy of the player friendly: friend of the player populated: not an automated station primary: main station in the system ENVIRONMENT ATTRIBUTES envEarthstation found in earth systems envFirestation found in fire systems envWaterstation found in water systems envAirstation found in air systems For example, in asteroid systems (+envEarth) any station that DOES NOT have the envEarth attribute is half as likely to appear in the system. Each of the above attributes also has a pair of the form envAvoidsXXX. For example, envAvoidsAir means that the station is less likely than average to be found in an ice system. LOCATION CRITERIA +planetarystation twice as likely to appear near a planet =====Example Mods===== //feel free to add interesting station mods here// Here are some mods from xelerus that use stations alot and might be interesting to look at when modding stations * [[http://xelerus.de/index.php?s=mod&id=413|Prophet's Player Stations]] * [[http://xelerus.de/index.php?s=mod&id=234|Betel's Storage Station]] =====Credits===== Thanks to the following forum users for providing information: //DarthSaber, Bobby, Prophet, 12Ghost12// =====Comments===== //Please place your comments here// * 05/25/09 - added section, changed/updated some items that were sketchy after some testing (creditConversion & resupply), expanded ships attribute, section and added notes on gMargin. Added . Hope this helps! -Prophet * 05/28/09: I'm not sure the segment on gMargin belongs here. Although it is an interesting function, it has more to do with DockScreens. IIRC it cannot modify that much about the section. Eg. it cannot make the station buy or sell items not specified in the xml and it cannot change creditConversion or the other properties. I might be wrong though. -alterecco