/
Types
Types
Overview
The Firmament engine makes use of config files. Through these files values are passed to control the behaviors of various entities int the application. In order to reduce the amount of code hacking the engine provides default behaviors and some extra features to provide more flexibility.
Config
There are several types supported. In additional to the supported type there are some dynamic converters
Basic
- Float - supports dynamic converters
- 0.0
- Int - supports dynamic converters
- 0
- Vector
- { "x" : <Float>, "y" : <Float> }
- [ <Float>, <Float> ]
- String
- Array
- Dynamic
Dynamic Converters
- Min/Max
- { "*min*" : <Int|Float>, "*max*" : <Int:Float> }
- Random
Randomly picks a value from an array- { "*random*" : [ <Int|Float>, <Int|Float> ... ] }
- Weighted
Picks a weighted value from a array of "weight : value" pairs – weights are entered as strings{ "*weighted*" : [ { <Int> : <Int|Float> } , <Int> : <Int|Float> } ... ] }
Examples
A looping timer component that randomly picks a delay between 1.5 and 2.4
{ "componentName": "loopingTimer" , "seconds": {"*min*":1.5,"*max*":2.4} , "trigger": "createPlatform" },
Set properties component that positions an entity at two different weighted points
{ "componentName":"setProperties" , "properties" : { "positionY" : { "*weighted*" : [ {"10" : -2.0}, {"12" : 1.5 } ] }, } , "listen": "createPlatform" , "trigger": "emit" }
An emitter that picks a random value from an array to chose the number of entities to emit
{ "componentName":"entityEmitter" , "listen":"click" , "amount":{"*random*": [ 3, 4, 6, 8, 10, 15 ] } , "entity":"pool:Rock1Shard1" , "angleOffset":"random" , "distanceOffset":.5 , "speed":5 }
, multiple selections available,