Manual:Modding Guide

Introduction
This guide was built off a fork of the modding guide created by WillFlame.

This article will show you the steps you need to take before you can start modding, and also the steps you can take after you are done modding to pack and publish your mod. The moddable files are written in XML (for characteristics) and Lua (for logic). You will need a text editor like Notepad++ or Visual Studio Code. Only UTF-8 encoding is supported, other encodings are likely to cause crashes. An XML table editor will also be helpful for modifying item/character data.

All file paths listed in the guide, unless otherwise specified, are the defaults for Windows.

This page contains information on specific files in the Data folder, useful tutorials, known issues and frequently asked questions.

Please feel free to add and expand this page with any bits of code that you find interesting or useful. For code excerpts, please use the "Insert Code Block" function of the wiki and set it to the correct language (Lua, XML, etc.).

Frequently Asked Questions
''' If you have a question that’s not on here, feel free to suggest it or ask in the #modding channel on the Discord! '''

1. My mods aren’t being installed. / I can’t see the mods in the menu.
If you are installing local mods Are the files in StreamingAssets/Mods? Have you pressed the ‘Install Mods’ button? Did you wait for it to say “Install Complete!”? Have you checked the log for any errors? If you are installing workshop mods Have you subscribed to them? Have you restarted the game after subscribing to them? Have you checked the checkbox? Have you pressed the ‘Install Mods’ button? Did you wait for it to say “Install Complete!”? Have you checked the log for any errors?

2. I’m getting an error “No mods found” when I try to update my mod.
Make sure that you understand and have followed all the steps in “Creating A Mod”. Specifically, that you are subscribed to your mod, and an updated version of it is in StreamingAssets/Mods with the same folder name as the workshop mod. If that still doesn’t work, try restarting your game.

3. I’ve made a lot of changes to the vanilla files and don’t remember them all. How can I get back the vanilla files without any of my changes?
If you own One Step From Eden on Steam, right-click the game’s title in the sidebar and click “Properties”. Under the Local Files tab, click “Verify Integrity of Game Files”. You may need to click this twice if the first click does not end with “All files successfully validated”.

4. My mod has successfully installed, but it’s not doing what it’s supposed to be doing. / My mod causes the game to crash.
If you know that what you’re doing is possible, then it’s very likely that there’s an error occurring while executing the code in your mod. The easiest way to check for errors is by using the output log. Any errors that show up in the output log will often provide a good clue as to where the problematic code is. You can also insert logging statements that will show up in the output log. See the Debugging section in Tutorials for more information.

5. How can I overwrite existing effects animations? (ex.: remove Fragile/Trinity character overlays)
??

Location of Workshop Items:
C:\Program Files (x86)\Steam\steamapps\workshop\content\960690\

They will show up in the Mods menu, along with basic information and options to upvote/downvote, favourite, unsubscribe and activate. Checking the rightmost tick box and pressing “Install Mods” will load the mod into the game for the current session. To uninstall them, simply close and re-open the game.

Location of base game files:
C:\Program Files (x86)\Steam\steamapps\common\One Step From Eden\OSFE_Data\StreamingAssets\Data

This folder contains the files used in the vanilla state of the game. These files can be modified in order to change vanilla behaviors (e.g. Saffron’s starting spells, the rarity of Bow Snipe), or can be viewed as examples to write new mods. Some sample mods can be found in the ExampleMods folder one level up.

Creating a Mod
Entering the Mods menu in-game and clicking “Create Mod” will create a mod with a mostly blank template and upload it to the Steam Workshop. The mod is set to private by default.

All of your mods (including newly created mods) will be located locally in:

C:\Program Files (x86)\Steam\steamapps\common\One Step From Eden\OSFE_Data\StreamingAssets\Mods

If this is your first time interacting with the Mods menu, you may also need to create a new folder in the StreamingAssets directory called “Mods” if it doesn’t exist. The StreamingAssets/Mods folder is where local mods that have not gone through Steam Workshop are loaded. If you want to test a mod (whether it is yours or not) without needing to upload it to the Workshop first, this is the place to put it. Pressing “Install Mods” will install ALL mods contained in this folder as well as any selected Workshop mods in the mod menu. Mods in this folder will not show up in the mod list; they are for local testing only. Note that mods in this folder will not be updated to the Workshop after pressing “Update Mod”. They must be moved into the workshop folder first (explained below).

