AutoPlacement event flows: Difference between revisions

From ZeldaMods (Breath of the Wild)
Jump to navigation Jump to search
imported>Leoetlino
No edit summary
 
(16 intermediate revisions by one other user not shown)
Line 2: Line 2:
AutoPlacement event flows are used by the [[AutoPlacementMgr]] to determine whether actors should be dynamically spawned without having to hardcode special logic into the executable.
AutoPlacement event flows are used by the [[AutoPlacementMgr]] to determine whether actors should be dynamically spawned without having to hardcode special logic into the executable.


Such event flows are executed by the same event flow engine but with a different environment: only the "AutoPlacement" pseudo-actor is available for actions and queries, and subflows do not appear to be usable{{check}}. Actions and queries are not mapped to AI system functions as with regular event flows, but are entirely handled by the AutoPlacement code.
Such event flows are executed by the same event flow engine but with a different environment: only the "AutoPlacement" pseudo-actor is available for actions and queries. Actions and queries are not mapped to AI system functions as with regular event flows, but are entirely handled by the AutoPlacement code.


== AutoPlacement actions ==
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.
=== CreateData ===
=== NearCreate ===
=== AppearWeatherRate ===
=== EquipCategory ===


== AutoPlacement queries ==
==AutoPlacement actions==
=== GroundNorm ===
===CreateData===
=== GroundMat ===
Allow the actor to spawn.
=== TreeRate ===
{| class="wikitable"
=== PosHeight ===
!Parameter!!Type!!Description
=== WaterDepth ===
|-
=== RouteDistance ===
|MinNum||int||The smallest amount that should be generated of this actor.
=== GrassHeight ===
|-
=== WaterSurface ===
|OffsetPosY||float
=== PlayerRideHorse ===
|
=== EcoAreaActorName ===
|-
=== WaterSubMat ===
|RideList||string
=== CheckGameData ===
|
=== CheckPouchItemCount ===
|-
=== CheckPouchItemCountFromActor ===
|MaxNum||int||The biggest amount that should be generated of this actor.
=== TimeType ===
|-
=== RailDistance ===
|GroupRadius||float
=== WaterDistance ===
|Allows to configure the size of the auto-picked point where the actor(s) should spawn.
=== NavMeshFace ===
|-
|EquipWeaponActorCount||int
|
|-
|Mimicry||bool||
|}
 
 
===NearCreate===
===AppearWeatherRate===
===EquipCategory===
 
==AutoPlacement queries==
===GroundNorm===
===GroundMat===
Checks the terrain material type.
 
Returns:
 
*0: Soil
*1: Stone
*2: Rock
*3: Sand
*4: Metal
*5: Grass
*6: Ivy
*7: Wood
*8: Water
*9: Snow
*10: Ice
*11: Lava
*12: HeavySand
*13: Bog
*14: HeavySnow
 
===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.
 
{| class="wikitable"
!Parameter!!Type!!Description
|-
|Rate||float||Rate
|}
 
===PosHeight===
===WaterDepth===
===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.
 
{| class="wikitable"
!Parameter!!Type!!Description
|-
|Distance||float||Distance to compare against route distance
|}
 
===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.
 
{| class="wikitable"
!Parameter!!Type!!Description
|-
|Height||float||Grass height
|}
 
===WaterSurface===
===PlayerRideHorse===
Returns 1 if the player is riding a horse, and 0 otherwise.
 
===EcoAreaActorName===
Returns 1 if the specified actor name matches the name of the actor for which the event flow is being executed.
 
{| class="wikitable"
!Parameter!!Type!!Description
|-
|ActorName||str||Actor name
|}
 
===WaterSubMat===
Returns the water sub-material type at the current position:
 
*0: Water
*1: Water_Ice
*2: Water_Hot
*3: Water_Poison
 
===CheckGameData===
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.
 
{| class="wikitable"
!Parameter!!Type!!Description
|-
|Label||str||GameData boolean flag name
|}
 
===CheckPouchItemCount===
===CheckPouchItemCountFromActor===
===TimeType===
Returns the [[WorldMgr]]'s current time division. Analogous to [[AIDef:Query/CheckTimeType]].
 
===RailDistance===
??? Involves [[PlacementMgr]].
 
===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.
 
{| class="wikitable"
!Parameter!!Type!!Description
|-
|Distance||float||Distance to compare against water distance
|}
 
===NavMeshFace===


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

Latest revision as of 13:45, 9 January 2021

AutoPlacement event flows are used by the AutoPlacementMgr to determine whether actors should be dynamically spawned without having to hardcode special logic into the executable.

Such event flows are executed by the same event flow engine but with a different environment: only the "AutoPlacement" pseudo-actor is available for actions and queries. Actions and queries are not mapped to AI system functions as with regular event flows, but are entirely handled by the AutoPlacement code.

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

CreateData

Allow the actor to spawn.

Parameter Type Description
MinNum int The smallest amount that should be generated of this actor.
OffsetPosY float
RideList string
MaxNum int The biggest amount that should be generated of this actor.
GroupRadius float Allows to configure the size of the auto-picked point where the actor(s) should spawn.
EquipWeaponActorCount int
Mimicry bool


NearCreate

AppearWeatherRate

EquipCategory

AutoPlacement queries

GroundNorm

GroundMat

Checks the terrain material type.

Returns:

  • 0: Soil
  • 1: Stone
  • 2: Rock
  • 3: Sand
  • 4: Metal
  • 5: Grass
  • 6: Ivy
  • 7: Wood
  • 8: Water
  • 9: Snow
  • 10: Ice
  • 11: Lava
  • 12: HeavySand
  • 13: Bog
  • 14: HeavySnow

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.

Parameter Type Description
Rate float Rate

PosHeight

WaterDepth

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.

Parameter Type Description
Distance float Distance to compare against route distance

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.

Parameter Type Description
Height float Grass height

WaterSurface

PlayerRideHorse

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

EcoAreaActorName

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

Parameter Type Description
ActorName str Actor name

WaterSubMat

Returns the water sub-material type at the current position:

  • 0: Water
  • 1: Water_Ice
  • 2: Water_Hot
  • 3: Water_Poison

CheckGameData

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.

Parameter Type Description
Label str GameData boolean flag name

CheckPouchItemCount

CheckPouchItemCountFromActor

TimeType

Returns the WorldMgr's current time division. Analogous to AIDef:Query/CheckTimeType.

RailDistance

??? Involves PlacementMgr.

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.

Parameter Type Description
Distance float Distance to compare against water distance

NavMeshFace