Monthly Mod Jam — March 2016

Freeform discussion about anything related to modding Transcendence.
User avatar
AssumedPseudonym
Fleet Officer
Fleet Officer
Posts: 1122
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

Tue Mar 15, 2016 11:12 pm

 Greetings, Transcendence players! It’s time to start up the next edition of the Monthly Mod Jam. Last month had you creating playerships, and I was actually pleasantly surprised by the turnout we got. This month, you get to create a corporation that makes goodies to put onto those playership. There will be templates for various item types and stations below. To meet the requirements of this Jam:

» Create a corporation. You’ll need a name and a station. You can either reuse the basic armor or weapon dealers, pick out an unused station graphic from the vanilla resources, or create your own.
» Create a label for your corporation’s products.
» If you already have a corporate identity in mods elsewhere — Drake Technologies, Northwind, Avian Enterprises, and so forth — come up with a new one for the purpose of this Jam.
» Make between three and nine items that can be installed onto a playership. This can be armor, weapons, shields, or other devices. If you’re making multiple items of the same type, they can either be similarly themed (such as the Yoroi line of shields or the different variants of reactive armor, for example) or unique in their own right (such as the Hanzo blaster versus the Katana starcannon).
» The items should be at least reasonably balanced against vanilla weapons.

 To modders who already know what they’re doing: Take it easy on the <Events>, please. Like last month, I’m trying to keep this to relatively simple stuff.

 Once you have your corporation and items ready, send me a copy of it so I can do a little window shopping. Unless you’re using any custom graphics, you should just be able to copypasta the XML in a PM. If you have any questions, ask! That’s what I’m here for. You can either ask here in this thread, via PM, or on IRC — the link is on the main page, and I’m around pretty regularly. Xephyr is once again my acting deputy for the month — you should still have your badge somewhere, I hope. ^.~

 Templates. Stations may look daunting, but there’s actually a lot that won’t really need changed beyond the corporation name in the <Items> and <Trade> sections, the items available in the <Items> section, levelFrequency in the <StationType> section, and the image defined in the <Image> section. Don’t be afraid to experiment with things a bit to see what does what, but keep a functional backup handy to revert to in case you need one. I picked the Rassiermesser Arms & Armor dealer and then tweaked it a little here and there for use on the station template.

Code: Select all

	<!-- Corporate Station -->

<!-- This first section describes the basics of your station.  For the purposes of the Jam, you only need to worry about the following:

            name:  Your station name.
    dockingPorts:  How many ships can dock at your station at one time.
         armorID:  The armor your station has.  Note that this is only used for the armor resistances, not the hit points.
       hitPoints:  How many hit points your station has.
      repairRate:  How fast your station repairs damage done to it.
     fireRateAdj:  How frequently your station fires.
   explosionType:  How big a boom your station makes if it gets destroyed.
  levelFrequency:  What level systems your station can be spawned in.
locationCriteria:  Where your station is likely to be spawned in a system.
-->

	<StationType UNID="&stArmsDealerRasiermesser;"
			name=				"Rasiermesser Arms & Armor"
			sovereign=			"&svCorporate;"
			inherit=			"&baCorporateStation;"

			dockScreen=			"&dsArmsDealerSpecial;"
			abandonedScreen=	"&dsAbandonedStation;"
			dockingPorts=		"8"
			canAttack=			"true"

			multiHull=			"true"
			armorID=			"&itGusokuArmor;"
			hitPoints=			"250"
			repairRate=			"3"
			fireRateAdj=		"80"
			explosionType=		"&vtBlastExplosion2;"
			ejectaType=			"&vtWreckEjecta;"

			attributes=			"corporate, corporateCustoms, envAir, envEarth, envFire, envWater, friendly, generic, human, independent, populated"
			levelFrequency=		"-rurv ----- ----- ----- -----"
			locationCriteria=	"+planetary"

			noArticle=			"true"
			>

<!-- This defines the graphic used for your station. -->

		<Image			imageID="&rsStations1;" imageX="256" imageY="384" imageWidth="128" imageHeight="128"/>

<!-- This describes what ships are created at your station when it spawns.  It shouldn’t need changed. -->

		<Ships>
			<Lookup count="2" table="&tbCorpDefenders;"/>
			<Lookup count="1d4" table="&tbCommPrivateCrafts;"/>
		</Ships>

<!-- This describes what ships will come to your station when the ones at it leave or are destroyed.  It shouldn’t need changed. -->

		<Reinforcements minShips="4">
			<Table>
				<Lookup chance="75" table="&tbCorpDefenders;"/>
				<Lookup chance="25" table="&tbCommPrivateCrafts;"/>
			</Table>
		</Reinforcements>

<!-- This is your station’s installed weaponry. -->

		<Devices>
			<Device deviceID="&itAkan30Cannon;"	omnidirectional="true"/>
		</Devices>

