The Adliberum Engine (ADLENGINE) Guide

[TUTORIAL] - CREATING A FANTASY MUD in ADLENGINE for The Adliberum Engine (ADLENGINE)

[TUTORIAL] – CREATING A FANTASY MUD in ADLENGINE

Overview

How to build a M.U.D in ADLENGINE.What this guide will reveal:How to create rooms / exits.How to setup and manage player statistics, health, gold etcHow to setup basic Combat using dice rolls factoring player / creature statsHow to setup and manage creature statistics, health, gold etcHow to setup basic quests and dialogues

Download Example Files

You can find the files (as I work on them) at the link below.

[link]

The rpg.adlengine file is ready to play.

The room images are all set to pattern (pattern.jpg). If you would like to customise the room images do the following.

1. Find the adlengine folder in steamapps (under program files steam steamapps )
2. rename package.nw to package.zip (ignore the warning – you will need to be able to edit file extensions which is in folder options)
3. open the zip
4. add the .jpg image plus any other images / sounds you want to use, to the zip (supports subfolders)
5. close the zip file
6. rename the zip file back to package.nw
7. relaunch adlengine

To use different images for the rooms (not supplied)
In each room:

room image is imagename

If the image is in a subfolder:

room image is foldernameimagename

Ignore the .jpg extension, you dont need to add this.

——————-

CONTENTS:

3 Rooms:

  • Tavern
  • Rented Room
  • Village Square

3 Objects:

  • Bar
  • Bed
  • Fountain
  • – gold coins (inside fountain)

1 Character:

  • Barkeep

The Tavern


objects: Bar.
exits: north and south

To build exits:

build exit n
build exit s

Now lock the north door: (the room for rent)

exit n is locked

In the tavern you will be able to a) talk to barkeep b) buy beer c) rent room

To rent a room:

rent room

This is a custom command that calls script_rentroom. This script checks if the player can afford to rent the room, IF they have enough gold it calls script_unlockdoor ELSE it tells them they cant afford to rent the room.

To setup a custom command you simply type if custom command then do something
custom commands can also have an optional and
e.g. if rent room then do script_rentroom

IF they are able to rent the room script_unlockroom unlocks and opens the door to the north and deducts 2 gold from the players gold.

I added the optional ability to also buy a beer:

buy beer

If the player can afford it they will buy and drink a beer automatically which calls the script_drinkbeer script.

NB: All the script files (.verbose) and .adlengine files can be opened / edited in notepad or similar text editors. Do this to see how each script works.

The Rented Room

objects: Bed.

The door will remain locked until the player rents the room. Once they have paid they can then travel north into the room.

Then, in the room they have the option to:

sleep

Again the sleep command is a custom command.

This calls script_rest which adds a day to the date, heals the player to 100 health and then forces the player to move south, locking the door behind them.

The Village Square

objects: Fountain.

Inside the fountain I have placed coins. To make this possible

build fountain; fountain is openable; fountain is open; gold coins is hidden; build gold coins; gold coins.is inside fountain;

To reveal the coins which will then allow the player to take them:

look inside fountain

This makes them known to the player so they can take them simply by using the command:

take coins

However to be able to take them we need to set make them take-able. There are two ways to do this.

1) When you build objects if you want the player to be able to take them add .obj on the end which will build an empty {takeable} object.

build box.obj

.obj is a class of object, of which there are currently a few available. Adding this automatically grants special pre-defined properties. I am working on adding custom classes..

Current Classes:

  • .obj
  • .chest
  • .food
  • .drink
  • .ai
  • .exit

2) use the following scripting command

gold coins can be taken

– Affecting The Village Square Lighting

Let’s have the hour of day affect the lighting level in the village square.

real-time-light.verbose

#hour=player.hours; ?hour>17:do nighttime!do daytime;

This script will be saved locally in the Village Square. The code gets the current hour and if its past 5pm its the night time ELSE its the daytime.

nighttime.verbose

room is dark;

Straight forward single command that makes the room dark. Store this script globally. daytime.verbose

?hour>6:room is light!room is dark;

This script again needs to be stored globally. It looks to see if the time is past 6am in the morning IF so its the daytime so it makes the room light ELSE its the nighttime so it makes the room dark.

The Player

Lets grant our player some health.

player.health = 100

And some gold to spend.

player.gold = 100

Building Another Room

To add more rooms:

build room direction

i.e.

build room n

This will build a room (if one doesn’t already exist) to the north and will create exits to the north into the room and south out of the room.

Inside the room you can set:

The room name:

room name is roomname

i.e.

room name is dungeon

The room description:

room description is roomdescription

i.e.

room description is A danky, dingy dungeon.

The room image:

room image is imagename

i.e.

room image is dungeon

The room visibility:

room is roomvisibility

i.e.

room is dark

values you can set for room visibility:

  • pitch black
  • barely lit
  • dark
  • light
  • well lit
  • bright

