Manual:DIL Manual/nopriority
Jump to navigation
Jump to search
Contents
nopriority
Procedure. Ends the priority set by this program.
nopriority;
After nopriority, the unit's other programs get events again. When no priority is set it does nothing, so a program can call it at the top of its loop every time.
Notes
- Call it before going back to waiting. A program that waits under
prioritykeeps the unit's later programs dead while it waits. - Ending the program ends the priority too; no
nopriorityis needed beforequit.
Example
dilbegin fnpri(FN_PRI_MISSION) john_assist();
external
integer walk_room@function(s : string, i : integer);
var
tf : integer;
s : string;
code
{
heartbeat := PULSE_SEC * 3;
on_activation(self.position <= POSITION_SLEEPING, skip);
:start:
nopriority;
wait(SFB_MSG, activator.nameidx == "mary");
priority;
s := argument;
tf := walk_room@function("cabin@haon_dor", 4);
exec("kill " + s, self);
pause;
exec("emote screams, 'Murderer, " + s + "!'", self);
goto start;
}
dilend
John runs home to help his wife, with his random walking held back by priority until he goes back to waiting. From haon_dor.zon.