Difference between revisions of "Manual:Zone Manual/The Room Section/DIL functions for rooms"

From DikuMUD Wiki
Jump to navigation Jump to search
(Created page with " === DIL functions for rooms === The DIL language is the language a builder can use to make his own special functions on rooms, NPCs, objects, PCs, and much more. This ma...")
 
Line 81: Line 81:
 
//Example use of Safe room
 
//Example use of Safe room
 
dilcopy safe_room@function ();</nowiki>
 
dilcopy safe_room@function ();</nowiki>
 +
 +
<div style='padding-top: 30px; padding-bottom: 20px; text-align: left;float:left;width:50%;'>[[Manual:Zone_Manual/The_Room_Section/Compiling_and_debugging_your_first_room|Previous: Compiling and debugging your first room]]</div>
 +
<div style='padding-top: 30px; padding-bottom: 20px; text-align: right;float:right;width:50%;'>[[Manual:Zone_Manual/The_Room_Section/A_more_complex_set_of_rooms|Next: A more complex set of rooms]]</div>

Revision as of 11:27, 26 May 2020

DIL functions for rooms

The DIL language is the language a builder can use to make his own special functions on rooms, NPCs, objects, PCs, and much more. This manual is for basic zone writing and therefore will not go into how to write your own DIL functions. The VME however is released with many functions for you as an Administrator and your builders to use to make special rooms, NPCs, and objects. The following is a list of all room functions released with the VME 2.0 server.


Death room
This function is a simple function that allows you to create a room to do damage to a player. The death_room can kill them slowly like a fire cave would or it can kill them quickly as if you stuck them in a microwave it is all up to how you set the arguments. It also lets you see the acts the players see so this function can be used on any number of death style rooms. There is no need to understand how the function works just how to use it so with that in mind the following is the functions header.
	//In function.zon
	dilbegin death_room(tick: integer, damage: integer, act_s: string);

As with any function all you have to do is 'dilcopy' the function onto your room with the correct zone name and arguments and it will do the rest. In this DIL you have three arguments to pass The first is the 'tick' or time which in this DIL is broken down into 'ticks' which are 4 ticks per second. Thus if you wanted to get something to do damage every minute you would put '60*4' in that spot. The next is the amount of damage you want done per your time. If for example you want '60' hit +points damage done each round you just put '60' as that argument. Finally is the act shown to the character as a string in quotes. So a finished death room on your room would look like this.

	dilcopy death_room@function(4*60,60,
	"Flames shoot up from the floor burning your butt.");
Climb
This special DIL is used for the climb skill and should be set on stationary objects (stationary mast, robe, tree, wall, etc). The

'difficulty' is the skill-amount required to climb. A skill of 100 would be a 50% chance for the expert thief / climber. The 'damage' is how much damage is given if you fail to climb the object. When you fail, you "fall" to the 'destination', so you can make gravity work correctly. The destination can be the same room in which you started but it doesn't have to be. The 'direction' is the direction in which you want the person to have to climb enclosed in quotes.

With all this in mind the following is the DIL definition and an example use of it.

	//DIL definition
	dilbegin climb(destination:string, difficulty:integer,
	                damage:integer,direction:integer);

	//Example use of Climb
	dilcopy climb@function("deck@ship", 17, 20, "up");

We should note here, if you wanted the person to have to climb back down you will need to put a climb DIL on the room you are climbing too that has the "down" directory as an argument. This DIL also allows you to link two rooms not linked by normal directions but we suggest you should think before doing this because it may not make sense to not have a link between the two places.

Force move
This function allows you to move a player or NPC from a room to another room with out having the player or NPC type or do anything.

The following is the definition of the force move DIL

	dilbegin force_move (tick: integer, strings: string, random: integer);

The 'tick' parameter is how fast you want the force move to be triggered. The 'tick' is in 1/4 second increments so to get a one second wait you would place a four. The second parameter is two strings the first being the symbolic name of the room you are forcing the character to. The second string is the act you want shown to the player or NPC when it is moved. The final parameter is either a one or a zero. The one stands for true and it would make the timer trigger randomly fifty percent of the time, while a zero would make it not random.

The following is what the force move would look like if you wanted it to trigger every 30 seconds and give acts of a river.

	dilcopy force_move@function(4*30,{"river2@riverzon","You float down the river."},0);
Safe room
This function creates a safe room where combat is not allowed.

The following is the definition and an example of how to use it.

	//Safe room DIL definition
	dilbegin safe_room ();

	//Example use of Safe room
	dilcopy safe_room@function ();
Previous: Compiling and debugging your first room
Next: A more complex set of rooms