Script:setmainevent: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 7: | Line 7: | ||
|intro=Initially, all entities have their heartbeat event set to the {{Event|main}} event and dead NPC's will have it set to {{Event|dead}}. | |intro=Initially, all entities have their heartbeat event set to the {{Event|main}} event and dead NPC's will have it set to {{Event|dead}}. | ||
The rate at which the main even is executed depends on the number of entities in the area. To run commands at specific intervals use the {{Command|timer}} command. | Heartbeat events are continuously sent to entities when the player is "near" them. Scripts should not rely on the exact definition of "near" except that all visible entities or those in the same room as the player are considered to be "near". | ||
The rate at which the main even is executed depends on the number of entities in the area. To run commands at specific intervals use the {{Command|timer}} command, with the <code>-i<code> flag if the same requirement of the player being "near" should be used.. | |||
}} | }} |
Revision as of 07:42, 24 July 2022
ℹ️ This command does exactly the same as setstatus
.
The setmainevent
script command is used to set an event to be sent periodically for an entity. Initially, all entities have their heartbeat event set to the main
event and dead NPC's will have it set to dead
.
Heartbeat events are continuously sent to entities when the player is "near" them. Scripts should not rely on the exact definition of "near" except that all visible entities or those in the same room as the player are considered to be "near".
The rate at which the main even is executed depends on the number of entities in the area. To run commands at specific intervals use the timer
command, with the -i
flag if the same requirement of the player being "near" should be used..
Usage
setmainevent <event>
Context: Any Entity
Parameters:
Parameter Type Description
event
event
The name of the event to set as the entity's heartbeat event