To update your mod in Steam Workshop, you must first be subscribed to it to gain local access. Note the mod’s id number, shown at the end of the URL of its Workshop page. Then simply navigate to the folder in which it is contained.

C:\Program Files (x86)\Steam\steamapps\workshop\content\960690\ Your mod should now show up in the mod list. Toggling the check mark and pressing “Install Mods” has the same effect as installing the mod locally from the Mods folder in StreamingAssets. In essence, this folder could be used instead of the local Mods folder as both of them behave the same with regards to installing.

Clicking “Update Mod” will upload the files contained in this folder to Steam Workshop, allowing other users to download them. If you have been using the local Mods folder, simply copy/paste those files into this folder before updating. Note that only users under Contributors of the mod are able to update them.

Guidelines for Mod Folders
The WorkshopItemInfo.xml file contains metadata for the mod, like the path to the mod’s icon. A new picture can be moved into the folder and the path changed.

Whether writing new content or overwriting vanilla content, XML files must use the name of an existing file in order to be parsed by the game’s reader (e.g. Artifacts.xml). Lua files do not have this restriction.

Data Files
Note that while XML fields do permit some equations to be entered only addition and multiplication are supported. This permits the ability for you to modify values more precisely.

Descriptions
Formatting in descriptions can be achieved using Unity rich text tags, with the angle brackets escaped. In addition, some special strings are formatted in specific ways. (

Example: “ef.Flames” in the description will be formatted as “Flames” in orange.)

Artifacts.lua
This file contains lua functions for some artifact effects (basic increase atk dmg, defense, etc). Useful functions and attributes can be found under ArtifactObject in Other Information below.

Artifacts.xml
This file contains every single artifact in the game, as well as their features. The lists of triggers, effects, targets. etc can be found in Other Information (add hyperlink/jump to section once made).


 * itemID: the name of the artifact used within the game’s code
 * Name: the name displayed in game
 * App: applications of the artifact
 * trigger: condition for the artifact to take effect
 * effect: result of artifact activation
 * target: being that is being affected
 * amount: level of effect applied can also be CurrentMana
 * triggeramount: for triggers with “Below”
 * duration: time the effect lasts for, in seconds
 * Tags: metadata used by the game to determine sorting
 * Base: small pool that always shows up during rewards (the leftmost artifact)
 * Cpu: not in the player’s drop pool, but in enemies’ random pool
 * Starting: will never appear naturally; must be given through a loadout
 * NoDuplicate: will never appear again after it has been selected
 * Solo: prevents two copies from appearing during co-op
 * Negative: never appears as a reward (i.e. from chests) [Meta tag, doesn’t do anything]
 * Gem: categorizes gem artifacts [Meta tag, doesn’t do anything]

Battles.xml
Provides locations and prefabs of enemy spawns.

Effects.lua
This file contains the Lua functions for many of the effects called by Artifacts.xml. These can be modified or used as examples to create new effects.

Enemies.xml
This file contains all the enemies in the game. Note that an enemy’s attack pattern is determined by the spell with the beingID of the enemy.

Spells can be added to an enemy’s deck in order to allow for multiple attacks. Enemies will randomly select cards from its deck to cast.

Animations and sounds are determined in the Stats category. Instructions for creating custom animations can be found in Other Information below.

Most actions performed by bosses are hardcoded; changing fields such as their MovPattern will likely have no effect.


 * beingID: Name of the enemy used within the game's code
 * Name: The name displayed in-game at the top right
 * Health: Starting HP
 * Experience: EXP that the enemy gives upon beating them
 * Money: Money that the enemy gives upon beating them
 * MovePattern: Pattern in which the enemy moves.
 * MovementDelay: Base time between movement instances.
 * StartDelay: ???
 * LoopDelay: Base time between spell uses.
 * Defense: Defense value of the enemy.
 * Lerptime: Movement speed between tiles. Lower value = faster movement.
 * Stagger: ???
 * Deck: Deck from which random spells are pulled. For bosses, rotations are hard-coded.
 * Stats: Other character-related information
 * localGunPointPos: The location where spells are fired from[confirmation needed]
 * animName: Name of the file that contains animations (no extension)
 * chargeAnim: Whether to use a charge animation
 * dieSound: SFX that plays upon death
 * lethality: Chance for boss to spare if player dies. Higher value = lower chance
 * Shadow: Set to “false” to disable shadow effect under the enemy.

