It is recommended to have read learning how to use emevd before using this reference.

This list is highly incomplete. You can help by expanding it. Also note that this reference does not include the different wordings for commands in MattScript since DarkScript 3 will tell you the alternative usages if you type in the name of a command listed here.

List of Commands


AwardItemLot

AwardItemLot(int itemLotId)

Summary

Causes the player to instantly receive the item lot associated with itemLotId (receiving the item lot may not involve receiving an item if the items in the lot have a random chance of dropping).

Parameter name Type Description
itemLotId int Specifies the ID of the item lot to receive.

AwardItemsIncludingClients

AwardItemsIncludingClients(int itemLotId)

Summary

Causes all players (hosts, phantoms, and invaders) to receive the specified item lot associated with the itemLotId. In order to make certain types of players not receive the item, you will need to end the event early by checking their Character Type with IfCharacterType.

Parameter name Type Description
itemLotId int Specifies the ID of the item lot to receive.

EndUnconditionally

EndUnconditionally(enum<EventEndType> executionEndType)

Summary

Immediately ends the event while passing in an EventEndType instruction that can either completely end the event or restart it. Commonly used to make events that loop whenever they complete.

Parameter name Type Description
executionEndType EventEndType Specifies whether to end the event normally or restart it from the beginning.

EzstateInstructionRequest

EzstateInstructionRequest(int entityId, int command, byte slot)

Summary

Makes a certain chrESD command (known as GetCommandIDFromEvent(byte slot) in Zeditor) return the value of the command parameter for the ESD running on the entity with the given enitityId parameter.

Parameter name Type Description
entityId int Specifies the entity whose instance of their ESD script will receive the message.
command int Specifies the value which the ESD command GetCommandIDFromEvent(byte slot) will return.
slot byte Specifies the event slot which the command message will be sent to. GetCommandIDFromEvent(byte slot) must check the same slot as this command sends to in order to receive the message (using its slot parameter).

HellkiteBreathControl

HellkiteBreathControl(int characterEntityId, int objectEntityId, int characterAnimationId)

Summary

Controls the height and length that the fire breath of the Hellkite drake covers. Essentially it sets the Y-level of where the ground fire appears to be the Y-level of the object with objectEntityId, and modulates the distance of the attack based on the animation used and the distance between the Hellkite and the object. The total amount of vfx spawned by the attack stays the same regardless of distance, making it look more condensed the closer the object is. There is still a smaller hurtbox for the fire breathing attacks that extends from the Hellkite's mouth that isn't effected by this command. Using this command will summon the proper fire breath attack even if the Hellkite isn't attacking, but it seems that it cannot summon the fire from any character other than the Hellkite. These were all impressions I got but I didn't test the command thoroughly enough and didn't have a great understanding of the systems at the time, take with a grain of salt.

Parameter name Type Description
characterEntityId int Specifies the enitityID of the Hellkite drake. Using an entity that is not the Hellkite appears to make this command do nothing.
objectEntityId int Specifies the entity ID of the object (a blank object in the vanilla game) which controls the floor and length of the Hellkite's fire breath. See the description for more details.
characterAnimationId int Specifies the animation ID associated with which breath attack is being used. My testing seems to indicate that it's hardcoded which ID spawns what kind of breath. For instance 3000 will spawn the long range breath and 3010 will spawn the breath that is shot directly downwards. These all line up with the animations of the Hellkite.

IfCharacterHasSpEffect

