Orbi Universo

Orbi Universo

Not enough ratings
Summercat's Incomplete Modding Documentation
By Summercat
My compiled documentation on modding Orbi Universo, based on studying the code and some back and forth with the devs. These notes are INCOMPLETE, and mainly contain information on Nodes.

This documentation is best used in conjunction with looking at the ModdingTemplate in the Orbi Universo files.

If you want interactive help, please join the discord chat for Orbi Universo.
2
   
Award
Favorite
Favorited
Unfavorite
Introduction
Welcome to Summercat's Incomplete Modding Documentation for Orbi Universo.

What this is: My shared personal notes I made from observing and investigating the game code, and answers I've gotten from the devs asked on Discord.

What this is not: A tutorial on how to make mods. To get an idea of how to make a mod, I would suggest subscribing to the EasyMode mod.

I am not affiliated with the Orbi Universo developers, I am just a dude who bought the game randomly and decided to spend a lot of time trying to mod it. I just decided to share my compiled notes since the documentation is a bit thin.
Nodes (States, Levers, Events)
State Attributes
IMAGE "MyMod/Image.png" Defines the location and filename of what image to be used for the icon. Defaults to using localized name if no image.

TAG <Tag> Applies chosen tag to State, used for condition checks elsewhere (Such as only having one Government tagged state or lever).

VALUE valuename [ Min Current Max ] Creates a local attribute tupple. SPACES ARE IMPORTANT [0 0 0] will not work. NodeName and NodeName.value will return attribute set to 'value'. NodeName.valuename or NodeName.valuename.value will return values.

DISPLAY_VALUE Bare command, used to display the base value ('value'). Unknown if it just shows the preceding value or only shows 'value'.

LOCAL_VAR <Count> Unknown

RELATED_INFO: Will show the defined relationships between this node and the listed others. Has three types of relationships:
  • RELATED_LOCK List nodes that are locked by it?
  • RELATED_UNLOCK List nodes that are unlocked by it?
  • RELATED_LINK List nodes that are linked to it?

TRIGGER_TRAVEL Actions to perform on (game load/start? Probably not spawning since there's there's a different thing for that), primarily used for GetPresetValue function.

LINK <Node>. Has three variations.
  • COLOR <red/green/blue/yellow/black/white> and FLUX <Speed> (Speed can be an expression or formula)
  • WEIGHT [ from/to ] ( From has arrows pointing from <Node>, to is pointing to <Node>, leave empty for no arrows)
  • WEIGHT [ min/max ] <Expression or Value> Puts value into the tooltip for the line. Can be as simple as "WEIGHT [ max ] value"

SLEEP Used every tick the node is not present (Possible, not fully confirmed for State)

TICK: Perform the listed commands every game tick. See Commands for list of commands.

TRIGGER_CUSTOM 1. Will executes the content of TRIGGER_CUSTOM of the specified index and node after the specified delay. No examples of this in Main, unknown what it does or how to use properly.
ALARM [ once/reset/multiple ] [ <TriggerIndex> <Node> ] <Expression>
ALARM_STOP [ once/reset/multiple ] [ <TriggerIndex> <Node> ]

TRIGGER_SPAWN NodeName: Perform the following commands when this node spawns.

TRIGGER_LEAVE NodeName: Perform the following commands when this node leaves.


Lever Attributes
TYPE <Cultural/Technological>, denotes color and shape of the lever. In addition, Cultural nodes can be removed by players, Technological nodes can not.

VALUE valuename [ Min Current Max ] Creates a local attribute tupple. SPACES ARE IMPORTANT [0 0 0] will not work. NodeName and NodeName.value will return attribute set to 'value'. NodeName.valuename or NodeName.valuename.value will return values.

UNLOCK_CONDITIONS sets when a Lever shows up in marketplace and when it can be bought.
  • HINT: When Lever will appear in the list to purchase. Uses Boolean operators (See above) for presence or lack of it of nodes. Use 0 if there are no Node requirements.
  • CONDITION_VALUE <OtherNode.Value> == <Amount>. Will take other Boolean equations ( >=, >, so forth)
  • CONDITION_NODE [+/-] Nodename: Will set requirement for a node to be in play (+) or not be in play(-).
  • OR Breaks up sets of conditions between an OR option. All conditions above an OR are part of the same requirement.
  • ALWAYS Ends OR options, all conditions listed after ALWAYS are required.
  • CONDITION_EXCLUDE <Tag> Excludes this lever if a Node with this tag is active.
  • CONDITION_INCLUDE <Tag> No examples of this are in Main. Possible requirement for a node with <Tag> to be present.
  • CONDITION_ERA <</>/<=/>=> <Era> Sets a requirement related to Era (see basic mod docs)
  • CONDITION_CUSTOM <Name> No example of this given. Possibly for a custom tooltip.

PRICE The cost to purchase this lever from the store and activate it.

UPGRADE The cost to adjust the lever (unknown ration of slider movement to cost). Cost can be a formula, IE $PoliticalPower = (LinkCount(EconomicCharters) + 1) * 3

SLEEP Used every tick the node is not present (Possible, not fully confirmed for Lever)

TICK: Perform the listed commands every game tick. See Commands for list of commands.

