Home
About
Policies
FAQ
Forums
Registration
Password Recovery

Exit

From Tapestries MUCK

(Difference between revisions)
Jump to: navigation, search
(Removed redundant section header)
(Expanded the top a bit to clarify this is a 'type' of exit.)
Line 1: Line 1:
-
An action is something that can be invoked by [[players]] as a command by typing the [[name]] of that action.
+
The term '''action''' is used to refer to an [[exit]] that does not take a [[player]] somewhere, but instead is used to perform some other action. Normally this is done with [[MPI]] or a [[MUF]] [[program]].
 +
 
 +
Actions can be invoked by [[players]] as a command by typing the [[name]] of that action.
===Creating an Action===
===Creating an Action===
-
You can create an action using the [[@act]] command.  Now lets say you have a room with a [[dbref]] of #1234 that you want to be able to easily change the wall color in.  Although you can do much much more with actions than this, everyone needs to start with something simple and understandable.  A simple action that does lets you do that is created below.
+
You can create an action using the [[@action]] command.  Now lets say you have a room with a [[dbref]] of #1234 that you want to be able to easily change the wall color in.  Although you can do much much more with actions than this, everyone needs to start with something simple and understandable.  A simple action that does lets you do that is created below.
-
<mpi>@act wallcolor=#1234=wallcolor  «- Here we create the action and attach it to the room
+
<mpi>@action wallcolor=#1234=wallcolor  «- Here we create the action and attach it to the room
@link wallcolor=$nothing  «- You need to do this for it to work
@link wallcolor=$nothing  «- You need to do this for it to work
@succ wallcolor={Exec!:_cmds/{&cmd}}  «- Here we tell the action to execute this command for success
@succ wallcolor={Exec!:_cmds/{&cmd}}  «- Here we tell the action to execute this command for success

Revision as of 03:38, 25 April 2007

The term action is used to refer to an exit that does not take a player somewhere, but instead is used to perform some other action. Normally this is done with MPI or a MUF program.

Actions can be invoked by players as a command by typing the name of that action.

Creating an Action

You can create an action using the @action command. Now lets say you have a room with a dbref of #1234 that you want to be able to easily change the wall color in. Although you can do much much more with actions than this, everyone needs to start with something simple and understandable. A simple action that does lets you do that is created below.

@action wallcolor=#1234=wallcolor  «- Here we create the action and attach it to the room
@link wallcolor=$nothing  «- You need to do this for it to work
@succ wallcolor={Exec!:_cmds/{&cmd}}  «- Here we tell the action to execute this command for success
@osucc wallcolor={Exec!:_cmds/o{&cmd}}  «- This tells the action to print something to everyone else
@set wallcolor=_cmds/wallcolor:You change the wall color to {store:{&arg},_wallcolor,#1234}
@set wallcolor=_cmds/owallcolor:changes the wall color to {&arg}

Now you just include something like "The walls are {prop:_wallcolor}" and it would show whatever was last set when someone typed wallcolor somecolor.

Multiple Commands on one Action

While changing the wall color is just grand, you might want to change the floor color as well. Since you have big plans, you don't want to use up too much of your quota doing this. You can take the action just made and add to it like this:

@name wallcolor=wallcolor;floorcolor  «- Changes wallcolor to answer to wallcolor and floorcolor
@set wallcolor=_cmds/floorcolor:You change the floor color to {store:{&arg},_floorcolor,#1234}
@set wallcolor=_cmds/ofloorcolor:changes the floor color to {&arg}

Now you just include something like "The floors are {prop:_floorcolor}" and it would show whatever was last set. The wallcolor somecolor command would still exist for changing the wall colors, but now you also have a floorcolor somecolor for changing the floors.

Personal tools
Namespaces
Variants
Actions
navagation
information
wiki
Toolbox