IfCharacterHasSpEffect((enum<ConditionGroup> resultConditionGroup, int targetEntityId, int spEffectId, bool shouldHave)

Summary

Returns true to resultConditionGroup if the character (player or NPC/enemy) with the targetEntityId has (or if shouldHave = False, doesn't have) the specified Special Effect active on it.

Parameter name Type Description
resultConditionGroup ConditionGroup Specifies which condition group to store the returned value of this command.
targetEntityId int Specifies the ID of the character to check for the special effect.
spEffectId int The ID of the special effect from the SpEffectParam table which you want to check for.
shouldHave bool true will make the command return true if the character has the effect; false will make it return true if they do not have it.

IfEventFlag

IfEventFlag(enum<ConditionGroup> resultConditionGroup, enum<ONOFFCHANGE> desiredFlagState, enum<TargetEventType> targetEventFlagType, int targetEventFlagId)

Summary

Returns true to resultConditionGroup when the event flag state of the flag with ID of targetEventFlagId matches the desiredFlagState.

Parameter name Type Description
resultConditionGroup ConditionGroup Specifies which condition group to store the returned value of this command.
desiredFlagState ONOFFCHANGE Specifies which flag state will result in true or false being passed to the resultConditionGroup. In the case of CHANGE being specified, it will pass true only if the flag has gone from ON to OFF or OFF to ON this frame.
targetEventFlagType TargetEventType Changes how targetEventFlagId is read. If it is EventFlag, it will read it as the ID for any flag. If it is EventID, it will read the flag which matches the current event's ID (in which case simply type "0" for targetEventFlagId). If it is EventIDAndSlotNumber it will read the flag which matches the current event's ID + the slot number that the event was started in (in which case simply type "0" for targetEventFlagId).
targetEventFlagId int Specifies the ID of the flag to change if targetEventFlagType is EventFlag.

IfObjectHitBy

IfObjectHitBy(enum<ConditionGroup> resultConditionGroup, int targetEntityId, int attackerEntityId)

Summary

Returns true to resultConditionGroup the moment that the specified object is hit by any form of attack from the specified attacker. Note that the attack can be non-damaging and still cause this command to return true (such as from any kind of roll, or poison mist).

Parameter name Type Description
resultConditionGroup ConditionGroup Specifies which condition group to store the returned value of this command.
targetEntityId int Specifies the ID of the object which the command will monitor for incoming attacks.
attackerEntityId int Specifies the ID of the entity which can trigger this command by using an attack on the target. Entering -1 seems to allow any entity's attack to trigger the command.

IfPlayerAttackingOnHit

IfPlayerAttackingOnHit(enum<ConditionGroup> resultConditionGroup, int hitboxEntityId)

Summary

Somewhat of a misnomer. Returns true to resultConditionGroup when the player is sprinting while standing on a piece of map collision with the ID of hitboxEntityId. The command only checks one piece of collision with the given hitboxEntityId, so it will fail if you try to give multiple collisions the same entity ID and try to check all of them at once.

Parameter name Type Description
resultConditionGroup ConditionGroup Specifies which condition group to store the returned value of this command.
hitboxEntityId int Specifies the Entity ID of the collision which must be stood on while sprinting.

IfPlayersCovenant

IfPlayersCovenant(enum<ConditionGroup> resultConditionGroup, byte covenantIndex)

Summary

Returns true to resultConditionGroup if the current covenant of the player matches the index of covenantIndex.

Parameter name Type Description
resultConditionGroup ConditionGroup Specifies which condition group to store the returned value of this command.
covenantIndex int Specifies the covenant which you want to check whether the player has. 0 = no covenant, 1 = Way of White, 2 = Princess Guard, 3 = Warrior of Sunlight, 4 = Darkwraith, 5 = Path of the Dragon, 6 = Gravelord Servant, 7 = Forest Hunter, 8 = Blade of the Dark Moon, 9 = Chaos Servant, 10-15 = Unused vow types.

IncrementEventValue

IncrementEventValue(int baseEventFlagId, uint numberOfUsedFlagBits, uint maximumAllowedValue)

Summary

Increments the event value stored in the inclusive flag range of [baseEventFlagId, baseEventFlagId + numberOfUsedFlagBits - 1] by 1. Before the command increments the flag value it will read it and only increment if the value is less than or equal to maximumAllowedValue.

Parameter name Type Description
baseEventFlagId int Specifies the starting flag to the value from.
numberOfUsedFlagBits uint Specifies the range of flags in use after and including baseEventFlag. Event value is read using the binary ON/OFF state of the flags in this range.
maximumAllowedValue uint Before the command increments the flag value it will read it and only increment if the value is less than or equal to maximumAllowedValue.

InitializeEvent

InitializeEvent(int eventSlotId, uint eventId, uint parameters)

Summary

Starts the event with the ID specified in eventId. This is required to make any event run. Once the event's completes an EventEndedFlag will be set, which is equal to the eventId + eventSlotId. After you specify the eventId parameter you can then specify several uint parameters to be passed into the event. If the event doesn't use any parameters then 0 should be specified.

Parameter name Type Description
eventSlotId int Specifies the slot to use for the event. Usually used in order to tell the difference between different instances of the same event. Will offset the result of the EventEndedFlag.
eventId uint Specifies the ID of the event that will be initialized.
parameters uint Specifies multiple parameters to be passed into the event. In vanilla the maximum amount of parameters entered seems to be 4, while the minimum is always 1 (which can be of value 0 if not being used).

IssueShortWarpRequest

IssueShortWarpRequest(int entityId, enum<TargetEntityType> warpType, int warpDestinationEntityId, int dummypolyId)

Summary

Warps a character (including the player) to a given point on the same map the character is already in. Does not specify a collision to copy Draw Groups from, which means that the character could potentially not be drawn when it is warped since they will keep their original draw parent. Very useful as a shorthand to the other Warp commands since you do not need to specify a map collision to copy Draw Groups from or a character to copy from.

Parameter name Type Description
entityId int Specifies the ID of the character that is getting warped.
warpType enum<TargetEntityType> Specifies the type of entity that the character is being warped to, which can be either an object, area (i.e. a point), or another character.
warpDestinationEntityId int The ID of the destination that is being warped to.
dummypolyId int The dummypoly to warp the character to. Only applicable if the TargetEntityType is an object or a character (use -1 if warping to an area).

PlaySE

PlaySE(int entityId, enum<SoundType> soundType, int soundId)

Summary

Plays a one shot sound effect originating at the location of the entity with entityId. Sounds cannot be played unless they are loaded in to the current map by being in either one of the main or smain .fsb's, or the .fsb that corresponds to the map the sound is playing in.

Parameter name Type Description
entityId int The entity (always a character in the vanilla game) to play the sound effect from. If the sound is set as being 2D in the FMod project settings, the location of the entity it plays from will not matter and will there will be no volume rolloff.
soundType SoundType An enum that specifies the prefix for the sound ID to play. The first letter of the enumerated type is the letter which is the prefix. For instance, SoundType.aEnvironmentalSound has the prefix "a", cCharacterMotion has "c", and so on.
soundId int The ID of the sound you wish to play. This ID is the numbers after the prefix, so s123456789 has ID "123456789".

SetEventFlag

SetEventFlag(int eventFlagId, enum<ONOFF> flagState)

Summary

Changes the ON/OFF state of the specified event flag to flagState.

Parameter name Type Description
eventFlagId int Specifies which event flag is being changed.
flagState ONOFF Sets eventFlagId's state to either ON or OFF (1 or 0).

SetSpEffect

SetSpEffect(int entityId, int spEffectId)

Summary

Instantly tries to apply a Special Effect to an entity specified by the entity ID.

Parameter name Type Description
entityId int Specifies which entity in the map will receive the Special Effect.
spEffectId int Specifies the ID of the Special Effect to apply from the Special Effect params table.

SkipIfConditionGroupStateCompiled

SkipIfConditionGroupStateCompiled(byte numberOfSkippedLines, enum<ConditionState> desiredConditionGroupState, enum<ConditionGroup> targetConditionGroup)

Summary

Skips the specified amount of lines of code in the event if the targetConditionGroup's state matches the desiredConditionGroupState. This version differs from SkipIfConditionGroupStateUncompiled in that it doesn't evaluate the conditions going in to targetConditionGroup, it only checks its current state. The state of a condition group normally gets evaluated ONLY when it is used in a command that includes the MAIN condition group.

Parameter name Type Description
numberOfSkippedLines byte Specifies how many lines of EMEVD code to skip.
desiredConditionGroupState ConditionState Specifies whether you want to compare targetConditionGroup to either PASS or FAIL (true or false).
targetConditionGroup ConditionGroup Specifies which condition group to check.

SkipIfConditionGroupStateUncompiled

SkipIfConditionGroupStateUncompiled(byte numberOfSkippedLines, enum<ConditionState> desiredConditionGroupState, enum<ConditionGroup> targetConditionGroup)

Summary

Skips the specified amount of lines of code in the event if the targetConditionGroup's state matches the desiredConditionGroupState. This version differs from SkipIfConditionGroupStateCompiled in that it will evaluate the conditions in targetCondition group, similar to when a condition group is being used in a command which includes the MAIN condition group.

Parameter name Type Description
numberOfSkippedLines byte Specifies how many lines of EMEVD code to skip.
desiredConditionGroupState ConditionState Specifies whether you want to compare targetConditionGroup to either PASS or FAIL (true or false).
targetConditionGroup ConditionGroup Specifies which condition group to check.

SkipUnconditionally

SkipUnconditionally(byte numberOfSkippedLines)

Summary

Skips the specified amount of lines of code in the event.

Parameter name Type Description
numberOfSkippedLines byte Specifies how many lines of EMEVD code to skip.

WaitFixedTimeFrames

WaitFixedTimeFrames(int numberOfFrames)

Summary

Pauses the execution of an event for a set number of frames. Using DSFix to increase the game's framerate does not change the speed in which frames for the event scripts are counted (always 30Hz). DS1R testing needed.

Parameter name Type Description
numberOfFrames int The number of frames to wait.

WaitFixedTimeSeconds

WaitFixedTimeSeconds(float numberOfSeconds)

Summary

Pauses the execution of an event for a set number of seconds. You can specify a floating point decimal number as numberOfSeconds inside of an event, but if numberOfSeconds is an event parameter then it must be converted to hex, and then that hex value needs to be represented as an integer. This link is a converter that can help you do that.

Parameter name Type Description
numberOfSeconds float The number of seconds to wait.

WarpPlayer

WarpPlayer(byte areaID, byte blockID, int initialAreaID))

Summary

Allows warping the player between different maps. Initiates a loading screen.
Note: Requires using a "Player" map object as the destination target to function properly.

Parameter name Type Description
areaID byte Base ID of map. IE for map 14_02, this value would be 14
blockID byte Block ID of map. IE for map 14_02, this value would be be 2
initialAreaID int Entity ID of the "Player" map object to use for destination coordinates.