Converting Flowgraphs
From Blue Mars Developer Guidebook
|
|
Contents |
Overview
Flowgraphs can easily be translated to Lua - see Minigame Basics to get started. For the most part, each flow node corresponds to a Lua function call or Lua expression. The output of a node corresponds to a function or expression return value, and the input of a node corresponds to a parameter of a function.
This section lists a correspondence between flowgraph nodes and Lua functions and expressions, by flow node category.
See the CryMod flow node reference for detailed descriptions of the flow nodes.
AI
- AIAwareness
- AIAlertness
- AlertnessFilter
- AIEnable
- AIIgnore
- ActionStart
- ActionEnd
- ActionAbort
- AIAttTArget
- AISmartObjectHelper
- AIGroupAlertness
- AIMergeGroups
- AIGroupBeacon
- AIGroupID
- AIGroupCount
- SmartObjectEvent
- PerceptionScale
- ChangeParameter
- AISetNavCostFactor
- AutoDisable
- AIEnableShape
- EventListener
- AIExecute
- Call AI.Signal with ACT_EXECUTE. See AI.
- AISignal
- AISetState
- AIModifyStates
- AIGoto
- Call AI.Signal with ACT_GOTO. See AI.
- AIGotoSpeedStance
- Call AI.SetStance and AI.Signal with ACT_GOTO. See AI.
- AILookAtPoint
- AILookAt
- AIStance
- Call AI.SetStance
- AISpeed
- DebugAISpeed
- AIAnim
- Call AI.Signal with ACT_ANIM. See AI.
- AIAnimEx
- Call AI.Signal with ACT_ANIMEX. See AI.
- AIFollow
- Call AI.Signal with ACT_FOLLOW. See AI.
- AIFollowPath
- Call AI.Signal with ACT_FOLLOWPATH. See AI.
- AIFollowPathSpeedStance
- Call AI.SetStance and AI.Signal with ACT_FOLLOWPATH. See AI.
- AIFormation
- AIFormationJoin
- Call AI.Signal with ACT_JOINFORMATION. See AI.
- AISetCharacter
- AIGrabObject
- Call AI.Signal with ACT_GRABOBJECT. See AI.
- AIDropObject
- Call AI.Signal with ACT_DROPOBJECT. See AI.
- AIWeaponDraw
- Call AI.Signal with ACT_WEAPONDRAW. See AI.
- AIWeaponHolster
- Call AI.Signal with ACT_WEAPONHOLSTER. See AI.
- AIShootAt
- Call AI.Signal with ACT_AIMAT or ACT_SHOOTAT. See AI.
- AIUseObject
- Call AI.Signal with ACT_USEOBJECT. See AI.
- AIWeaponSelect
- Call AI.Signal with ACT_WEAPONSELECT. See AI.
- AIAlertMe
AnimatedCharacter
- ColliderMode
Animations
- PlaySequence
- Call PlaySequence in Movie
- PlayCGA
- Call StartAnimationAR in Entity
- PlayAnimation
- Call StartAnimationAR in Entity
- StopAnimation
- Call StopAnimation in Entity
- LookAt
- Call SetLookIK in Entity
- NoAiming
- SynchronizeTwoAnimations
- TriggerOnKeyTime
- AttachmentControl
- AnimGraphReset
- not applicable to Blue Mars
- AnimGraphWatchOutput
- not applicable to Blue Mars
- AnimGraphCheckOutput
- not applicable to Blue Mars
- AnimGraphControl
- not applicable to Blue Mars
- AnimGraphSetInput
- not applicable to Blue Mars
- AnimGraphLockInput
- not applicable to Blue Mars
Camera
See Cameras for corresponding Lua functions.
- Camera
- CameraYPR
- ViewShake
Crysis
Not applicable to Blue Mars
- HunterShootTarget
- HunterBeamSweep
Entity
- EntityPos
- call SetWorldPos, SetWorldAngles, SetWorldScale in Entity
- GetPos
- call GetWorldPos, GetWorldAngles, GetWorldScale in Entity
- BroadcastEvent
- EntityId
- reference the Entity id field
- example - self.id
- EntityInfo
- call GetName(), GetArchetype() in Entity
- ParentId
- call GetParent in Entity to obtain the parent, and access the Entity id field in the parent
- example - self:GetParent().id
- SetProperty
- set the entity script property in the Properties table
- GetProperty
- get the entity script property in the Properties table
- Material
- call SetMaterial in Entity
- MaterialLayer
- call EnableMaterialLayer in Entity
- AttachChild
- call AttachChild in Entity
- DetachThis
- call DetachThis in Entity
- GetPlayer
- not useful in Blue Mars
- BeamEntity
- call SetWorldPos, SetWorldAngles, SetWorldScale in Entity
- RenderParams
- no equivalent Lua function currently available
- MaterialParam
- call GetMaterialParam or SetMaterialParam in Entity
- MaterialClone
- call CloneMaterial in Entity
- CharAttachmentMaterialParam
- VideoPlayer
- video textures are not supported, use Flash material control in Entity
- FlashInvoke
- call Entity MaterialFlashInvoke function
- EntitiesInRange
- call Entity GetDistance function
Environment
- Lighting
- MoonDirection
- ComputeLighting
Game
- LocalPlayer
- DamageActor
- ActorGrabObject
- ActorGetHealth
- ActorSetHealth
- ActorCheckHealth
- GameObjectEvent
- EntityInterest
HUD
- HUDDebugDisplay
- call Draw2DLabel in HUD
- DisplayInstructionMessage
- DisplayInfoMessage
- DisplayDebugMessage
- DisplayTimedDebugMessage
Image
Use the System screen effects functions.
- ColorCorrection
- FilterBlur
- FilterRadialBlur
- FilterSharpen
- ChromaShift
- EffectFrost
- FilterGrain
- EffectCondesnation
- EffectWaterDroplets
- EffectWaterFlow
- EffectBloodSplats
- DepthOfField
- VolumetricScattering
- DirectionalBlur
- AlienInterference
- RainDrops
- DistantRain
Input
- Key(Enable, Disable, Key, NonDevMode)
- see ActionMap Manager and HUD action functions
- ActionFilter()
- use ActionMap Manager functions
Interpol
- Int
- Float
- Vec3
- Color
Inventory
No applicable in Blue Mars.
- AddItem
- RemoveItem
- RemoveAllItems
- HasItem
- HasAmmo
- HolsterItem
- SelectItem
- ItemSelected
- AddAmmo
- SetAmmo
- SetAmmoEx
- RemoveAllAmmo
- AddEquipPack
- StorePlayerInventory
- RestorePlayerInventory
Log
- LogInput
- call System LogAlways function
- CSVDumper
- Plot
Logic
- AND
- use Lua && operator
- OR
- use Lua || operator
- XOR
- use Lua ^ operator
- NOT
- use Lua ! operator
- OnChange
- Any
- Blocker
- All
- RandomSelect
- RandomTrigger
- Once
- Gate
- Indexer
- Multiplexer
- DeMultiplexer
- Condition
- use Lua if/then
Math
See Introduction to Lua for a summary of Lua math operators and CryEngine Lua Utilities for more math functions provided with CryEngine.
- Add
- Use Lua + operator
- Sub
- Use Lua - operator
- Mul
- Use Lua * operator
- Div
- Use Lua / operator
- Equal
- Use Lua == operator
- Less
- Use Lua < operator
- Counter
- Use a Lua integer variable
- PortCounter
- Use a Lua integer variable and/or a set of variable flags
- Remainder
- Use the Lua % operator
- Select2
- Evaluate x%2 and branch on the result
- Reciprocal
- Evaluate 1/x
- Random
- call randomF in CryEngine Lua Utilities
- Power
- use Lua ^ operator
- Sqrt
- use the Lua function math.sqrt
- Abs
- use the Lua function math.abs
- Clamp
- call clamp in CryEngine Lua Utilities
- SinCos
- use math.sin or math.cos
- AnglesToDir
- call anglesToVec in CryEngine Lua Utilities
- DirToAngles
- call vecToAngles in CryEngine Lua Utilities
- SetNumber
- ToBoolean
- return true or false depending on input
- FromBoolean
- branch using a boolean (i.e use if)
- UpDownCounter
- increment/decrement an integer variable
- SetColor
- Noise1D
- Noise3D
Mission
These flow nodes are not applicable to Blue Mars, but they are here for completeness.
- ModifyToken
- SetGameToken
- call SetToken in Game Tokens
- GetGameToken
- call GetToken in Game Tokens
- CheckGameToken
- GameToken
- call SetToken in Game Tokens
- EndLevelNew
- call CryAction.ScheduleEndLevel()
- this is provided for demo purposes, e.g. if you have a minigame on a test level and you want to proceed onto another level
- should not be included in a delivered minigame
Movement
- MoveTo
- use Entity functions like SetWorldPos and SetVelocity in the Update callback, calculate velocity using CryEngine Lua Utilities
- RotateTo
- use SetWorldAngles in the Entity
- MoveEntityTo
- use Entity functions like SetWorldPos and SetVelocity in the Update callback, calculate velocity using CryEngine Lua Utilities
- RotateEntity
- use SetWorldAngles in the Entity Update callback
- RotateEntityTo
- use SetWorldAngles in the Entity Update callback
Physics
- ActionImpulse
- call AddImpulse in Entity
- Dynamics
- call Physics functions in Entity
- Raycast
- call RayWorldIntersection in Physics
- PhysicsEnable
- call EnablePhysics in Entity
String
- SetString
- assign a string to a variable
- Compare
- use Lua == operator
Stats
- Memory
- Frame
Sound
- PlaySound
- call PlaySound in Entity
- PlaySoundEvent
- call PlaySoundEvent in Entity
- SFXVolume
- Use System functions to set the console variable s_GameSFXVolume
- MusicVolume
- Use System functions to set the console variable s_GameMusicVolume
- SoundMood
- Use RegisterSoundMood in Sound
- MusicLogicControl
- Dialog
System
- ConsoleVariable
- use System Console Lua functions
- SaveGame
- not applicable
Time
- Delay
- use timer functions in Entity
- RandomDelay
- use timer functions in Entity
- Timer
- use timer functions in Entity
- RealTime
- use time functions in System
- TimeOfDay
- MeasureTime
- TimeOfDayTrigger
- ServerTime
Trigonometry
- Sinus
- use math.cos and DEG2RAD or math.rad to convert input from degrees to radians
- Cosinus
- use math.cos and DEG2RAD math.rad to convert input from degrees to radians
- Tangens
- use math.tan and DEG2RAD math.rad to convert input from degrees to radians
Vec3
- AddVec3
- call SumVectors in CryEngine Lua Utilities
- SubVec3
- call DifferenceVectors in CryEngine Lua Utilities
- MulVec3
- call ProductVectors in CryEngine Lua Utilities
- CrossVec3
- call crossproduct3d in CryEngine Lua Utilities
- DotVec3
- call dotproduct3d in CryEngine Lua Utilities
- NormalizeVec3
- call NormalizeVector in CryEngine Lua Utilities
- ScaleVec3
- call ScaleVector in CryEngine Lua Utilities
- EqualVec3
- compare the components of each vector using ==
- MagnitudeVec3
- call LengthVector in CryEngine Lua Utilities
- ToVec3
- construct a vector according to the format described in CryEngine Lua Utilities
- FromVec3
- refer to the x,y,z fields of a vector according to the format described in CryEngine Lua Utilities
- ReciprocalVec3
- evaluate 1/LengthVector(x)
- ClampVec3
- evaluate clamp on each vector component
- SetVec3
Vehicle
- Enter
- Call AI.Signal with ACT_ENTERVEHICLE. See AI.
- Exit
- Call AI.Signal with ACT_EXITVEHICLE. See AI.
- Unload
Weapon
Weapon flow nodes are not applicable to Blue Mars, but are listed here for completeness.
- AutoSightWeapon
- FireWeapon
- WeaponListener
- ChangeAmmo