LINK See LINK section for State (It's the same)

TRIGGER_SPAWN NodeName: Perform the following commands when this node spawns.

TRIGGER_LEAVE NodeName: Perform the following commands when this node leaves.

Event Attributes
SOUND_EVENT "MyMod/Sound.wav" Defines the sound file to play when the event fires.

SOUND_WINDOW "MyMod/Sound.wav" Defines the sound file to play when opening the event window.

EVENT_DEF [ <RiseTime> <StayTime> <RestTime> <TriggerChance> ] How long the event takes to become active when it spawns, how long it stays, and cooldown (how long before it can appear again). Triggerchance is % chance it'll happen.

ARISE Any actions to take prior event taking actions (such as MilitaryPlot deleting itself if BarbariansAreAtTheGates)

SLEEP Used every tick the node is not present.

TICK Perform the listed commands every game tick. See Commands for list of commands.

LINK See LINK section for State (It's the same)

TRIGGER_EVENT Called once RestTime has been reached. Allows IF statements for calling RISE.
Commands, Flow Control, Boolean Operators, and observed functions
Commands:
SET - Primarily used for max value changes. Example: SET Node.value [ : : <expression> ]. Expression can be a static number or a formula.

PROCESS - used value changes. Example: PROCESS Node = Node + <value or expression>

RESOURCE_MAX - used to set the maximum of the resource. Example: RESOURCE_MAX $Resource = 800

REMOVE - removes listed Nodes from play

OVERRIDE_PARAM - Used to modify a lever. Will block players from being able to manipulate the lever while this is active. Uses GetParam() function and requires a PROCESS. Example:
OVERRIDE_PARAM Node.value = GetParam(Node.value) + [value or expression] PROCESS Node = Max( GetParam(Node.value), Node )

Flow Control:
IF statements can be nested, if you cannot get compound Expressions to work. Can be used in TICK or LINK.
IF <expression> Commands to perform if Expression is True ELSE Commands to perform if the Expression is False. Optional. ENDIF

ONCE_EVERY <expression> executes code once every <expression> times and is ended by ENDONCE. No examples known.
WHILE_LOOP <expression> executes code <expression> times per tick and is ended by ENDLOOP. No examples known.



Boolean Operators
~ Prefixing a Node name asks if it's active/in game. ~Node returns positive. Use ~Node == 0 for negative.
| used as an or. (~Node1 | ~Node2) returns true if either Node1 or Node2 are active.
& And. Used as a conjuction. (Node1 & Node2) returns true only if both are active.

All Functions found
LinkCount(Node) presumably returns the number of links this node has active.
PerSeconds(Value or Expression) returns the resulting value per in-game second (speed 1 is 1 game second to one real second).
Example: Node.value += PerSecond(1) Adds 1 to Node.value every in-game second.
Max([Value or Expression],[Value or Expression]) Returns the higher of the two values
Max(30,50) returns 50
Min([Value or Expression],[Value or Expression]) Returns the lower of the two values
Min(30,50) returns 30.
GetLongitude() Returns the Longitude of your preset or marker
GetLatitude() Returns the Latitude of your preset or marker
GetPresetValue(value) Returns the value set for this node by the Preset. Used in TRIGGER_TRAVEL
GameTime() Returns how many seconds of in-game time has passed. Speed 1 is one second per second.
GetCurrentEra() Returns numerical value based on the current Era, probably as defined in ERAS.
GetParam(Node.value) Used for PARAM_OVERRIDE command.
GetResourceMaximum(Resource) returns the current cap for the resource.
Advanced, and Final Notes
Cross-Mod Alteration
As we cannot overwrite items from Main (Exception, see Injections below), you will have to manipulate items from Main. This requires some extra effort.
To refer to a Node written in another file, you preface it with the file name. For example, if your mod wants to access the amount of food, you would call
Main.Food.value
Due to extra precision neccessary, you will need to explictly call the .value portion of Nodes defined in other files. If you are modding another mod and the node has multiple values, you will have to be specific, such as:
TargetMod.NodeName.valuename.value
Append - Using Multiple Files
Append is a command you can use to merge the code contents of one file into another. As an example, Main does this for Nomad and Religious nodes. Your secondary file will be set up like a mod file and must require the language section for localization.
Relevant code is:
::APPEND "Folder/Filename.txt" ModName.Nodes.[States/Levers]
This APPEND is placed at the start of States and Levers, before any local States or Levers are defined.
The code written will be seen as native to file, so you will not have to use the Cross-Mod Alteration technique as labeled above.

Injections
Injections are used by a mod to modify a node defined in another mod. Currently there are two known uses of Injections: Adding code to the start or end of a node's TICK, or adding code to the start or end of a node's TRIGGER_SPAWN.
TICK [ <Node> <begin/end> ] = { <code to be added> } TRIGGER_SPAWN <Node> [ <Node> <begin/end> ] = { <code to be added> }
Note when using code injection, the code to be injected must be written from the perspective of the target node, not your mod file; while the Injection itself still needs to be written from the perspective of your mod file. An example:
TICK [ Main.TargetNode end] = { PROCESS TargetNode += output * (MyMod.MyNode.value /100) }
Summer's Final Misc Notes

All nodes and resources need a localization in order to work.
When making a stand-alone mod (That requires the removal of Main), you will have to define Eras, or it wont work.
If the loading compass turns red, something broke. Open up the debug menu with ' (on US Keyboards) and click the arrow button at the bottom of the screen to see the log.
Pressing the Escape key while the compass is red will cause the game to reload the files from the start. This can allow you to attempt to fix any bugs that cause the game to crash on load.
You can also load the debug menu during the game to inspect nodes and check their processes. Same button to open it.
You can set multiple parameters for a Node. I think only the one called value can be displayed, and is the only one that Levers can manipulate, so it's best used for hidden data