Note: Some stats of existing characters cannot be modified, such as HP. The game will revert these values back to their originals upon starting the map.

Heroes.xml
This file stores the playable characters and their stats/base kits.

beingID: the name of the character used within the game’s code

Name: the name displayed in game (must be the same as character name for new loadout) (Must be exactly the same as beingID for new characters, or else the character description will not show.)

Title (optional): The name of the loadout. This allows to have multiple loadouts under one name

Tags:


 * metadata (e.g. Campaign, Selicy)


 * Including the Default tag causes the character to appear as a new selectable character.


 * Including the Campaign tag causes the character to appear on the Singleplayer char select screen (as a loadout).
 * Including the Unlock tag causes the character to be unlocked immediately.
 * Description: a short description of the character (can be seen on character select)
 * Flavor: additional information (can be seen on character select)

Weapon: the spell that is cast as the basic attack (the E key with keyboard controls)

Health: starting health

MaxHealth: maximum health

Money: starting money

MaxMana: maximum mana at start

BasicCooldown: delay between casts of basic attack, in seconds

ManaRegen: starting mana regen

ShuffleTime: time to shuffle at start, in seconds

InvulLength: time after getting hit in which no additional damage is taken, in seconds

Defense: defense at start

Lerptime: movement speed

Deck: Spells listed with this will be in the starting deck

Stats: other character-related information

localGunPointPos: The location where spells are fired from[confirmation needed]

animName: Name of the file that contains the basic animations (no extension)

altAnims: Animations for alternate costumes

splashSprite: The name of the file that contains the large sprite that appears in character select and the pause menu (no extension)

startingBrands: Brands that are focused automatically

shadow: Set to “false” to disable shadow effect

Enemies.xml

Lib.lua This file contains basic functions (e.g. delay (waitforseconds), placing statuses, grabbing targets) that are used by other Lua files.

Structures.xml This file contains “other” entities like rocks, volcanoes, blast crystals, as well as all the boss assists.

Spells.lua This file contains lua functions for spells (multishot, mortar, reaper, etc). Most spells use Multishot or Mortar with different parameters, but some have their own custom implementation. All enemy actions are implemented here as spells

WorkshopItemInfo.xml This file contains the information relevant to the Steam Workshop.

PublishedFileId: the id of the mod Name: the name that is displayed on the workshop Description: the description IconFileName: the name of the image to be displayed as the icon (include extension) Tags: tags that will show up in search results[citation needed]

Zones.xml This file contains information about what enemies spawn in what areas.

World: A set of battles with a specific theme and boss fight num: Internal number used to identify the world name: The name of the world (shows up during transitions and in the world counter) tags: Pool: Adds the world to the list of worlds it can pick from during a run CharName: eg Violette, Selicy, etc  Is removed from the pool if it matches the tags of the character selected (note: this actually checks for any shared tags between character and world not just specifically this one) background: Image used as the background (no extension) icon: Image used as the small diamond-shaped image during transitions transition: Type of easing used between worlds FlowerThree, Meteor, Trees, Throne-corridor Stage: A battle in a world num: Internal number used to identify the stage Starting a new world always starts at stage 0, or the lowest numbered stage If there are less than 7 stages, the stages will repeat Set: A combination of enemies/structures that can show up A fixed seed will always pick the same set every time Having only one set in a world means all seeds will use that set

Custom Animations
Custom animations can be implemented by creating an XML file named XXXAnimInfo.xml, following the XML format below: Looping can be set to “true” or “false” depending on whether you want the animation to repeat or not. Setting frameDuration to a value less than 30 may cause problems.

A full list of animations can be found in Other Information (ADD JUMP TO SECTION).

Unlocking Custom Characters
By default, all new characters and their alternate costumes will be locked. To unlock them without any prior requirements, simply give them their being in Heroes.xml the Unlock tag. Unlocking alternate costumes does not seem to work at the moment, but beating the game with the custom character will unlock them as usual.