<!-- This is what your station has for sale.

  Replace “+Rassiermesser” with “+YourCorporation”.
  If your station sells miscellaneous devices, replace the “w” in criteria with a “d”.

-->

		<Items>
			<RandomItem count="1d12" 
					criteria=		"w +Rasiermesser; -NotForSale;"
					levelFrequency=	"systemLevel:u|c|ur"
					enhanced=		"10"
					enhancement=	"=(intHPEnhancement2)"
					/>

			<RandomItem count="2d12" 
					criteria=		"a +Rasiermesser; -NotForSale;"
					levelFrequency=	"systemLevel:u|c|ur"
					enhanced=		"10"
					enhancement=	"=(intHPEnhancement2)"
					/>
		</Items>

<!-- This section defines what your station will buy or sell.

  The priceAdj is a percentage to raise or lower prices from their baseline costs.  They probably won’t need changed.
  If your station does not buy goods from the player, repair armor, replace armor, or install or remove devices, omit the relevant tags.

-->

		<Trade currency="credit" max="50000" replenish="2500">
			<Sell	criteria="m +rasiermesser; -military; -illegal; -notForSale;" priceAdj="120" inventoryAdj="800"/>
			<Sell	criteria="*NU -Illegal; -ID; -NotForSale;"	priceAdj="120"/>
			<Buy	criteria="mwU -Illegal; -NotForSale;"	priceAdj="60"/>
			<Buy	criteria="mwU -Illegal; -ID;"				priceAdj="10"/>

			<RepairArmor	criteria="a L:1-7;" priceAdj="100"/>
			<ReplaceArmor	criteria="a +rasiermesser; L:1-7;" priceAdj="100"/>
			<InstallDevice	criteria="d +rasiermesser; L:1-7;" priceAdj="100"/>
			<RemoveDevice	criteria="d L:1-7;" priceAdj="100"/>
			
			<ReplaceArmor	criteria="a L:1-7;" priceAdj="unavailable"	messageID="descNoInstall"/>
			<InstallDevice	criteria="d L:1-7;" priceAdj="unavailable"	messageID="descNoInstall"/>
		</Trade>

<!-- These should not be changed. -->

		<Events>
			<OnContractGenerate>
				(intGenerateIndustrialRequestContract1)
			</OnContractGenerate>

			<OnContractQuery>True</OnContractQuery>
		</Events>

<!-- This should be changed to reflect your station’s name. -->

		<StaticData>
			<LongName>"a Rasiermesser arms dealer"</LongName>
		</StaticData>

<!-- This defines the position of your station’s docking ports. -->

		<DockingPorts>
			<Port x="0"		y="70" />
			<Port x="0"		y="-70" />
			<Port x="50"	y="50" />
			<Port x="50"	y="-50" />
			<Port x="70"	y="0" />
			<Port x="-70"	y="0" />
			<Port x="-50"	y="50" />
			<Port x="-50"	y="-50" />
		</DockingPorts>

