ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
This sheet contains references to all relevant workshop-related modding code as well as how to use them. Please read the table of contents and the START section below if you are beginning modding
2
Table of ContentsSection TypeUse Ctrl + F (PC) or Search function (mobile) in order to skip to a section you need, copy whats listed exactly:Function of section/code
3
Sections with brackets and no name or number (like [core] ) you can only have 1 ofSingle[core]Core unit functions such as HP and death animation
4
Sections with NAME at the end can have multiples and be namedMulticanBuild_NAMEBuild queues for building new units
5
Single[graphics]Main image configuration and unit trails
6
Single[attack]Attack permissions against other units
7
MAX: 30Multiturret_NAMETurret that follows attack permissions and uses projectile
8
Multiprojectile_NAMECan be used by turret and can spawn more projectiles
9
Single[movement]Speed and movement type characteristics
10
Single[ai]How AI may use this unit, mostly for buildings
11
!!! Arm and Leg can ONLY use numbers Numberleg_ OR arm_Moveable cosmetics for mechs, infantry etc.
12
Multiattachment_Units stacked onto original to make compound units
13
Multiaction_NAME OR hiddenAction_NAMEActions that can do very wide range of things
14
Multieffect_NAMEVisual effects spawned by unit that eventually disappear
15
Multianimation_NAMEAnimations for leg, arm or main body sprite
16
Not a section of its ownListspawnUnits:LISTLists you can form for spawning units
17
Not a section of its ownListspawnProjectiles:LISTLists you can form for spawning projectiles
18
Not a section of its ownLogiclogicBoolean_Advanced logic to place across all logic fields
19
MultiplacementRule_NAMEAllows creation of rules for buildings
20
Not a section of its ownListPrices/ResourcesUseable resources for prices using "price:" function
21
Multiglobal_resource_NAMEGlobal resource collected by team shows up on top
22
Multiresource_NAMELocal resource used by units can be used for ammo
23
Multidecal_NAMEVersatile graphics can be stack to make 2.5D sprites
24
Use # before text to use in any section, example: #This is a note in [core]Multicomment_NAMEUsed exclusively for notes, does not read anything
25
Multitemplate_NAMEUsed to create sections that can be referenced in unit
26
Is a file that you must createFileNAME.templateCreate chains of unit files doesn't load unless copyFrom:
27
Is a file that you must createFileall-units.templatePut in root of mod, will apply to ALL unit .ini files
28
Is a file that you must createFilemod-info.txtPut in root of mod, will change some settings of mod
29
RefProjectile Draw TypesDefault projectiles able to use in [projectile_NAME]
30
STARTIn order to create an unit, you need to create a file with extension of .ini. It can be named anything, even with unicode characters, and it must be in your mod folder inside the rustedWarfare/mods/units/MODNAME folder -- Then, you add the sections in with the codeThe unit file extension needed:
31
There are some lines of code that are required before a unit can be useable. These lines of code can be set to anything appropriate, just need to have their fields filled out for initializing or it will give an error Error for not having needed code:
32
!!! THESE ARE REQUIRED CODE !!!Example
33
SectionCodeOption
34
[core]name: ANYunit name
35
maxHp: 200number
36
price: 500number
37
mass: 50number
38
radius: 16number
39
40
[graphics]image: ANY.pngimage file
41
42
[attack]canAttack: truetrue, false
43
canAttackFlyingUnits: truetrue, false
44
canAttackLandUnits: truetrue, false
45
canAttackUnderwaterUnits: falsetrue, false
46
47
[movement]movementType: NONE, LAND, AIR, WATER, HOVER, BUILDING, OVER_CLIFF, OVER_CLIFF_WATER
48
49
!For starting out, it is recommended to check out the turret and projectile sections in order to get used to basic vanilla style units, but the modding reference offers a very wide range of things to change in your units, it's encouraged to take your time and read everything
50
51
Version Section[core]
52
AddedCodeValue TypeDescriptionExample
53
#====#====Necessary Code: will cause error if these are not included
54
name:stringDefines the unit raw name, game uses it to identify as a unique name. (This is not displayed in-game)name: customTank1
55
mass:intThe 'weight' of the unit, defines how it collides with other units, a greater value means it's tougher to push.mass: 3000
56
radius:intCircular area around the unit that makes it selectable. (mouse click/screen touch)radius: 20
57
price:int / priceThe unit cost from builders/buildings. Defaults to credits if no resource type is usedprice: 500, gold=5, stone=10
58
maxHp:intThe max health for the unit. (will spawn with this value).maxHp: 200
59
#====#====Common Keys
60
buildSpeed:float / sTime it takes to build the unit. (may multiply with builder speed)buildSpeed: 3s
61
class:stringReserved for future use, must be CustomUnitMetadata by default. Is not necessary to include, has no additional functions.class: CustomUnitMetadata
62
techLevel:intDefines the Tech Level of the unit, there're 3 levels and each will appear in a different color in the GUI.techLevel: 1
63
altNames:string(s)Comma separated list of names. Like name but lower priority, useful for multiple optional mods.altNames: custTank1, customTank1, cTank1
64
1.13.3strictLevel:floatDefaults to 0. 1 = Errors if keys are duplicated. Add to "all-units.template" in root to apply to all units.strictLevel: 1
65
isBio:boolChoose whether the unit is bioligical or not, affects sound and splat (unless hideScorchMark:true)isBio: true
66
isBug:boolChanges some death defaults, and sort order in Sandbox.isBug: false
67
1.13isBuilder:boolNormally required if this unit places buildings. Defaults to [ai]useAsBuilder.isBuilder: true
68
1.15streamingCost:priceLike price but paid for overtime while this unit is being queued or built. Construction or queue is paused if resources run out while building.streamingCost: gem=420
69
1.15switchPriceWithStreamingCost:boolShortcut to set streamingCost to price value and clear price, add to all-units.template to quickly switch a mod over to streaming resources.switchPriceWithStreamingCost: true
70
#====#====Unit Stats Keys
71
selfRegenRate:floatPassive self repair rate.selfRegenRate: 0.01
72
maxShield:intThe max shield hitpoints of the unit. Can start with 0 hitpoints if startShieldAtZero:true.maxShield: 500
73
startShieldAtZero:boolUnit starts with a 0 hitpoints shield on created if true.startShieldAtZero: true
74
shieldRegen:floatPassive shield regen rate.shieldRegen: 0.15
75
energyMax:floatDefaults to 0. Energy that can be used as ammo for turrets, laser defense and actions.energyMax: 1
76
energyRegen:floatPassive energy regen rate.energyRegen: 0.001
77
energyStartingPercentage:floatSets the percentage of charged energy when the unit is first built.energyStartingPercentage: 0.5
78
energyNeedsToRechargeToFull:floatDisables weapons using energy after reaching zero till fully recharged if true.energyNeedsToRechargeToFull: true
79
energyRegenWhenRecharging:floatRegen rate while recharging.
80
1.13armour:intDamage taken away from each hit. (not currently used in any vanilla units)armour: 6
81
1.13armourMinDamageToKeep:intMin damage to keep from received damage. Defaults to 1.armourMinDamageToKeep: 2
82
1.13.3borrowResourcesWhileAlive:priceTakes these resources when created and returns them when removed or destroyed.borrowResourcesWhileAlive: gold=10
83
1.15borrowResourcesWhileBuilt:priceLike borrowResourcesWhileAlive but doesn't take affect till built. Mostly useful for buildings like houses that have negative resources to add to the unit cap, etc.borrowResourcesWhileBuilt: supplyCap = -10
84
1.13.3generation_resources:priceIncome unit creates. (custom resource version)generation_resources: credits=5, gold=20
85
1.13.3generation_active:logicBooleanDisables generation_resources/credits when false. (logic_boolean)generation_active: if not self.hp(lessThan=100)
86
generation_credits:intIncome unit creates. (credits only)generation_credits: 2
87
generation_delay:intHow often generation_resources/credits is added. Defaults to 40. (changing not recommended)generation_delay: 40
88
#====#====UI and Graphics Keys
89
showInEditor:boolSet to false to hide unit in Sandbox editor. (Defaults to true)showInEditor: false
90
displayText:LocaleStringThe unit name that the game shows to the player.displayText: Custom Tank
91
1.13displayText_{LANG}:stringLANG = ISO 639-1 Code to show this text instead when game is in this language.displayText_es: Tanque Personalizado
92
displayDescription:LocaleStringUnit description that the game shows to the player.displayDescription: -Fast movement\n-Light damage
93
1.13displayDescription_{LANG}:stringLANG = ISO 639-1 Code to show this text instead when game is in this language.displayDescription_es: -Movimiento rápido\n-Daño ligero
94
displayLocaleKey:stringTranslation file key for unit name and description.displayLocaleKey: units.mechArtillery
95
displayRadius:intDefaults to radius value. Set to show a larger or smaller selection circle UI on units.displayRadius: 20
96
uiTargetRadiusintDefaults to displayRadius value. Radius used when attacking/reclaiming/etc this unituiTargetRadius: 10
97
shieldRenderRadius:intDefaults is a little bigger than radius. Set to show a larger or smaller shield circle on units.shieldRenderRadius: 12
98
shieldDisplayOnlyDeflection:boolHide shield unless deflecting shot if true.shieldDisplayOnlyDeflection: true
99
shieldDeflectionDisplayRate:floatDefaults to 4. High value causes shield deflection to fade disappear faster.shieldDeflectionDisplayRate: 3
100
1.13.3showOnMinimap:boolDefaults to true. Hide units on minimap if false.showOnMinimap: false