Debugging
If you want to understand what’s going on in the Lua code, printing out certain values to the console can help. print(string value) will print to a file named output_log.txt,

Windows Filepath: C:\Users\%USERNAME%\AppData\LocalLow\Ristaccia LLC\One Step From Eden\ouput_log.txt

Mac Filepath: ~/Library/Logs/Unity/Player.log

Spell Icons
The size for the icon is 160x160, with a transparent outer border that makes it 256x256. The outer border can be used to make the icon pop out of the border, by including two images, one with “Over” at the end.

Example  (NEED TO GET IMAGES) 

“RagnarokOver”.png                             “Ragnarok.png”

Known Issues
Workarounds are listed in subpoints.

1. Custom Lua effects cannot be called due to them not being added to the global dictionary.

 * Install one of these mods which lets you call custom effects
 * More Powerful Lua https://steamcommunity.com/sharedfiles/filedetails/?id=2066319533
 * Enable Custom Lua Effects https://steamcommunity.com/sharedfiles/filedetails/?id=2063268758


 * Note that custom Lua spells already work if you use the  field

2. Alternate costumes for custom characters cannot be unlocked with the Unlock tag.[confirmation needed]

 * Beat the game with the custom character to unlock the costume.

3. Zones.xml must overwrite the vanilla file, breaking mod compatibility.

 * Manually merge the two conflicting Zones.xml files together. Remember to back up your original Zones.xml!


 * No longer true as of 1.4? (NEED TO CONFIRM)

4. Subtraction and division cannot be used in XML.

 * Write the equations in a lua function instead

Data Types and Game Classes
NOTE: Not everything here may work as expected. This is also not necessarily an exhaustive list— it instead documents the most useful features of each class. Please leave a comment on anything that seems wrong so other people know about it.

AmountType
Can be used in XML to replace any numbers.

e.g. MaxMana or Frost

Normal (default), BrokenTiles, ConsumedSpells, CrackedTiles, CurrentCardtridges, CurrentMana, Damage, OriginDamage, ParentDamage, DamageDealtThisBattle, Flames, FlowSelf, FragileSelf, Frost, Infinite, JamsCastThisBattle, JamsInDeck, LastDamageAmount, LastTrueDamageAmount, HP, HitHP, ManaCost, ManaRegen, MaxHP, MaxMana, MissingHP, TargetMissingHP, Money, OtherSlotDamage, OtherSlotManaCost, Poison, Shield, ShieldPreCast, ParentShots, SpellPower, SpellsCastBattle, Structures, WeaponDamage, Zero

Animations
Each animation must be prefixed with “_” (e.g. Saffron_idle) to be registered by the game. (ADD AS TABLE)

airborne airLand assist back cast01Channel cast01End cast01Mid cast01Start cast02End cast02Mid cast02Start cast03End cast03Mid cast03Start channel charge clear dashing death down downed drop flinch front hit hop idle pet raise release shield slash01 slash02 slash03 slash04 spawn specialEnd specialStart taunt throw throw02

The different cast animations are optional and activate when multiple spells are casted at once.

For movement, ‘hop’ is when moving upwards and ‘drop’ is when moving downwards.

ArtifactObject Class
Inherits ItemObject

ArtifactObjects in general possesses all attributes that are present in Artifacts.xml.

Attributes

depleted: BooleanDepleting/Activating Artifacts

To deplete an Artifact you could use the Deplete effect after a Trigger in the Artifacts.xml, or set the boolean in Lua via artifactObject.depleted = true

To activate the artifact again simply do artifactObject.depleted = false and the artifact is active again.

BC (Battle Control) Class
void ActivateEvilHostages

void AddObstacle(Being theBeing)

float GetAmount(AmountApp amtApp, float inputAmt, SpellObject spellObj = null, ArtifactObject artObj = null) Cpu GetEnemy(int enemyIndex) void PlaceStatusNoDuration(ItemObject item, Status status)

void PlaceStatusWithDuration(ItemObject item, Status status)

void setSerif [Makes the entire field traversable by both players and enemies]

void RemoveObstacle(Being theBeing)

Attributes
CurrentPlayer: Player