<!-- This should be changed to reflect your corporation’s name. -->

		<Language>
			<Text id="descNoInstall">
				(cat
					"We only install Rasiermesser items. "
					"We cannot install " (itmGetName (@ gData 'item) 0x04) " on your ship."
					)
			</Text>
			<Text id="dockServices:installAbility">
				(cat "We install Rasiermesser items up to tech level " (objGetProperty gSource 'installDeviceMaxLevel) ".")
			</Text>
		</Language>

	</StationType>
 Fortunately, labels are a lot simpler.

Code: Select all

	<Type UNID="&lbAEMiscellaneousLabels;">
		<DisplayAttributes>
			<ItemAttribute label="YourCorporation" criteria="* +YourCorporation;"/>
		</DisplayAttributes>
	</Type>
 Xephyr will be posting the templates for items below.
 If there is anything either of us missed, ask one of us for clarification. Also, if you’re wanting examples of code directly from the game or just want to experiment with something we may not have specifically covered, the source code for 1.7 alpha 1 can be found here for you to examine at your leisure.
Image

Mod prefixes: 0xA010 (registered) and 0xDCC8 (miscellaneous)

My mods on Xelerus: Click here!

Of all the things I’ve lost in life, I miss my mind the least. (I’m having a lot more fun without it!)

User avatar
Xephyr
Militia Captain
Militia Captain
Posts: 855
Joined: Fri Dec 14, 2007 1:52 am
Location: Orion Arm, Milky Way
Contact:

Tue Mar 15, 2016 11:25 pm

Hope you don't mind walls of text. Note: for the device template, select only one chunk of code to define the item - delete the rest.

Also note that this isn't a complete XML this time around - you'll have to define your unids on your own this time around.


Armour:

Code: Select all

<!-- 
<ItemType>
name=			The name of the item.
level=			Tech level of the item. For armour, this influences resistance to damage types, repair cost, and when in the game it appears.
value=			Value, in credits.
mass=			Mass, in kg (1000= 1 tonne)
frequency=		Rate at which it appears in randomly generated tables. You may use: "veryrare", "rare", "uncommon", "common", and "notRandom".
numberAppearing=Number of segments that appear at a time in randomly generated tables. "1d4" is most common as most ships use 4 segments.
attributes=		Use this to define manufacturer tags and other attributes, separated by commas. Armor is usually tagged with "minoritem."

description=	self explanatory

Other things you can put in this chunk:

showReference=	Can be set to true/false. Set to true by default. Set to false if you don't want the player to see the armour's damage resistance for whatever reason.

-->


<ItemType UNID="&itArmorPlate;"
			name=				"[segment(s) of ]armor plate"
			level=				"1"
			value=				"100"
			mass=				"1000"
			frequency=			"common"
			numberAppearing=	"1d4"
			attributes=			"minorItem, commonwealth"

			description=		"Armor plates are seen on most starships."

			>

		<Image imageID="&rsItems1;" imageX="0" imageY="0" imageWidth="96" imageHeight="96"/>

<!--
<Armor> tag:

hitPoints=	Number of hit points on the armour.
hpBonus=	Damage resistance, as an integer value from the standard for the tech level, separated by commas.
			Order of appearance: "Laser, Kinetic, Particle, Blast, Ion, Thermo, Positron, Plasma, and so on" 

	Inherent damage resistances:
		level VI+ is blind immune
		level VII+ is radiation immune
		level IX+ is EMP immune
		level XI+ is device damage immune
	
		
			
Other things you can put in this chunk:

radiationImmune=	Can be set to "true" or "false". Armour segments above tech level 6 are inherently radiation immune, so this needs to be set to "false" if you don't want immunity above level 7 (like ceralloy).
blindingDamageAdj=	Define a value here to set the armour's resistance to blinding attacks. Set to "0" to make immune.
EMPDamageAdj=		Same as above, but for EMP attacks.
deviceDamageAdj=	Same as above, but for device disruption.
disintegrationImmune= Can be set to "true" or "false". Only practical against the Iocrym command ship right now.

repairTech=			Tech level that the armour can be repaired at. Stations and repair devices have set armour repair levels, so this can be used to limit the armour's practicality.

installCostAdj=		A cost adjustment for installing the armour, as a percentage of the cost for armours of the same level.

regen=				Include a value here to have the armour repair itself over time. For example, Duralloy has regen="1" and photo-organic armour has regen="2".
photoRepair=		Set to "true" to have the armour repair itself when exposed to sunlight. You also must define a regen value for this to work.
powerUse=			Include a value here to have the armour segment draw power from the ship's reactor.
photoRecharge=		Include a value here to have the armour segment recharge the ship's reactor when exposed to sunlight.
decay=				Define a value here to have the armour slowly decay over time. Transuranic armour uses "0.75", for reference.

stealth=			Define a value here to make the ship harder to pick up on the LRS/SRS. NPCs seem to ignore this when attacking the player, however.

completeBonus=		An HP bonus to all armour segments if all armour segments are the same.


deviceHPBonus=		Include a percentage value here, along with a deviceCriteria (below), to have a bonus to shield HP when installed.
deviceCriteria=		Define as "s" along with a deviceHPbonus (above) value.

 -->	
		
		<Armor
				hitPoints=	"220"
				hpBonus=	"  +0,  +0,  +0,+100,  +0, +25"
				radiationImmune="true"
				/>
	</ItemType>
Devices:

Code: Select all

<!--
You should be getting the hang of the itemtype definitions, so I'll just include the new one here.

unkownType=		This allows the device to inherit from an unknown type. In this case, it will appear the same as an unidentified laser collimator or cannon accelerator.
				You can also define as:
				"&itUnknownEnhancer5;", for it to appear as an unknown level 5 device
				"&itUnknownEnhancer8;", for it to appear as an unknown level 8 device
				"&itUnknownAlienDevice;" for it to appear as an unknown alien device
				Define your own,
				...or leave this field out altogether for it to appear already identified.
-->
	
	<ItemType UNID="&itEnhancementDevice;"
			name=				"Enhancer"
			attributes=			"commonwealth, majorItem, weaponEnhancer"
			  
			level=				"1"
			frequency=			"uncommon"
			unknownType=		"&itUnknownEnhancer2;"

			value=				"500"
			mass=				"500"
			  
			description=		"This enhancer is capable of many things.."
			>

		<Image imageID="&rsItems1;" imageX="0" imageY="192" imageWidth="96" imageHeight="96"/>

<!--
Here's where you can define what the device does.

****Select only one of MiscellaneousDevice, ReactorDevice, or DriveDevice and delete the other chunks.****

<MiscellaneousDevice>
poweruse=	Power use, in tenths of a MW. So, "5" = 0.5MW.

Optional:
capacitorPowerUse=	
powerToActivate=	These two are used on the Transpace Jumpdrive. Should only be used if your device is invokable.

---

<EnhancementAbilities> (ripped from http://wiki.kronosaur.com/modding/xml/api_version?s[]=criteria)
	This defines an item enhancement device.
	
    type: This is a user-defined string representing the type of enhancement. Only a single enhancement of each type will be applied.
    criteria: This is an item criteria specifying the set of devices that will be enhanced by this device.
			[So, if you want an item that enhances your corporation's items, use:
			
			criteria=		"w~l +YourCorporation;"
			
    enhancement: This defines the enhancement applied to the set of devices that match the criteria. This is expressed as an enhancement code (see shpEnhanceItem) or as one of the following special codes:
        “+hpBonus:{n};” where {n} is the percent bonus.
        “+shield:{n};” where {n} is a level. This is equivalent to the shield:{n} damage modifier.
        “+speed:{n};” where {n} is the percent value of the new weapon delay time relative to the current one. E.g., 75 = 75% of the original delay time.

-->
		<MiscellaneousDevice
				powerUse=		"5"
				>
			<EnhancementAbilities>
				<Enhance type=			"laser"
						 criteria=		"w~l +damageType:laser;"
						 enhancement=	"+hpBonus:75;"
						 />
			</EnhancementAbilities>
		</MiscellaneousDevice>
		
<!--
<DriveDevice>
	This defines a drive upgrade.
maxSpeed=	When installed, the ships' max speed will be set to this (fraction of c)
thrust=		When installed, the ships' max thrust will be set to this
powerUsed=	Power used by the drive when thrusting, in tenths of MW. So, "100" is 10MW.

Optional:
inertialessDrive=	Set to "true" or "false" (false by default). Used on the inertialess drive.
-->
		<DriveDevice
				maxSpeed=		"30"
				thrust=			"750"
				powerUsed=		"2000"
				/>

<!--
<ReactorDevice>
	This defines a reactor.

maxPower=			Max power output, in tenths of MW. So, 100 is 10MW.
fuelEfficiency=		How quickly the reactor burns fuel, and how much is wasted. eg. The Nova 100 is the most efficient vanilla reactor at "18", while most are at "15".
maxFuel=			Max amount of fuel the reactor can hold. This increases as level increases - For comparison, the Hyperion has maxFuel= "5000000"
fuelCriteria=		A level range of fuel that the reactor accepts.
-->		
				
		<ReactorDevice
				maxPower=		"100"
				fuelEfficiency=	"15"
				maxFuel=		"25000"
				fuelCriteria=	"f L:1-3;" 
				/>
<!--
CargoHoldDevice

cargoSpace=		Tonnes of cargo space added to the ship when installed.
 -->
		<CargoHoldDevice
				cargoSpace=		"80"
				/>
				
<!--
<AutoDefenseDevice>
	This defines an autodefense device, like the Longreach and ICX.
	
target=			What the device targets.
targetCriteria=	Use this (but disclude target=) to use a criteria string instead. 'b' selects beams, 'm' selects missiles, and 'Es' selects enemy ships. A range must also be defined - so, the field should look something like: "Es N:24".

weapon=			The virtual weapon type that the defense device uses. Use a pre-defined one or look in the code and make your own.
fireRate=		Fire rate of the virtual weapon. Functions the same as fireRate on regular weapons.
-->
				
		<AutoDefenseDevice
				target=			"missiles"
				weapon=			"&vtICXLaserCannon;"
				fireRate=		"15"
				/>
				
<!-- 
<RepairerDevice>
	This defines a repair device, like the patcher arm.
	
regen=			Repair rates for different armour levels, from L1 to L10.
powerUse=		Power use, in tenths of MW. So, "5" = 0.5MW
-->
				
		<RepairerDevice
				regen=			" 4, 3, 3, 2, 2,  2, 1, 1, 1, 1"
				powerUse=		"5"
				/>
				
				
	</ItemType>
Launchers
These are similar enough to ammo weapons. Take a look at the SmartCannon in stdweapons.xml to look at how to handle non-launcher ammo weapons.

Code: Select all

	<ItemType UNID="&itMissileLauncher;"
			name=				"missile launcher"
			attributes=			"commonwealth, majorItem"
			  
			level=				"3"
			frequency=			"common"

			value=				"1000"
			mass=				"1000"
			  
			description=		"This launcher is compatible with a range missiles."
			>

		<Image imageID="&rsItems1;" imageX="480" imageY="0" imageWidth="96" imageHeight="96"/>

		<Weapon
				fireRate=			"30"
				powerUse=			"10"
				launcher=			"true"
				>

		<!-- You can define multiple missile types here that are compatible with the launcher. -->
		
			<Missiles>
				<Missile ammoID="&itYourMissile;"/>
			</Missiles>
		</Weapon>
	</ItemType>
	

	<ItemType UNID="&itYourMissile;"
			name=				"missile"
			attributes=			"basicAmmo, commonwealth, consumable, missile"
			  
			level=				"2"
			frequency=			"common"
			numberAppearing=	"2d12"

			value=				"5"
			mass=				"20"
			  
			description=		"This is a standard hexagene high-explosive missile."
			>

		<Image imageID="&rsItems1;" imageX="96" imageY="0" imageWidth="96" imageHeight="96"/>

<!--
<Missile>
	These are the same stats as the km100 longbow.
	
type=		Missile or beam
lifetime=	Projectiles lifetime in ticks.
damage=		Damage type, dice roll value, and other stuff.
	Optional extra fields (separate with semicolons):
		radiation1; shield1; (shield2; shield3; etc. for shield busters)
-->		
		
		<Missile
				type=			"missile"
				lifetime=		"120"
				damage=			"blast:4d6; momentum4; WMD5"
				missileSpeed=	"45"
				hitPoints=		"10"
						 
				effect=			"&efMissileNAMI;"
				sound=			"&snMissileLauncher;"
				>

			<HitEffect
					sound="&snArmorHit1;"
							>
				<Image imageID="&rsExplosionsAG48;"
						imageX="0"
						imageY="0"
						imageWidth="48"
						imageHeight="48"
						imageFrameCount="16"
						imageTicksPerFrame="2"/>
			</HitEffect>
		</Missile>
	</ItemType>
If you need clarification on anything, feel free to ask.
If anyone needs a template for weapon effects I can do that too.
Last edited by Xephyr on Wed Mar 16, 2016 9:43 pm, edited 1 time in total.
Project Renegade (Beta) : "The Poor Man's Corporate Command!"
Real programmers count from 0. And sometimes I do, too.

gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

Wed Mar 16, 2016 12:52 am

Thanks for posting this!

I have several devices that use events. Would it be all right to include the basic devices for the Mod Jam and publish a separate version on my own that has the devices with event code in them?

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

Wed Mar 16, 2016 2:19 am

Templates !!
More templates ! :)
No seriously, love the idea. I would like to see a template for each XML type. And then collect all of them in a single file ! :)

User avatar
Xephyr
Militia Captain
Militia Captain
Posts: 855
Joined: Fri Dec 14, 2007 1:52 am
Location: Orion Arm, Milky Way
Contact:

Wed Mar 16, 2016 2:31 am

digdug wrote:Templates !!
More templates ! :)
No seriously, love the idea. I would like to see a template for each XML type. And then collect all of them in a single file ! :)
Considering how many places I have to look just to create these things I think that would be a great idea.

You guys are welcome to use the templates I made however you like.
Project Renegade (Beta) : "The Poor Man's Corporate Command!"
Real programmers count from 0. And sometimes I do, too.

User avatar
AssumedPseudonym
Fleet Officer
Fleet Officer
Posts: 1122
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

Wed Mar 16, 2016 2:38 am

Xephyr wrote:You guys are welcome to use the templates I made however you like.
 Ditto for mine.
gunship256 wrote:I have several devices that use events. Would it be all right to include the basic devices for the Mod Jam and publish a separate version on my own that has the devices with event code in them?
 Probably not, but I’m willing to discuss that over PM. Check your inbox.
Image

Mod prefixes: 0xA010 (registered) and 0xDCC8 (miscellaneous)

My mods on Xelerus: Click here!

Of all the things I’ve lost in life, I miss my mind the least. (I’m having a lot more fun without it!)

gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

Mon Mar 21, 2016 10:01 pm

Thanks for posting all of those templates! This is only my second time making a station, so I ran into some roadblocks with the code (again) and fixed the issues. Here's a breakdown of what I found out in case it helps anyone else.

Rasiermesser stations sell things but don't buy them. The dockscreen in the code below doesn't have the link necessary to reach the area that lets the player sells things to the station:

Code: Select all

dockScreen=         "&dsArmsDealerSpecial;"
The vanilla stations that buy things include the dockscreen code inside the code for the station. They replace the line above with this:

Code: Select all

dockScreen=			"Main"
and some code further down:

Code: Select all

		<DockScreens>
			<Main>
				<Panes>
					<Default
							desc=	"You are docked at a franchise of Thor's Wondrous Devices.">

						<Actions>
							<Action name="Dock Services" key="D" default="1">
								(rpgDockServices gPlayerShip {
									checkMilitaryID: True
									upgradeInstallOnly: True
									})
							</Action>

							<Action name="Commodities Exchange" key="C">
								(scrShowScreen gScreen &dsRPGCommoditiesExchange; {
									checkMilitaryID: True
									})
							</Action>

							<Action name="Undock" cancel="1" key="U">
								<Exit/>
							</Action>

						</Actions>

					</Default>
				</Panes>
			</Main>

		</DockScreens>
The code above was taken from CorporateHierarchy.xml, lines 2958 and 3033-3063, in the Transcendence 1.7 alpha source code. (EDIT: I decided to use the code from Thor's about because Thor's has a link to both dock services and a commodities exchange. A station that only deals in armor or weapons should probably use a dockscreen that is more like that of the armordealer or arms/weapons dealer.)

levelFrequency in the StationType tag specifies which systems the station will spawn in:

Code: Select all

levelFrequency=      "-rurv ----- ----- ----- -----"
I wanted my station to be a midgame station, so I looked at the levelFrequency for the Bushido dealer, which is different than the code given above. I also used the Bushido dealer as a starting point for hitPoints, repairRate, and what level of defensive weapon the station should have.

THIS is really cool:

Code: Select all

         <RandomItem count="1d12" 
               criteria=      "w +Rasiermesser; -NotForSale;"
               levelFrequency=   "systemLevel:u|c|ur"
               enhanced=      "10"
               enhancement=   "=(intHPEnhancement2)"
               />
"systemLevel:u|c|ur" doesn't show up in most of the stations in the game. Most of them have a static levelFrequency where the station sells a certain range of items no matter where the station spawns in the game. The code above, though, actually has the station choose which level of items it offers based on how far the player has progressed in the game.

For example, level 6 items will never spawn in Eridani with the code above, and level 3 items won't spawn at Sanctuary. The station always offers level-appropriate items.

From trial and error, I believe the brackets ("| |") specify how common items should be at the level of the current system. I believe the earliest midgame systems are level 4, so with "systemLevel:u|c|ur", the station should offer level 3, 4, 5, and (rarely) 6 items for sale.

Changing the code to this:

Code: Select all

               levelFrequency=   "systemLevel:r|u|ccur"
causes items to spawn that are slightly higher than the system level. Since my station offers damaged items for sale that have to be repaired with longzhu spheres, I wanted only more advanced items that would be worth the trouble.

The criteria can be a bit confusing to figure out:

Code: Select all

criteria=      "w +Rasiermesser; -NotForSale;"

Code: Select all

      <Trade currency="credit" max="50000" replenish="2500">
         <Sell   criteria="m +rasiermesser; -military; -illegal; -notForSale;" priceAdj="120" inventoryAdj="800"/>
         <Sell   criteria="*NU -Illegal; -ID; -NotForSale;"   priceAdj="120"/>
         <Buy   criteria="mwU -Illegal; -NotForSale;"   priceAdj="60"/>
         <Buy   criteria="mwU -Illegal; -ID;"            priceAdj="10"/>

         <RepairArmor   criteria="a L:1-7;" priceAdj="100"/>
         <ReplaceArmor   criteria="a +rasiermesser; L:1-7;" priceAdj="100"/>
         <InstallDevice   criteria="d +rasiermesser; L:1-7;" priceAdj="100"/>
         <RemoveDevice   criteria="d L:1-7;" priceAdj="100"/>
         
         <ReplaceArmor   criteria="a L:1-7;" priceAdj="unavailable"   messageID="descNoInstall"/>
         <InstallDevice   criteria="d L:1-7;" priceAdj="unavailable"   messageID="descNoInstall"/>
      </Trade>
This wiki link has a description of the criteria used above. I can't seem to make a clickable link using the forum's square-bracket-sort-of-HTML, so here's the address:

https://wiki.kronosaur.com/modding/func ... m_criteria

For example, "a L:1-7;" is level 1-7 armor, while "d +rasiermesser; L:1-7;" only chooses Rasiermesser devices of level 1-7.

"w~l" means "weapon but not launcher", while "l" means "launcher only."

"*NU -Illegal; -ID; -NotForSale;" priceAdj="120" selects undamaged items that are not installed (the station will never sell its installed defensive gun), are not illegal, and are not marked with the NotForSale attribute. They will be offered for sale at 120% of normal price (the station makes a profit). EDIT: -ID exclude items with the ID attribute, such as the Black Market ID chip.

I believe the last two lines are there so the station has a dockscreen to go to if a device to be installed doesn't meet the criteria for being installable at this station.

(Help!) I wanted to make my station install damaged devices so they could be repaired with weapon optimizer ROMs, but the game doesn't seem to allow that, even if I use the code below:

Code: Select all

<InstallDevice   criteria="dD L:1-7;" priceAdj="100"/>
Some other random things:

Negative numbers are fun to play with to create new kinds of devices. For example,

Code: Select all

      <CargoHoldDevice
            cargoSpace=      "-80"
            deviceSlots=       "-1"
            />
removes 80 tons of cargo space and adds an extra device slot to the ship.

deviceSlots= "2" causes an item to use two slots (CLAW cannon), while deviceSlots= "0" makes the device slotless (but not external - that's done with external="true").

For armor repair devices,

Code: Select all

      <RepairerDevice
            regen=         " 4, 3, 3, 2, 2,  2, 1, 1, 1, 1"
            powerUse=      "5"
            />
specifices a power use of 5/10 = 0.5MW. This is the power use FOR EVERY TWO SEGMENTS of armor. On the Wolfen, this device could use up to 1 MW of power. On the 16-segment capital ship in The Backroads, the same armor repair device could use up to 8 MW of power, possible causing a reactor overload. Unfortunately, that overload often drops shields at the worst possible time.

Regen is how fast armor is repaired. Higher numbers indicate a faster repair rate (although there's another way to specify this in older mods, using different code, where lower numbers indicate a faster repair rate). The numbers, from left to right, indicate the level of armor being repaired. Level 1 armor would be repaired at a rate of 4, while level 7 armor would be repaired at a rate of 1.

For weapons, fireRate is inversely proportional to shots/second. In other words,
Shots per second = 60/fireRate
A weapon with a fireRate of 10 shoots 6 shots/second.

The damage per shot is normally based on a dice roll:

Code: Select all

damage=         "blast:4d6+1; momentum4; WMD5"
This would roll 4 six-sided die and add 1 to get the damage. The lowest possible damage per shot is 5, and the highest possible is 25. The average damage per shot is therefore (5+25)/2 = 15. If the weapon shoots 6 shots/second, the damage per second is 15*6 = 90.

Weapon range depends on shot speed (missileSpeed), in percent of the speed of light, and lifetime, which is the amount of time before the shot disappears. Matter shots are coded as missiles even if for weapons that don't use ammo. For example, here's the code for the recoilless cannon:

Code: Select all

		<Weapon
				type=				"missile"

				damage=				"kinetic:1d6+1; momentum1"
				fireRate=			"15"
				missileSpeed=		"40"
				interaction=		"80"
				lifetime=			"60"
				powerUse=			"10"
				
				effect=				"&efKineticBoltDefault;"
				sound=				"&snRecoillessCannon;"
				>
		</Weapon>
Here's the formula for calculating range:
Range in light seconds = (missileSpeed)*(lifetime)/50
A laser beam with a shot speed of 100 and a lifetime of 30 has a range of 100*30/50 = 60 light seconds. Shot speed for beams is 100 by default.

Interaction can also be added to shots. Using interaction="100" makes shots stop (and get stopped by) incoming laser, particle, and ion beams, and using interaction="0" makes beams pass through each other. If I remember right, matter weapons have interaction set to 100 by default, while beams have interaction of 0 by default.

The code for the recoilless cannon above changes interaction to 80, which means that the shots will stop other shots 80% of the time. When two shots meet, the chance of interaction is based on whichever shot has higher interaction. If a kinetic shot with an interaction of 80 meets a beam with an interaction of 0, the game uses 80. If two beams meet that both have interactions of 0, they pass through each other.

George has also made his weapon balancing algorithm available for download, though it takes a lot of work to sort through and figure out exactly how the calculations work.

For enhancers:

Code: Select all

      <MiscellaneousDevice
            powerUse=      "5"
            >
         <EnhancementAbilities>
            <Enhance type=         "laser"
                   criteria=      "w~l +damageType:laser;"
                   enhancement=   "+hpBonus:75;"
                   />
         </EnhancementAbilities>
      </MiscellaneousDevice>
type="laser" makes the laser collimator unique so that if two of them are installed, only one of them enhances the ship's weapons. Removing the type makes it possible for enhancers to to stack.

If the enhancement is "+hpBonus:75;", the damage stacks additively. That is, two 75% hitpoint bonuses add up to a 150% bonus.

If the enhancement is "+speed:70;", the weapon speeds up by a factor of 100/70 = 41%. This enhancement is multiplicative, not additive. That is, stacking two speed enhancements doubles speed (1.41*1.41 = 1.99) instead of raising speed by (41%*2 =) 82%.

I hope this isn't too much info. Ignore or correct it at your leisure. I would just hate to see other people going crazy trying to figure this out through trial and error like I mostly had to.
Last edited by gunship256 on Fri Mar 25, 2016 4:19 am, edited 1 time in total.

NMS
Militia Captain
Militia Captain
Posts: 551
Joined: Tue Mar 05, 2013 8:26 am

Tue Mar 22, 2016 7:04 am

Thanks for taking the time to write all that out. I was aware of most of it, but it could really help people getting started. Some of this should really be added to the wiki, too. (Probably in https://wiki.kronosaur.com/modding/xml/itemtype and https://wiki.kronosaur.com/modding/xml/stationtype.)

"-ID" just means to exclude items with the ID attribute. Most stations don't buy or sell ID chips.

Peter
Commonwealth Pilot
Commonwealth Pilot
Posts: 91
Joined: Wed May 07, 2014 1:11 am
Location: New Zealand

Wed Mar 23, 2016 10:59 am

So this mod jam is open until the end of March? Hmm... I won't be able to meet the deadline, but I'm going to do it anyway for fun :D
My dream is to one day discover that someone who plays transcendence lives near me and goes to my school. Then I can finally have a friend.
---
Why must I keep running into that wall, impossibility?

User avatar
DigaRW
Militia Commander
Militia Commander
Posts: 363
Joined: Thu Jul 30, 2015 3:10 pm
Location: Deep dark space/Indonesia

Wed Mar 23, 2016 1:44 pm

Damn it, I even not notice this post.
I also have Corporation, but I'm not pretty sure if it really balanced.
My best product, Semesta Launcher seem too powerful, but with level 4 and uncommon frequency is make sure that player will not easily find it.
SB Device is trully an extreme advantage, because they can deplete any enemy shield (Even ICS).
I also create a dealer station for it. Though I never meet them.
Attachments
1508_RWExtension.zip
SEMESTA Corp
(19.56 KiB) Downloaded 30 times
Download Transcendence mods from Reinvented Workbench Project!
Semesta I.G.C v1.37
Great corporate that feature a new items and challenges!
YourCORP v1.16
Build your very own corporation!
Trade Item Extension v1.15
New misc items, foods and resources!
StrongBox v1.4
Open it up to get a random equipments!
Flare Weapons v1.6
New weapons that have very unique abilities!
Click this link!

gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

Fri Mar 25, 2016 4:22 am

NMS wrote:Thanks for taking the time to write all that out. I was aware of most of it, but it could really help people getting started. Some of this should really be added to the wiki, too. (Probably in https://wiki.kronosaur.com/modding/xml/itemtype and https://wiki.kronosaur.com/modding/xml/stationtype.)

"-ID" just means to exclude items with the ID attribute. Most stations don't buy or sell ID chips.
Thanks! I should have thought to check the vanilla code for items with the ID attribute.

What are the guidelines for editing the wiki? Who's currently in charge of it in case I have questions?

Peter
Commonwealth Pilot
Commonwealth Pilot
Posts: 91
Joined: Wed May 07, 2014 1:11 am
Location: New Zealand

Fri Mar 25, 2016 6:35 am

Who's currently in charge of it in case I have questions?
Someone else will probably answer this question better than me in a while, but for the moment you'll have to live with this answer:

If you want to ask questions about the game in general, head over to IRC:
http://webchat.freenode.net/?&channels=transcendence
There is generally someone on

If you want to ask questions about modding, also go to the IRC. That's what I've been doing in the past week :D

If you want to ask questions specifically about editing the wiki and other wiki related things, I think it would be best to PM George and other moderators. You can tell what rank someone is by using the information here:
https://forums.kronosaur.com/viewtopic.php?f=15&t=3929

Hope this helps :)
My dream is to one day discover that someone who plays transcendence lives near me and goes to my school. Then I can finally have a friend.
---
Why must I keep running into that wall, impossibility?

User avatar
AssumedPseudonym
Fleet Officer
Fleet Officer
Posts: 1122
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

Thu Mar 31, 2016 9:37 pm

March 2016 MMJ deadline extended to April 7th

 Due to a variety of reasons — partly RL, partly trying to fix a particularly nasty bug in The Backroads that made it unplayable — I haven’t been able to devote much or any time to this month’s MMJ. You might have noticed my general lack of posts on the thread. I haven’t been able to look at any of the submissions yet, let alone make one of my own. I do apologize, it’s just that everything kinda got very hectic right about the time I was firing this one up, and then the MMJ sort of got lost in the shuffle.
Image

Mod prefixes: 0xA010 (registered) and 0xDCC8 (miscellaneous)

My mods on Xelerus: Click here!

Of all the things I’ve lost in life, I miss my mind the least. (I’m having a lot more fun without it!)

shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1483
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska

Fri Apr 01, 2016 2:32 am

AssumedPseudonym wrote:March 2016 MMJ deadline extended to April 7th

 Due to a variety of reasons — partly RL, partly trying to fix a particularly nasty bug in The Backroads that made it unplayable — I haven’t been able to devote much or any time to this month’s MMJ. You might have noticed my general lack of posts on the thread. I haven’t been able to look at any of the submissions yet, let alone make one of my own. I do apologize, it’s just that everything kinda got very hectic right about the time I was firing this one up, and then the MMJ sort of got lost in the shuffle.
can you drop it down to an extension and let the game engine help you find the issues?

it's probably something like " You did a Shane!" by forgetting a ( ) or something silly that will drive you up the wall
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..

User avatar
AssumedPseudonym
Fleet Officer
Fleet Officer
Posts: 1122
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

Fri Apr 01, 2016 2:58 am

 I appreciate the offer, but I already got it, heh. Once I get hold of a bug like this, I tend to get pretty relentless about attacking it until either it’s fixed or I’ve determined that there’s some sort of bug in the engine that won’t let me fix it or at least work around it. I’m stubborn like that. (You can check out the TBR Ministry ticket on it if you’re really curious.)
Image

Mod prefixes: 0xA010 (registered) and 0xDCC8 (miscellaneous)

My mods on Xelerus: Click here!

Of all the things I’ve lost in life, I miss my mind the least. (I’m having a lot more fun without it!)

Post Reply