The Action Editor: Conditions & Effects - voxraygames/worldbuilding GitHub Wiki
Table of Contents
Conditions
- Blocker
- CheckDayTimeHour
- CountItem
- CountItemInRegion
- CountItemInRegionByName
- DayTimeHour
- FaliureDescription
- ObjectState
- PlayerNearby
- RND
- RequireItem
- RequireTrigger
- RequireWorldChange
- Int 0
- False
- True
- And
- If
- Get
- Compare
Effects
- Activate
- ActivateAgain
- ActivateAgainUnlocked
- ActivateNext
- EndLevel
- EntityDespawn
- EntitySpawn
- ForceDialog
- GiveItem
- GiveXP
- InvisibleGroupSpawn
- MusicPlayLoop
- MusicPlayStinger
- MusicStopLoop
- NPCAnim
- NPCSetFriendly
- ObjectChangeModel
- ObjectExplode
- ObjectRemove
- ObjectRotate
- ObjectRotateTo
- ObjectSlide
- ObjectSwapModel
- ObjectSwapModelTo
- PlatformGoTo
- PlatformNext
- PlatformPrev
- SetDayTime
- SetFogDistance
- SoundPlay
- TeleportPlayer
- Trigger
- TriggerCancel
- TriggerDelayed
- VendorChange
- Block
- If
- Nothing
- Set
- Get
- Increment
Conditions
Blocker
- Description
Specify a condition that if true will prevent this effect from executing. - Functionality
Condition
The condition that, if true, will prevent this effect from executing.
- Use cases
- TODO
CheckDayTimeHour
- Description
Checks if the current hour has elapsed. This is preferable to checking DayTimeHour manually, since that may cause the effect to trigger many times. - Functionality
Hour
The hour to check, between 0 and 23.
- Use cases
- Giving the player XP for surviving for a day.
- Making a shop open at 9am and close at 5pm.
- Making Mr Whiff walk around the level at certain times of day.
CountItem
- Description
Counts items at given locations. - Functionality
Amount
Set how many items should be counted.Wear
Set the wear of the counted item(s).Level
Set the level of the counted item(s).Reset
Set item parameters to default.Replace Item
Select a different item to be counted.Where
Select where the item(s) should be present in order to be counted.- Inventory
Item(s) should be in the player's inventory to be counted. - World
Item(s) should be placed in the world to be counted. - Container
Item(s) should be placed in a container (i.e. dropped) to be counted. - Crafted
Item(s) should have been crafted to be counted. - Destroyed
Item(s) should have been destroyed to be counted. - Obtained
Item(s) should have been in the player's inventory (presently or otherwise) to be counted.
- Inventory
N.B. - Everything between the Reset
button and Replace Item
is item-dependent, and allows you to count only items that possess certain stats.
- Use cases
- Checking if the player has collected a crop of tomatoes.
- Checking if the player has built/destroyed a radio antenna.
- Checking if the player has ever crafted a forbidden item.
CountItemInRegion
- Description
Counts items in a given region. - Functionality
Amount
Set how many items should be counted.Wear
Set the wear of the counted item(s).Level
Set the level of the counted item(s).Reset
Set item parameters to default.Replace Item
Select a different item to be counted.RegionTag
The tag of the region the item(s) should be placed in to be counted.
N.B. - Everything between the Reset
button and Replace Item
is item-dependent, and allows you to count only items that possess certain stats.
- Use cases
- Checking if the player has placed a bed in the bedroom, and a bath in the bathroom.
- Checking if the player has destroyed Mr Whiff's car.
- Checking where, in the library, the player hid the tome of ancient knowledge.
CountItemInRegionByName
-
Description
Counts an item, by name, in a given region. Useful if you have lots of 'types' of equally valid items. -
Functionality
Name
What text should be present in the names of the item.RegionTag
The tag of the region the item should be placed in to be counted.
-
Use cases
- Checking if the player has placed any kind of chair in the dining room.
- Checking if the player has built a door in the doorway.
- Checking if the player has destroyed all of the dirt on Mr Whiff's driveway.
DayTimeHour
- Description
Prefer to use CheckDayTimeHour instead when possible. Returns the current time of day from 0 - 24.
FailureDescription
- Description
Provides additional context to the quest log.
See how FaliureDescription
tells the player what they specifically need to do (left), compared to the default quest log (right).
To add it to your condition, click the Op
button next to your current condition and select FaliureDescription
.
-
Functionality
Message
The text that will appear next to the quest objective in the quest log.
-
Use cases
- Giving the player more specific instructions in the quest log.
- Hiding the true nature of your quest from the player.
ObjectState
-
Description
Used to give custom states to an object (such as a door or chest). -
Functionality
Tag
The custom tag.
-
Use cases
- Making a door or chest require a combination lock.
PlayerNearby
-
Description
Checks for the player's distance to the NPC in blocks. Best paired with theForceDialog
effect andInitiate By
Conditions Satisfied Anywhere
to have the NPC initiate dialogue on the player's behalf. -
Functionality
Within Distance
The distance (in blocks) the player must be from the NPC.
-
Use cases
- Making an automated security system where the player trips an alarm.
- Having Mr Whiff surprise the player by leaping out from behind a bin.
RND
-
Description
Short for 'random' theRND
function generates a random number in a given range. -
Functionality
Range
The maximum value the random number could be.
-
Use cases
- Adding an element of randomness to a procedural quest.
- Making something happen at a random time of day.
RequireItem
-
Description
Checks for the presence of certain items at a given location. -
Functionality
Amount
Set how many item(s) should be counted.Wear
Set the wear of the counted item(s).Level
Set the level of the counted item(s)Reset
Set item parameters to default.Replace Item
Select a different item to be counted.Where
Select where the item(s) should be present in order to be counted.- Inventory
Item(s) should be in the player's inventory to be counted. - World
Item(s) should be placed in the world to be counted. - Container
Item(s) should be placed in a container (i.e. dropped) to be counted. - Crafted
Item(s) should have been crafted to be counted. - Destroyed
Item(s) should have been destroyed to be counted. - Obtained
Item(s) should have been in the player's inventory (presently or otherwise) to be counted.
- Inventory
Keep
Toggle whether the item should be consumed by the quest giver, or if the player is allowed to keep the quest item(s).
N.B. - Everything between the Reset
button and Replace Item
is item-dependent, and allows you to count only items that possess certain stats.
- Use cases
- Checking if the player has collected the mail from the post office.
- Checking if the player has dropped the money at the pick up location.
RequireTrigger
-
Description
Checks that a trigger has been activated a given number of times. -
Functionality
Tag
The trigger tag that should be checked for.Count
How many times should the trigger need to be activated.
-
Use cases
- Checking if the player went snooping from their hotel room in the night.
- Checking that the player has closed the gate that prevents the dog from escaping.
RequireWorldChange
-
Description
Checks that a given world change has occurred. -
Functionality
Change
The change that the condition should check for.Kill all monsters
Kill all monsters tagged with the ID of the action prior to this one (the 'setter').
-
Use cases
- Checking if the player has killed enough Oozes to be let into the 'Ooze Slayers' Club'.
- Ensuring that a hit has been successfully carried out on a given NPC.
Int 0
- Description
The default integer value assigned to certain operations. You will likely never need to select this directly.
False
- Description
An integer value set to0
. Outside of testing, you will likely never need to set this directly.
True
- Description
An integer value set to1
. Outside of testing, you will likely never need to set this directly.
And
-
Description
Used in theIf
operation to append multiple requirements. -
Functionality
Condition
The condition to be added to the initial operation. This should be swapped for custom script.
-
Use cases
- Adding a series of switched which must be activated before a door will unlock.
If
-
Description
Used to select one of two possible operations based on a 0-1 int. -
Functionality
Condition
The integer which should be checked.Then
The operation which will complete theCondition
int is equal to 1.Else
The operation which will complete theCondition
int is equal to 0.
-
Use cases
- Making a player collect either pistol bullets or rifle bullets, based on the weapon they chose earlier.
- Making a player kill either Oozes or Birds, based on whether or not they sided with the Birdwatcher's Society.
Get
-
Description
Gets a reference to a global variable (set by using the+
button under theGlobals
tab in the action editor). -
Functionality
Global
The name of the global variable which should be checked.
-
Use cases
- Getting a reference for how many quests the player has completed for the mayor.
- Getting a reference for how much money the player has spent at the gunsmith.
Compare
-
Description
Compares one global variable against another, only executing when a given equality is reached. -
Functionality
Left
The equality which should be reached for the condition to activate.Equal
Left and right are exactly the same value.NotEqual
Left and right are not of equal value.LessThan
Left is of lower value than right.LessThanOrEqual
Left is of equal or lower value than right.GreaterThan
Left is of greater value than right.GreaterThanOrEqual
Left is of equal or greater value than right.
Right
One of the global values you are comparing.Left
One of the global values you are comparing.
-
Use cases
- Seeing if the player has helped enough townsfolk to be granted an audience with the mayor.
- Seeing if the player has eaten all of the rations in the bunker.
Effects
Activate
-
Description
Used to reference a given action in your level. -
Functionality
ID
The ID of the action which should be referenced.How
How the referenced action should be affected by this operation.On
If the action has not yet been completed, it is activated. If applicable, it is added to the quest log.Off
The action is deactivated and, if applicable, is removed from the quest log.Again
Even if the action has already been completed, it is activated. If applicable, it is added to the quest log.Disable
The action is deactivated and prevented from being activated again.Silent
If the action has not yet been completed, it is activated. It is not added to the quest log.AgainSilent
Even if the action has already been completed, it is activated. It is not added to the quest log.
-
Use cases
- Establishing a multiple-choice answer to a question.
- Making the completion of a quest activate a subsequent quest.
ActivateAgain
-
Description
Used to activate an action, even if it has already been completed. -
Functionality
Silent
If true, the quest is not added to the quest log.
-
Use cases
- Making a procedural quest restart after the player completes it.
- Getting Stinky Eric to repeat quest-relevant dialogue.
ActivateAgainUnlocked
-
Description
Used to make a 'locked' item (usually a door) permanently unlock and be infinitely repeatable. -
Functionality
Silent
If true, the quest is not added to the quest log.
-
Use cases
- Making the second door of a double door also unlock, if the player unlocks one of them.
- Making a key card unlock all of the doors in an underground facility.
ActivateNext
- Description
Used to activate the next action in the list. - Functionality
How
How the referenced action should be affected by this operation. See Activate for more information.
EndLevel
- Description
Used to end the level. You can designate the subsequent level in theWORLD
tab underWorld Properties
.
EntityDespawn
-
Description
Used to despawn an entity (usually an NPC). -
Functionality
Tag
The tag of the entity to despawn.
-
Use cases
- Make a ghostly NPC disappear as they walk behind a column.
- Make finding an NPC more challenging by removing them from the map, only spawning them in when the player gets close.
EntitySpawn
-
Description
Used to spawn, or respawn, an entity (usually an NPC). -
Functionality
Tag
The tag of the entity to spawn.
-
Use cases
- Introducing the 'in-law' characters after the player completes the wedding quest.
- Spawning in Oozes only at the relevant point in the story.
ForceDialog
-
Description
Used to force the player into dialogue (usually used in conjunction withPlayerNearby
). Set theInitiate By
of said action toConditions Satisfied Anywhere
to make this work correctly -
Functionality
Dialog on/off
Toggles the activation of the operation. This should usually be set to true.
-
Use cases
- Having the player be caught by a security guard.
- Having Mr Whiff thank the player as they leave the room.
GiveItem
-
Description
Used to give the player an item. -
Functionality
Amount
Set how many items should be counted.Wear
Set the wear of the counted item(s).Level
Set the level of the counted item(s).Reset
Set item parameters to default.Replace Item
Select a different item to be counted.
N.B. - Everything between Reset
and Replace Item
is item-dependent, and allows you to count only items that possess certain stats.
- Use cases
- Paying the player for cleaning Mr Whiff's driveway.
- Having the mayor give the player the key to the city, after saving the town.
GiveXP
-
Description
Used to give the player XP points. XP points can be spent on upgrades such as increased damage or _improved carry capacity _after levelling up. -
Functionality
XP
Select the amount of XP the player should be given.
-
Use cases
- Giving the player XP after completing a quest.
InvisibleGroupSpawn
-
Description
Used to spawn a given group in the level, designated as 'invisible'. This is done in theGroup
menu in the tabFIND | Groups
. -
Functionality
- Tag
The tag of the given group.
- Tag
-
Use cases
- Changing the layout of a room behind the player's back.
- Having a wandering trader set up a tent at a certain point in the story.
MusicPlayLoop
-
Description
Plays music indefinitely - or untilMusicStopLoop
. -
Funtionality
Music
Select the music you would like to loop from this menu.
-
Use cases
- Attributing kick-ass fight music to your combat encounters.
- Giving a sombre ambience to your crypts.
MusicPlayStinger
-
Description
Plays a short sting of music. -
Funtionality
Music
Select the music you would like to play from this menu.
-
Use cases
- Playing a dramatic sting just as the detective reveals the butler did it.
- Create tension as the player snoops around the abandoned factory.
MusicStopLoop
- Description
Stops any music started byMusicPlayLoop
.
NPCAnim
-
Description
Activates an animation or movement on an NPC. -
Functionality
- Anim
Sets the animation or movement you want the NPC to perform.Walk to Marker
Makes the NPC walk to the marker with the sameAction ID
as itself.Work at Marker
Not currently in use.Happy Reaction
Not currently in use.Angry Reaction
Not currently in use.Follow Player
Makes the NPC follow the player.Stop Following Player
Makes the NPC stop following the player.Teleport to Marker
Teleports to the NPC to the marker with the sameAction ID
as itself.Lead Player to Marker
Makes the NPC 'lead' the player to the marker with the sameAction ID
as itself. This is equivalent toWalk to Marker
but the NPC will stop and wait if the player gets too far away.
QuestMarker
Overwrites theAction ID
of the quest marker the NPC should look for. Useful if you are already using the defaultAction ID
for something else.
- Anim
-
Use cases
- Having an NPC run to safety before an explosion.
- Making Mr Whiff show the player to their hotel room.
NPCSetFriendly
-
Description
Sets whether an NPC should be hostile to the player or not. -
Functionality
Tag
TheHost ID
of the given NPC.Is Friendly?
Toggle the hostility of the NPC. A true value will make the NPC friendly (as are all NPCs by default), where a false value will make the NPC attack the player on sight.
-
Use cases
- Give weight to the player deciding to side with an enemy faction. The good guys now hate you!
- Making an NPC calm down after a bout of rage.
ObjectChangeModel
-
Description
Changes a given object's model for another, and allows incremental offsets. -
Functionality
Tag
The tag of the given object. Note that this will not work on static objects, you will have to clickConvert to interactable
in the objects properties.Model
The model that the given object should change to.Offset -X
Number of blocks the new object should be moved in X space (east/west).Offset -Y
Number of blocks the new object should be moved in Y space (north/south).Offset -Z
Number of blocks the new object should be moved in Z space (up/down).Offset +X
Not currently in use.Offset +Y
Not currently in use.
-
Use cases
- Making a magician change the color of a bottle.
- Making an object deteriorate over the course of a level.
ObjectExplode
-
Description
Makes a given object explode. -
Functionality
Tag
The tag of the given object. Note that this will not work on static objects, you will have to clickConvert to interactable
in the objects properties.
-
Use cases
- Making the walls of a house explode before an Ooze invasion.
- Making a pipe explode if the player overloads the pressure.
ObjectRemove
-
Description
Deletes an object from the world. -
Functionality
Tag
The tag of the given object. Note that this will not work on static objects, you will have to clickConvert to interactable
in the objects properties.
-
Use cases
- The player gets burglarized while they are out completing a quest.
- A blockage is removed from a tunnel.
ObjectRotate
-
Description
Rotates an object up to 360 degrees in a given rotation along a given edge. For doors, useObjectRotateTo
. -
Functionality
Tag
The tag of the given object. Note that this will not work on static objects, you will have to clickConvert to interactable
in the objects properties.Hinge
Set the edge along which the object should rotate.+x
The object rotates along the positive X edge (westernmost, locally).+y
The object rotates along the positive Y edge (southernmost, locally).-x
The object rotates along the negative X edge (easternmost, locally).-y
The object rotates along the negative Y edge (northernmost, locally).
Type
Set the direction along which the object should rotate.Clockwise
The object rotates clockwise.CounterClockwise
The object rotates counter-clockwise.Push
The object rotates away from the player, based on the angle of interaction.Pull
The object rotates towards the player, based on the angle of interaction.
-
Use cases
- Making the player angle statues for a puzzle.
- Allowing the player to fiddle with valves in a pump room.
ObjectRotateTo
-
Description
Rotates an object in a given rotation along a given edge to either an 'open' or 'closed' state.Tag
The tag of the given object. Note that this will not work on static objects, you will have to clickConvert to interactable
in the objects properties.Hinge
Set the edge along which the object should rotate.+x
The object rotates along the positive X edge (right).+y
The object rotates along the positive Y edge (back).-x
The object rotates along the negative X edge (left).-y
The object rotates along the negative Y edge (forward).
Type
Set the direction along which the object should rotate.Clockwise
The object rotates clockwise.CounterClockwise
The object rotates counter-clockwise.Push
The object rotates away from the player, based on the angle of interaction.Pull
The object rotates towards the player, based on the angle of interaction.
State
An integer where0
equals closed and1
equals open.
-
Use cases
- Secret bookcases, etc.
- Making a floor panel open and close depending on the position of a nearby lever.
ObjectSlide
-
Description
Slides an object along a distance of its own length in a given direction. -
Functionality
Tag
The tag of the given object. Note that this will not work on static objects, you will have to clickConvert to interactable
in the objects properties.Type
The direction along which the object should slide.+x
The object slides in the positive X direction (right).+y
The object slides in the positive Y direction (back).+z
The object slides in the positive Z direction (up).-x
The object slides in the negative X direction (left).-y
The object slides in the negative Y direction (forward).-z
The object slides in the negative Z direction (down).
-
Use cases
- Making a haunted statue slowly edge towards something.
- Making a flag gradually raise up a flagpole.
ObjectSlideTo
-
Description
Slides an object along a distance of its own length in a given direction to either an 'open' or 'closed' state.Tag
The tag of the given object. Note that this will not work on static objects, you will have to clickConvert to interactable
in the objects properties.Type
The direction along which the object should slide.+x
The object slides in the positive X direction (right).+y
The object slides in the positive Y direction (back).+z
The object slides in the positive Z direction (up).-x
The object slides in the negative X direction (left).-y
The object slides in the negative Y direction (forward).-z
The object slides in the negative Z direction (down).
State
An integer where0
equals closed and1
equals open.
-
Use cases
- Making a secret base entrance behind two sliding boulders.
- Having a hidden lever come out from the floor.
ObjectSwapModel
- Description
Not currently in use. Please useObjectChangeModel
.
ObjectSwapModelTo
- Description
Not currently in use. Please useObjectChangeModel
.
PlatformGoTo
-
Description
Moves a platform entity to a designated quest marker index (specified with a comma-separated list in theBehaviour
box of your platform's properties). -
Functionality
Tag
The tag of the given platform entity.Index
The index of the quest marker the platform should move to. For example, if your platform'sBehaviour
box contains "qm1,qm2,qm3,qm4", setting the index to0
would move the platform to the location of qm1, whereas an index of2
would move it to the location of qm3.
-
Use cases
- Making a working lift where the player can select floors from a list of buttons.
- Creating a 'ferryman' NPC who can take the player to specific ports around your level.
PlatformNext
-
Description
If possible, moves the platform to the next quest marker (specified with a comma-separated list in theBehaviour
box of your platform's properties). -
Functionality
Tag
The tag of the given platform entity.
PlatformPrev
-
Description
If possible, moves the platform to the previous quest marker (specified with a comma-separated list in theBehaviour
box of your platform's properties). -
Functionality
Tag
The tag of the given platform entity.
SetDayTime
-
Description
Set a time of day to smoothly interpolate to, at a given speed. -
Functionality
Hour
Set the time of day 0 - 24.Advance
How quickly the day/night cycle should continue to advance after it reaches the specified time (default is 0.2).Orientation
The angle of the sun and the moon relative to your level.Transition
The speed of the transition to the new specified time (in degrees per second).
-
Use cases
- Making a useable bed that the player can sleep in to advance the time of day.
- Making your level take place over only one day, advancing the time only at certain points.
SetFogDistance
-
Description
Set the thickness of the world fog. -
Functionality
Distance
Set the distance, from the player, at which the fog should be drawn in.
-
Use cases
- Giving your graveyard some serious ambience.
- Making the fog roll in over the course of your level to signify an approaching evil.
SoundPlay
- Description
Play a sound. - Functionality
Sound
The sound to play.Volume
The volume to play the sound at, from 0 to 1.
TeleportPlayer
-
Description
Teleports the player to the quest marker with the sameAction ID
as itself. -
Functionality
QuestMarker
Overwrites theAction ID
of the quest marker the player should teleport to. Useful if you are already using the defaultAction ID
for something else.
-
Use cases
- Disorientating the player by moving them around a maze-like level.
- Having the player be "captured" by an evil wizard, who locks them in a tower.
Trigger
-
Description
Activates a trigger, usually in theTriggerHost
. Useful in advanced quest structures. -
Functionality
Action ID
The Action ID of the action that contains the trigger.
-
Use cases
- Unlocking the cell doors when the player hits the override button in the warden's office.
- Setting a mob of NPCs to attend a meeting at the town hall.
TriggerCancel
-
Description
Used to cancel an impending trigger, activated byTriggerDelayed
. -
Functionality
Action ID
The Action ID of the action that contains the trigger.
-
Use cases
- The player successfully disarmed the bomb.
- Allowing the player to step out of a lift before the doors close.
TriggerDelayed
-
Description
Used to activate a trigger after a given number of seconds. -
Functionality
Action ID
The Action ID of the action that contains the trigger.Seconds
Set the length of time the game should wait before activating the trigger.
-
Use cases
- Arming a bomb that the player must disarm or run away from.
- Giving the player a time limit to complete an obstacle course.
VendorChange
- Description
Add or change the price of an object that a vendor is selling. - Functionality
Host ID
The Host ID of the vendor to change.Item
The item to add or change.Value
The new price of the item.
Print
-
Description
Prints a message to the screen. Useful for testing. -
Functionality
Message
The text that should be printed to the screen.
Block
-
Description
A single operation which can contain a block of operations. Useful for keeping your workflow clean when making an action that contains lots of effects. -
Functionality
Nothing | Op
TheOp
button next toNothing
allows you to select an operation to be included in the block.
If
-
Description
Allows you to select one of two operations based on a true or false value. -
Functionality
Condition
The true or false value against which the operation is chosen.Nothing | Op
TheOp
button next toNothing
allows you to select an operation to be included in the statement. Note that the top operation will activate ifCondition
is true, and the bottom operation will activate if theCondition
is false.
Nothing
- Description
Does nothing until replaced by another operation. Useful if you want yourIf
statement to not have anelse
.
Set
-
Description
Used to set a global variable to a given value (set by using the+
button under theGlobals
tab in the action editor). -
Functionality
Global
The variable of which you are setting the value.Value
The new value of the global variable.
Get
-
Description
Used to get the value of a global variable (set by using the+
button under theGlobals
tab in the action editor). -
Functionality
Global
The variable of which you are getting the value of.
Increment
-
Description
Used to increment (add to) the value of a global variable (set by using the+
button under theGlobals
tab in the action editor). -
Functionality
Global
The variable of which you are incrementing.Increment
The amount you are adding to the global variable.