deCtrl: DeckCtrl

idCtrl: IDCtrl

lastKilledEnemy: Being

lastKilledStructure: Being

mainCtrl: MainCtrl

runCtrl: RunCtrl

currentDeadBeings: List

currentPlayers: List

Default qualities (modifiable[confirmation needed])
float hasteAmount = 0.05

float slowAmount = 0.2

float fragileMultiplier = 1.5

int frostDmg = 150

float frostLength = 99999

int flameDmg = 10

int flameTicks = 14

float flameTickTime = 0.4f

float poisonMinimum = 0.0f

float shieldDecay = 0.25f

float playerChronoScale = 1f

int noHitMoneyBonus = 5

int pvpRequiredWins = 2

{baseBossTier: int}, {blockAllSummons: bool}, {experienceGained: int}, {moneyGained: int}, {numBattles: int}, {numBattlesLeft: int}, {perfectBattle: bool}, {poisonColor: Color}

 NOTE : In PvP, currentPlayer will always return P2. Use target.player instead. In co-op, spell.ctrl.currentPlayer returns the player that cast the spell. You can refer to P1/P2 directly with currentPlayers[1]/currentPlayers[2] but currentPlayers seems to return a player, whether or not that player exists. Use #currentPlayers to verify the current number of them.

Being Class
(inherited by Boss, Enemy, Player, Pet, Structure)

void AddInvince(float duration)

void AddStatus (string statusTypeString, float amount = 0.0f, float duration = 0.0f)

void AddTimerBar (float closeTime = 1f)

void Damage(int amount, bool pierceDefense = false, bool pierceShield = false, bool pierceInvince = false, ItemObject itemObj = null)

void Heal(int amount)

int FacingDirection

int getAmount(Status status)

StatusEffect GetStatusEffect(string statusName)

bool HasParameter (string paramName)

bool isEnemy

void RemoveAllStatuses

void RemoveStatus (string statusName)

void SetInvince (float duration)

Attributes
artObjs: List

baseLoopDelay: float

battleGrid: BattleGrid

beingObj: BeingObject

currentPets: List

deCtrl: DeckCtrl

deathrattles: List

health: Health

healthBeforeHit: int

invinceTime: float

lastDamageAmount: int

lastHitBy: Being

lastSpellHit: SpellObject

lastTargeted: Being

lastTargetHit: Being

lastTargetHitTile: Tile

pet: bool

player: Player

spellAppObj: SpellObject

theSpellCast: SpellObject runCtrl: RunCtrl

{damageDealtThisBattle: int}, {dead: bool}, {inDeathSequence: bool},

{gracePeriodDuration: float} -> Time period of invincibility after getting hit (not applied if Being is on component.flame)

{lastGracePeriod: float} -> last time Being got hit

NOTE: For currentPets, index starts at 0 not 1 even while in Lua.

BeingObject Attributes
{artifacts: List }, {basicCooldown: float}, {clearDelay: float}, {clearSpells: List}, {deathDelay: float}, {deathrattles: List }, {deck: List }, {defense: int}, {description: string}, {efApps: List}, {experience: int}, {flavor: string}, {health: int}, {hiDeck: List }, {invulLength: float}, {lerpTime: float}, {loDeck: List}, {loopDelay: float}, {manaRegen: float}, {maxHealthBase: int}, {maxHealthCurrent: int}, {maxMana: int}, {medDeck: List }, {money: int}, {movementDelay: float}, {movementPattern: MovPattern}, {movements: int}, {mustDestroy: bool}, {nameString: string}, {rewardList: List }, {shuffleTime: float}, {spellPower: float}, {stagger: bool}, {startDelay: float}, {startingBrands: List}, {startups: List }, {tags: List}, {timeouts:    List }, {title: string}, {type: BeingType}, {weapon: string}

BeingType
Ally, Enemy, Hero, None, Fairy, Structure

BGCrl (Background Control) Class
void ChangeBG (string bgName) void MoveBG (int amount = 150)

{changeBG: bool}, {greenScreen: Image}, {moveBG: bool}, {parallaxScales: List<Float>}, {paraPoint: Vector3}, {paraTarget: Vector3}, {prevParaPoint: Vector3}, {smoothing: float}, {transitionDuration: float}

