AutoPlacement event flows: Difference between revisions

m
imported>Leoetlino
(subflows are handled in exactly the same way -- the only difference is that all subflows have to be in a single event flow file. (no multi file loading since that is something the Event Manager does))
 
Line 6: Line 6:
A single event flow can be used to handle conditions for several actors (for example, AutoPlacement_Animal handles auto placement logic for all animal actors) and may be called several times, each time with a different actor name, which the event flow can check with the [[#EcoAreaActorName]] query. An actor will only be dynamically spawned if CreateData (and NearCreate?{{check}}) is called.
A single event flow can be used to handle conditions for several actors (for example, AutoPlacement_Animal handles auto placement logic for all animal actors) and may be called several times, each time with a different actor name, which the event flow can check with the [[#EcoAreaActorName]] query. An actor will only be dynamically spawned if CreateData (and NearCreate?{{check}}) is called.


== AutoPlacement actions ==
==AutoPlacement actions==
=== CreateData ===
===CreateData===
Allow the actor to spawn.
Allow the actor to spawn.
{|class="wikitable"
{| class="wikitable"
! Parameter !! Type !! Description
!Parameter!!Type!!Description
|-
|-
| MinNum || int ||
|MinNum||int||The smallest amount that should be generated of this actor.
|-
|-
| OffsetPosY || ||
|OffsetPosY||float
|
|-
|-
| RideList || ||
|RideList||string
|
|-
|-
| MaxNum || int ||
|MaxNum||int||The biggest amount that should be generated of this actor.
|-
|-
| GroupRadius || ||
|GroupRadius||float
|Allows to configure the size of the auto-picked point where the actor(s) should spawn.
|-
|-
| EquipWeaponActorCount || ||
|EquipWeaponActorCount||int
|
|-
|-
| Mimicry || bool ||
|Mimicry||bool||
|}
|}


=== NearCreate ===
=== AppearWeatherRate ===
=== EquipCategory ===


== AutoPlacement queries ==
===NearCreate===
=== GroundNorm ===
===AppearWeatherRate===
=== GroundMat ===
===EquipCategory===
 
==AutoPlacement queries==
===GroundNorm===
===GroundMat===
Checks the terrain material type.
Checks the terrain material type.


Returns:
Returns:
*0: Soil
*0: Soil
*1: Stone
*1: Stone
Line 53: Line 59:
*14: HeavySnow
*14: HeavySnow


=== TreeRate ===
===TreeRate===
Queries [[StatisticsMgr]] for the forest_density at the current position. Returns 1 if the specified rate is lower than or equal to the result, and 0 otherwise.
Queries [[StatisticsMgr]] for the forest_density at the current position. Returns 1 if the specified rate is lower than or equal to the result, and 0 otherwise.


{|class="wikitable"
{| class="wikitable"
! Parameter !! Type !! Description
!Parameter!!Type!!Description
|-
|-
| Rate || float || Rate
|Rate||float||Rate
|}
|}


=== PosHeight ===
===PosHeight===
=== WaterDepth ===
===WaterDepth===
=== RouteDistance ===
===RouteDistance===
Queries [[StatisticsMgr]] for the route distance at the current position. Returns 1 if the specified distance is lower than or equal to the query result, and 0 otherwise.
Queries [[StatisticsMgr]] for the route distance at the current position. Returns 1 if the specified distance is lower than or equal to the query result, and 0 otherwise.


{|class="wikitable"
{| class="wikitable"
! Parameter !! Type !! Description
!Parameter!!Type!!Description
|-
|-
| Distance || float || Distance to compare against route distance
|Distance||float||Distance to compare against route distance
|}
|}


=== GrassHeight ===
===GrassHeight===
Queries the [[Terrain]] system for the grass height at the current position. Returns 1 if the specified height is lower than or equal to the actual height, and 0 otherwise.
Queries the [[Terrain]] system for the grass height at the current position. Returns 1 if the specified height is lower than or equal to the actual height, and 0 otherwise.


{|class="wikitable"
{| class="wikitable"
! Parameter !! Type !! Description
!Parameter!!Type!!Description
|-
|-
| Height || float || Grass height
|Height||float||Grass height
|}
|}


=== WaterSurface ===
===WaterSurface===
=== PlayerRideHorse ===
===PlayerRideHorse===
Returns 1 if the player is riding a horse, and 0 otherwise.
Returns 1 if the player is riding a horse, and 0 otherwise.


=== EcoAreaActorName ===
===EcoAreaActorName===
Returns 1 if the specified actor name matches the name of the actor for which the event flow is being executed.
Returns 1 if the specified actor name matches the name of the actor for which the event flow is being executed.


{|class="wikitable"
{| class="wikitable"
! Parameter !! Type !! Description
!Parameter!!Type!!Description
|-
|-
| ActorName || str || Actor name
|ActorName||str||Actor name
|}
|}


=== WaterSubMat ===
===WaterSubMat===
Returns the water sub-material type at the current position:
Returns the water sub-material type at the current position:
*0: Water
*0: Water
*1: Water_Ice
*1: Water_Ice
Line 102: Line 109:
*3: Water_Poison
*3: Water_Poison


=== CheckGameData ===
===CheckGameData===
Returns 1 if the specified boolean flag is true, and 0 otherwise.
Returns 1 if the specified boolean flag is true, and 0 otherwise.


Returns -1 if the GameDataMgr instance does not exist or if the Label parameter was not specified.
Returns -1 if the GameDataMgr instance does not exist or if the Label parameter was not specified.


{|class="wikitable"
{| class="wikitable"
! Parameter !! Type !! Description
!Parameter!!Type!!Description
|-
|-
| Label || str || GameData boolean flag name
|Label||str||GameData boolean flag name
|}
|}


=== CheckPouchItemCount ===
===CheckPouchItemCount===
=== CheckPouchItemCountFromActor ===
===CheckPouchItemCountFromActor===
=== TimeType ===
===TimeType===
Returns the [[WorldMgr]]'s current time division. Analogous to [[AIDef:Query/CheckTimeType]].
Returns the [[WorldMgr]]'s current time division. Analogous to [[AIDef:Query/CheckTimeType]].


=== RailDistance ===
===RailDistance===
??? Involves [[PlacementMgr]].
??? Involves [[PlacementMgr]].


=== WaterDistance ===
===WaterDistance===
Queries [[StatisticsMgr]] for the water distance at the current position. Returns 1 if the specified distance is lower than or equal to the result multiplied by 200.0, and 0 otherwise.
Queries [[StatisticsMgr]] for the water distance at the current position. Returns 1 if the specified distance is lower than or equal to the result multiplied by 200.0, and 0 otherwise.


{|class="wikitable"
{| class="wikitable"
! Parameter !! Type !! Description
!Parameter!!Type!!Description
|-
|-
| Distance || float || Distance to compare against water distance
|Distance||float||Distance to compare against water distance
|}
|}


=== NavMeshFace ===
===NavMeshFace===


[[Category:Internals]]
[[Category:Internals]]
19

edits