Adding Survival Stats

First lets set up some survival based stats.

player.health = 100
player.thirst = 100
player.hunger = 100
player.energy = 100

Next we shall create three script files that provide the player with feedback when their stats change significantly. Dont forget to store them using the editor (.editor) – storing them globally will mean it will work anywhere. Locally would render them only in that particular room. Great for things like water, where it depletes our players air, for example.

hunger.verbose:

#amihungry=player.hunger; #amihungry-1; player.hunger = amihungry; ?amihungry<1:narrate You perished from starvation!; ?amihungry=1:narrate You are about to perish from starvation!; ?amihungry=3:narrate You are dying of starvation!; ?amihungry=5:narrate You are starving to death!; ?amihungry=10:narrate You are starving!; ?amihungry=25:narrate You are really hungry!; ?amihungry=50:narrate You are hungry!; ?amihungry=75:narrate You are peckish!; ?amihungry=100:narrate You are full!;

thirst.verbose:

#amithirsty=player.thirst; #amithirsty-2; player.thirst = amithirsty; ?amithirsty<1:narrate You perished from dehydration!; ?amithirsty=2:narrate You are about to perish from dehydration!; ?amithirsty=4:narrate You are severely dehydrated!; ?amithirsty=6:narrate You are seriously dehydrated!; ?amithirsty=10:narrate You are dehydrated!; ?amithirsty=26:narrate You are really thirsty!; ?amithirsty=50:narrate You are thirsty!; ?amithirsty=74:narrate You are parched!; ?amithirsty=100:narrate You are fully hydrated!;

energy.verbose:

#tired=player.energy; ?tired<0:narrate you passed out!; ?tired=0:narrate you are about to pass out!; ?tired=10:narrate you are beat!; ?tired=25:narrate you are really tired!; ?tired=50:narrate you are starting to get tired!; ?tired=75:narrate you are flagging a little!; ?tired=100:narrate you are full of energy!;

Notice how in the energy script we’ve not minused from the player energy? this is because we’re going to deplete the energy based on actions / commands you perform such as taking something thats heavy, or moving around alot.

We can now set up 2 timed events to handle, hunger and thirst.

every 90 second do hunger
every 60 second do thirst

Adding a Real-Time Clock

To setup a real-time clock we’re going to attach it to our player so it always follows us.

player.seconds = 0
player.minutes = 0
player.hours = 0
player.days = 0
player.years = 1802

The quicker way to setup the clock would be to create script file called setupclock.verbose and add the above commands terminated with ; to allow for quicker import into your game/s.

Now we need to create the first of 3 scripts which need to be stored globally to allow the time to run everywhere:

runtime.verbose

#secs=player.seconds; #secs+1; player.seconds = secs; ?secs=60:do minute-passed!;

This script will be run every second. It gets the current seconds, adds 1 to it, stores it again and then checks if 60 seconds has passed (a minute) if so then run the minute-passed script.

To run this script every second:

every 1 second do runtime

minute-passed

#mins=player.minutes; #mins+1; player.minutes = mins; ?mins=60:do hour-passed!; player.seconds = 0;

This script gets the current minutes, adds 1 to it, stores it again and then checks if 60 minutes has passed (a minute) if so then run the hour-passed script. PLUS it resets seconds to 0.

hour-passed

#hrs=player.hours; #hrs+1; player.hours = hrs; ?hrs=24:do day-passed!; player.minutes = 0;

This script gets the current hours, adds 1 to it, stores it again and then checks if 24 hours has passed (a day) if so then run the day-passed script. PLUS it resets minutes to 0.

To retrieve the current time we shall build another script:

whattimeisit.verbose

#hrs=player.hours; #mins=player.minutes; #secs=player.seconds; clear info; info The time is:; info space; info hrs; info :; info mins; info :; info secs;

This script when called prints the time in the special debug message in the bottom middle of the screen. It takes the current hours, minutes and seconds.
Clears the message text.
Writes The time is:
Writes a space (info space)
Writes the hours followed by :
Writes the minutes followed by :
and finally writes the seconds. (you could omit the final two lines if you didnt want to show the seconds. i.e. ala a digital clock)

Now we’ll process the days…

day-passed.verbose

#days=player.days; #days+1; player.days = days; ?days=365:do year-passed!; player.hours = 0;

This script takes the current days, adds 1, stores it back in, and if the number of days reaches 365 it adds 1 to the year. It also resets the hours to 0. If you wanted to add a custom year length, you could add player.yearlength and instead of ?days=365 you would first store the yearlength in a variable and then ?days=yrlength for example.

And finally now onto the years.

year-passed.verbose

#yrs=player.years; #yrs+1; player.years = yrs; player.days = 0;

This final script takes the current year, adds 1, stores the new year and resets the days to 0.

SteamSolo.com