Brands
None, Anima, Convergence, Doublelift, Glimmer, Hearth, Hexawan, Kinesys, Miseri, Phalanx, Slashfik

Checks
None, AmountOver, Fragile, NotFragile, HasStatusFromThis, HitHPOver, HitHPUnder, Hostage, HPUnder, HPOver, DamageOver, Flow, NotFlow, Enemy, EnemyOrHostage, EnemyOrStructure, ManaCostOver, ManaCostUnder, Neutral, Never, NoMinion, NotDrone, NotWeaponOrDrone, PlayerWasHit, PlayerWasNotHit, ShieldUnder, SpellID, StatusOver, StatusUnder, TouchedTileNotBroken, TrinityCast, NotTrinityCast, LastSpell

Directions
None, Up, Right, Down, Left, UpRight, UpLeft, DownRight, DownLeft, Forward, UpForward, DownForward, Backward, UpBackward, DownBackward

Effects
AddDefaultEnemyArt, AddToDeck, AddToDeckFront, AddToDiscard, AlterCard, Anchor, AtkDmgBattle, Backfire, BaseBossTier, Channel, Chrono, Consume, DamageStatus, DefenseBattle, Devour, DisableManualShuffle, DoubleCast, Eject, EvilHostages, FlowStack, Flame, Fragile, FragileChange, Frost, Haste, Heal, HealBattle, Jam, Link, Luck, LuckPermanent, Mana, ManaRegenBattle, MaxHPChangeBattle, MaxManaBattle, Money, MoneyBattle, Move, NextShuffleTime, ParentOnHit, Pet, PierceShield, PlaySound, Poison, PoisonSetMinimum, PoisonMultiplyDuration, PowerUp, PowerUpPerm, Redeck, Reflect, Removal, RemoveBuff, RemoveStatus, Root, Shield, ShieldDecayChange, ShieldDefense, ShieldExte, ShieldSet, Shuffle, ShuffleTimeBattle, Slow, SpellPowerBattle, Summon, Teleport, TileBreak, TileCrack, TileFix, Trinity, Upgrader, Wrap, CastSpell, CreateSpell, CastVisual, HPSet, MaxHPChange, MaxHPSet, Damage, DamageTrue, Deplete, EquipWep, Hit, HitTrue, HoverTile, Invincible, FlowSet, TriggerFlow, AtkDmg, Defense, ManaRegen, MaxMana, SpellPower, ShuffleTime

Item Attributes
{being: Being}, {brand:Brand}, {ctrl: BC}, {itemName: string}, {itemType: ItemType}, {rarity: int}, {spellObj: SpellObject}

ItemObject Class
void Print(string message)

{being: Being}, {brand: Brand}, {ctrl: BC}, {currentApp: EffectApp}, {deCtrl: DeckCtrl}, {description: string}, {flavour: string}, {generatedSpell: SpellObject}, {item: Item}, {nameString: string}, {rarity: int}, {shortName: string}, {spellObj: SpellObject}, {tagStrings: string[]}, {type: ItemType}

Item Types
Art, Item, Pact, Spell, Wep

Locations
Above, Base, BaseZero, Behind, BehindAll, Beings, BotLeftTopRight, BotLeftTopRightTwo, BotLeftTopRightSquares, BrokenTiles, CrackedTiles, Current, CurrentPlayer, End, Enemies, Flame, Front, FrontAll, FrontEven, FurthestEnemy, HalfField, Index, LastKilledEnemy, LastKilledStructure, LastHitBy, LastHitByOther, LastSpawned, LastTargetHit, LastTileTouched, LastTileTouchedParent, NearestEnemy, NearestOther, Owner, ParentSpellTargetHit, Player, PlayerBotLeft, PlayerBotRight, PlayerTopLeft, PlayerTopRight, Poisoned, RandAllied, RandAlliedUnique, RandEnemy, RandEnemyUnique, RandOther, RandOtherUnique, RandPlayerUnique, RandUnique, Rand, Ring, Saved, SpellTargetHit, SpiralCounterClockwise, Square, Structures, Tile, SweeperColumnBotRight, SweeperColumnFront, SweeperColumnTopLeft

