NavigationUser login |
Actions on objectsOften on a mud players and objects perform an action such as a dog farting. The mud client can convey the action to the player. The mud specifies an action has occurred in the 3dtags eg {odog,afart} or if a player farts {uafart}. The mud client then looks up the config file actions element and then peforms the action. For example in the actions element is might specify that a fart sound should be played. <ACTION action="afart" sound="fart"/> Actions are either peformed by other object's on the mud (eg a dog) or by the player (you). Different objects can perform different actions. For example the sound of a dog farting can be different to the sound of a human farting. This differentiation is specified in the 'actiontype' attribute of an object. For example:
These action types then link to ACTIONTYPE in actions. For example:
</ACTIONS> Note that there are other ways an action can be triggered. These include if an object moves over certain speed. Thus if an knight starts moving it will trigger a walking animation. This is discussed at the end of this document. Also when an object is created it can trigger an event if the 'initaction' attribute is set. For example when a demon is created it makes a spawn sound. When an action is triggered the mud client can perform a single or multiple tasks. For example the action can involve doing an animation and playing a sound at the same time. Thus you can swing a sword and play the sound of the sword clanging in the same action. These tasks specified in the ACTION element attributes of actions. This is a brief description of each of them: Sound Animation Effects Object You can also replace an existing object if a certain action is perform. An example might be if you have chopped a piece of wood and want to replace the unchopped model with a chopped model. You would use the 'objectreplace' attribute of actions instead of 'object' to do this. Turn <ACTION action="aopen" turn="90" sound="door"/> This will turn the object 90o giving the appearance of a door opening. Time based actions <ACTION action="asink" positionfromz="0.0" positiontoz="-0.25" time="12"/> Likewise for scaling. In the following example the object will grow in size by a factor of 2 within 1 second: <ACTION action="aspawn" scale="2" time="1" animation="awrithe" sound="demonbirth"/> Speed Triggering Actions A speed triggered action is specified by leaving the 'action' attribute blank and using the 'speedover' attribute instead. When an object has a speed greater than 'speedover' (mud units per second) then the action is triggered. For example: <ACTION speedover="0.1" sound="walk" animation="aw"/> If the object moves below speedover the default animation (eg idle) is switched back on. It is possible to have multiple speed overs. For example if the object moves over 0.3 mud units per second a run animation could be played: <ACTION speedover="0.3" sound="run" animation="arun"/> |