MovPatterns (Movement Patterns)
None, JumpToPlayerEndField, JumpRandomEndFront, PatrolRandomEmpty, MoveToRandom, TeleportRandom, TeleportRandomEndFront, TeleportVerticalToPlayer, randomPatrolRandomEmptyHorizontal, PatrolRandomEmptyVertical, PatrolRandomEmptyVerticalToPlayer, DashRandomEmptyToPlayerRow, PlayerHalfField, Clockwise, CClockwise, Forward, Up, Down, Back, CClockwiseOtherEdges, BounceGrid, Diamond, ToPlayer, Ricochet, ZigZag

Patterns
All, Allied, ExcludeLastTargetHit, ExcludeSelf, InverseLocal, Occupied, PrioritizeOccupied, Unoccupied, PrioritizeUnoccupied, PrioritizeMoveable, Moveable, Random, Reverse, Unbroken

Player Functions/Attributes
(often called from target.player or item.being.player, inherits Being) void BattleReset [appears to just reset your mana to starting mana] void CastSpell(int slotNum, int manaCostOverride = 999, bool consume = false) void Move(int x, int y) void OnHit  [causes screenshake, activates OnHit artifacts]

{atkDmg: int}, {basicCooldown: float}, {basicCooldownTime: float}, {castSound: AudioClip}, {currentMana: float}, {downed: bool}, {equippedWep: SpellObject}, {lastSpellText: GameObject}, {manaRegen: float}, {maxMana: int}, {spellPower: int}, {spellsCastBattle: int}, {startingMana: float}

Shapes
Default, Above, AboveBelow, Adjacent, Behind, BehindAll, Below, Bot, Box, Cross, CrossAnti, CrossFull, CrossMed, CrossSmall, Column, ColumnAnti, ColumnSmall, ColumnTwo, ColumnWide, Cone, ConeDouble, DiagonalBotLeft, DiagonalTopLeft, DiagonalTopRight, Even, Front, FrontAll, Horizontal, HorizontalAnti, HorizontalTwo, HorizontalWide, O, OBig, OBigger, RhythmCross, RightWing, Row, RowSmall, RowWide, Square, Top, X, XSmall, ZBig

SpellObject Functions/Attributes
(inherits ItemObject) void addStatusApp (Status status) SpellObject Clone bool hasParam (string paramName) void Log(string value) void StartCast void RegisterSpellAction(string luaFunctionName)

It is preferable to modify spell attributes in XML instead of Lua so the values are easier to locate. Making changes to a spell in the Lua causes those changes to be saved permanently. It is advised to only use the below attributes to read the current values of a spell.

{anchor: bool}, {arcType: ArcType}, {bending: int}, {blastDuration: float}, {castDelay: float}, {castDuration: float}, {castShieldAmount: int}, {castSlotNum: int}, {channel: bool}, {consume: bool}, {cooldown: float}, {damage: int}, {damageType: DamageType}, {dashDistance: int}, {dashHeight: int}, {destroyOnHit: bool}, {flow: bool}, {hitAllies: bool}, {hitBeing: Being}, {hitboxHeight: int}, {hitboxOffset: Vector2}, {hitboxWidth: int}, {hitEnemies: bool}, {hitSelf: bool}, {hitStructures: bool}, {hitTile: Tile}, {interrupt: bool}, {mana: int}, {numShots: int}, {numTiles: int}, {recoveryTime: float}, {shotDelay: float}, {shotDuration: float}, {shotVelocity: float}, {spawnOffset: Vector2}, {spell: Spell}, {tempDamage: int}, {timeBetweenShots: float}, {timeToTravel: float}, {touchedTile: Tile}, {trinityCast: bool}, {warningDuration: float}, {yVariance: float}

States
Attacking, Channeling, Idle, Moving, Stunnednegative

Statuses
Normal, AtkDmg, Defense, Flow, Fragile, Frost, Haste, Link, ManaRegen, MaxMana, Poison, Regen, Reflect, Root, Shield, ShieldExte, Slow, SpellPower, Stun, Trinity, Blessed, Resurrect, Chrono

Tags (for spells)
Attack, Base, Boss, Broken, Demo, Live, Gem, Buff, LoopMutation, Challenge, Drone, Reward, Heal, Hell, BonusRe, BonusSK, BonusNG, Negative, NoDoublecast, NoDuplicate, NoFlex, NoFlow, NoShield, NoShieldPlus, NoStrafe, NoPierce, Flower, Player, Cpu, PvP, Miniboss, Unlock, Weapon, SaffronBoss, SkipTest, Solo, Starting, Ally, Distress, Fairy, Hazard, Hostage, NotStructure, Structure, Treasure, DarkTreasure, Test, Campaign, Default, Gunner, Hazel, Reva, Saffron, Selicy, Shiso, Terra, Violette, Shopkeeper, Skin, Forest, Fire, Ice, Ruins, Eden, Ending, Pool

Targets
Default, All, Allies, Enemies, Hit, It, LastSpawned, LastTargeted, LastTargetedGlobal, Owner, Player, RandomEnemy, Self

TextTypes
Affects the colour of floating text.

None, Damage, Heal, Shield

Tile Types
None, Normal, Cracked, Broken, Spiked, Empowered, Flooded

Triggers
None, Flow, Execute, Frantic, Hold, OnCast, OnHit, TrinityCast, TouchTile, AfterAllyHit, AfterAnyHit, AfterEnemyHit, AfterPlayerHit, AfterStructureHit, AfterTakeHit, OnAllyHit, OnAnyHit, OnBattleStart, OnBattleEnd, OnClear, OnConsume, OnDeath, OnTakeDmg, OnFlow, OnEnemyHit, OnEnemyKill, OnEnemySpawn, OnEquip, OnFlameHit, OnFrost, OnFrostStack, OnHostageKilled, OnHostageSaved, OnJam, OnJamCast, OnLandHit, OnMove, OnPlayerDeath, OnPlayerHit, OnPlayerMove, OnPlayerSpellCast, OnPoison, OnPoisonDmg, OnRemoveSpell, OnReshuffle, OnReshuffleEnd, OnRewards, OnSpellCast, OnStructureHit, OnTake, OnStructureKill, OnSummon, OnTakeHit, OnTileBreak, OnTrinityCast, OnUpgradeSpell, OnWeaponCast, OnWeaponHit, StatChange, While, WhileBattle, WhileIdle, OnHPBelow, OnManaBelow, WhileHPBelow, WhileManaBelow, WhileShieldBelow

= Other Information =


 * Flame lasts for 14 ticks, one tick is 0.4 seconds.


 * Weapon Names
 * Saffron: CampaignGun, ChronoGun, GodGun
 * Reva: CampaignReflector
 * Hazel: UpgradeWrench, DismantleWrench
 * Gunner: GunnerGun, GunnerMachine
 * Selicy: SelicyFrostStep, SelicyStep
 * Terra: Terraform, Terraflare
 * Shiso: ShisoGun, KunaiCatch
 * Violette: ViGun, ViCharge
 * Shopkeeper: ShopkeeperGun


 * ZoneTypes
 * Battle
 * Boss
 * Miniboss
 * Campsite
 * Danger
 * DarkShop
 * Distress,
 * Random,
 * Shop,
 * Treasure,
 * World,
 * Pacifist,
 * Normal,
 * Genocide,
 * Idle,
 * PvP

Useful Functions and Effects
A library of useful code to make things happen in your mod. Also see Manual:Modding Notes and Information for more useful code items.

Feel free to expand with anything you find that others might want to use. Please use the "Insert Code Block" function of the wiki and set it to the correct language (Lua, XML, etc.)

Base Game Functions and Effects
These are functions and calls you can use in your mod without any additional add-on mods.


 *  Adding a card to the player's deck that doesn't go away after a fight ends (Credit to Lea on the OSFE Discord): 


 *  Removing a card from the player's deck (Credit to Lea on the OSFE Discord): 

The card will still be usable until the fight ends or the next fight starts, so you have to give a self removing spell consume so it can only ever be used once. Remove the "return" if you want to remove all copies of a spell from the deck instead of just 1.


 *  Cast a spell by name through Lua: 


 *  Custom Voice Bubble Text: 

Functions and Effects that require More Powerful Lua
Items listed below will not work without the More Powerful Lua library mod created by Golden Epsilon.