Xelagot script by Who 230147


Shadow Bot Adventure RPG Script for Xelagot

Script
This script allows you to run an entire gaming session involving databases for multiple players, monster bots, equipment, skills and items etc

The script is actually a multiple of scripts and requires a complete Xelagot X1 program (3 bots) to operate. All scripts and instructions are included in the archive file which can be downloaded from this page. This script is not for the novice Xelagot operator, it is presumed you have some experience with at least setting up a Xelagot to run. If not, then you will need to learn a lot from the Xelagot website before you will be able to follow the setup instructions included with this script file set.

The script is minimal in design, you are welcome and encouraged to expand upon it to include many more features. The scripts themselves provide a useful learning curve so that one may achive a more complex RPG enviroment using scripted Xelagots.

You can download the scripts by selecting this link: shadow.zip
You can read the "Shadow Bot Guide" here.

Warranty:

Dammit! I'm not a programmer..

if BROKE, then
  user;='Owns Both Pieces'

if PROBLEMS/SUGGESTIONS then
  contact:='Who - The Second Opinion, ricta@ricta.net'

if COMPLAINTS then
 send to dev/null




 

Install Instructions:

(Also included within archive)
##########################################################
#    Adventure Game Bot - A script series designed for Xelagot's.               #
#           3 Xelagot's (1 complete X1 Program required)                              #
#                                                                                                               #
#                   Scripting Author: Who 230147                                             #
#                 Xelagot Programmer: XelaG 289499                                      #
#  IMPORTANT: This script series does require some knowledge of the    #
# Xelagot or at least a desire to learn that knowledge via the online             #
# documentation provided on the Xelagot website                                      #
#                http://www.imatowns.com/xelagot                                            #
# I will not provide support for this script except in exceptional                   #
# circumstances.                                                                                        #
# XelaG is not responsible for this script and therefore will not                    #
# provide support in any form.                                                                   #
#########################################################

What you should have in this archive:

 1. Shadow.txt - this instruction file
 2. advshadow1.txt - Bot Script
 3. advshadow1a.txt - Bot Script
 4. M1.txt - Bot Script
 5. M2.txt - Bot Script
 6. Locations1.txt - Example random locations data file
 7. Locations2.txt - Example locations data file
 8. Rumours1.txt - Example set of chat lines (rumours)
 9. playerchar.txt - Data file for players (blank)
10. playeritems.txt - Data file for items (blank)
11. temp.txt - Data file for bots (blank)

Installation:

1. Setup a new X1 program - Xelagot program. it is not recommended
   that you use an existing set of Xelagot's to avoid confusion.
   If you need help with this, read the Xelagot online docs!

2. Login the first bot and name it "Shadow". Once it is logged in
   go to the "World" menu and select "Preferences". Enable the
   "Identify Citizens" checkbox and then close window.

3. Login the second bot and name it "M1". Also enable "identify
   citizens" in its preferences.

4. Login the third bot and name it "M2". Also enable "identify
   citizens" in its preferences.

5a. Start the inbuilt Xelagot Server section and add 3 clients
   "Shadow" "M1" "M2", give them all the protocols of "master"
   Remember the port you use to start the server on and any
   passwords you gave for the bots.

*OR*

5b. Use the standalone XlgServer program for your bot server.
   Again you will have to add the bots as clients etc.
   Note: Using the standalone server provides greater efficiency.

6. Shut down the Xelagot program.

7. Copy all the files in this series into the Script folder of the
   Xelagot program you just created.

Script preparation:

This is a big job, it will take you some time to edit all the scripts
and obtain all the database locations required. It is suggested you
familiarise yourself with the Xelagot inbuilt location script commands.
If you understand /addpos and /addlab etc things will be easier.

The following instructions relate to each file in the archive as listed
above. Each script or data file will be treated in its own section.

The following scripts require no editing:
temp.txt
playerchar.txt
playeritems.txt

The script "rumours1.txt" does not require editing to get the bot
working but it is advised that you edit this to your own rumours at
some stage.

Script Edits:

Note: Only sections of the scripts requiring edit are listed here. You
should open the actual script in another editing window to edit as you
follow the instructions for each script.

=======================================================================
M1.txt and M2.txt
-----------------
These scripts are the same for the 2 monster bots, both
will need identical editing as follows.

All parts requiring edit are within << >> style brackets - make sure you
delete the << >> brackets :)

The listed <<   >>  sections you need to edit are described here:

@b = <<world coords eg: myworld 10.0n 10.0w -10.0a >>
 You need to edit the coordinates for the default position of the bot
 within the world. 10m under the center point where the main bot will
 stand is best.

ClHost <<"your computer hostname or IP address">>
 The IP address or hostname of your computer - check Xelagot
 documentation about the server feature of the program if unsure.
 Hint: Most can be set as "127.0.0.1" (localhost) if you are running
 everything on one computer.

CLPort <<Port number the Xelagot server is working on>>
 State the port address you gave in the X1 server settings

CLPassword <<"your bots password to the bot server">>
 The password (if any) you specified for the bot when you
 added it as a client to the Xelagot server
 

 The main section has 10 monster types. Here you need to assign
 10 different avatars and their fighting actions (gestures). As you
 can see in my world they are ants skeletons etc. You may use any
 suitable avatar in your world list.
 Only the first 2 are listed here but you will see a total of 10 -
 entries listed in the script. Edit for all 10 entries.

Avatar <<avatar number of monster number 1>>
 This is where you edit the number of the avatar the bot will use
 when being this monster - remember there are 10 of these.

Gesture <<gesture number and time for fighting action eg: 4 4>>
 This is where you edit the number of the action the bot will use
 to do a fighting gesture, the second number is time. It can stay
 as 4 if you like

Remember there are 10 of the above "Avatar" and "Gesture" edits
make sure you do them all, you may assign the same avatar number twice.

No further editing is required. Remember to edit both M1.txt and M2.txt
EXACTLY the same.

=======================================================================

advshadow1.txt
--------------

This script is the start script for the entire program.

All parts requiring edit are within << >> style brackets - make sure you
delete the << >> brackets :)

The listed <<   >>  sections you need to edit are described here:

%DefAv = <<avatar number of the bot as it stands around idle>>
 This is just the avatar designation for the bot at rest.

@c = <<world coords eg: myworld 10.0n 10.0w 0.0a >>
 You need to edit the coordinates for the default position of the bot
 within the world. This is the spot the bot waits for players.

ClHost <<"your computer hostname or IP address">>
 The IP address or hostname of your computer - check Xelagot
 documentation about the server feature of the program if unsure.
 Hint: Most can be set as "127.0.0.1" (localhost) if you are running
 everything on one computer.

CLPort <<Port number the Xelagot server is working on>>
 State the port address you gave in the X1 server settings

CLPassword <<"your bots password to the bot server">>
 The password (if any) you specified for the bot when you
 added it as a client to the Xelagot server.
 

No further editing is required.
=======================================================================

advshadow1a.txt
---------------

This script is the main game engine.

All parts requiring edit are within << >> style brackets - make sure you
delete the << >> brackets :)

The listed <<   >>  sections you need to edit are described here:

@e = <<world coords eg: myworld 10.0n 10.0w 0.0a >>
 You need to edit the coordinates for the default position of the bot
 within the world. This can be the same spot the bot waits for players.

ClHost <<"your computer hostname or IP address">>
 The IP address or hostname of your computer - check Xelagot
 documentation about the server feature of the program if unsure.
 Hint: Most can be set as "127.0.0.1" (localhost) if you are running
 everything on one computer.

CLPort <<Port number the Xelagot server is working on>>
 State the port address you gave in the X1 server settings

CLPassword <<"your bots password to the bot server">>
 The password (if any) you specified for the bot when you
 added it as a client to the Xelagot server.

*The next edits are at about line 375 of this file*

Avatar <insert number of appropriate male avatar>
 Which male avatar you wish the bot to use when designated as a male

Avatar <insert number of appropriate female avatar>
 Which female avatar you wish the bot to use when designated as a female

Avatar <insert number of appropriate alien avatar>
 Which alien avatar you wish the bot to use when designated as an alien

No further editing is required.
=======================================================================

Locations1.txt and Locations2.txt
---------------------------------

The remaining two scripts are actually databases for the Shadow Bot.
These are very important and it will take time for you to set them up
correctly. Both are sets of locations in your world area that you wish
encounters to take place.

Locations1.txt is the set of random locations the bot will use to signal
random encounter events with monsters. These locations should normally be
in open areas where there is room for the player, the bot and monsters.

Locations2.txt is the database of locations for your weapon shop, training
guild and other static locations. There are only 12 of these in this
version. I will discuss this file first.

Setting up Locations:

Locations2.txt
--------------

Open the file for editing. You will notice it has a brief summary of each
location. You need to substitute the location variables for these places in
your world area that the game is situated.

Do not use the example locations already in the file.

The 12 locations are:
1-Weapon shop.  This is where the player can buy weapons.
2-Potion shop.  This is where the player can buy potions.
3-Training guild. This is where the player level trains.
4-peasant. An avatar object that pretends to be an NPC for chatting to.
5-peasant. An avatar object that pretends to be an NPC for chatting to.
6-peasant. An avatar object that pretends to be an NPC for chatting to.
7-peasant. An avatar object that pretends to be an NPC for chatting to.
8-peasant. An avatar object that pretends to be an NPC for chatting to.
9-peasant. An avatar object that pretends to be an NPC for chatting to.
10-peasant. An avatar object that pretends to be an NPC for chatting to.
11-food store.  This is where the player can buy food.
12-bounty reward. This is where the player sells brigands heads.
                  (Like a sheriff's office paying bounty hunters)

For all 12 locations it is best to have some sort of Avatar object standing
there "pretending" to be the storekeep or the person (peasant) a player can
chat with. You can of course build a Weapon shop (and/or guild, potion
shop etc) suitably decorated and place a storekeep inside it to enhance the
experience of the game.

To obtain the location coordinates of these positions you can ask your bot.
Example:
Walk to Weapon shop or Weapon seller avatar object.
Stand in front of that avatar.
Say to your bot: <botname> where exactly am I?
The coords the bot responds to you are the ones you replace in field 1
(weapon shop) in the Locations2.txt file after adding 2 to the altitude.

IMPORTANT: Add 2 to altitude! eg: If the bot responds with the coord
12.345n 6.753e 0.00a then the result you edit into the file is:
12.345n 6.753e 2.00a

Do this for each location and edit Locations2.txt accordingly.

Alternatively you can use the "new" script command for a Xelagot and walk
around saying /addpos and /addlab to create a file of the 12 locations
which you can then just cut and paste into Locations2.txt after adding
2 to the altitude.

Locations1.txt
--------------

This file is the one that holds the monster encounter locations. In this
version the Shadow bot requires 120 of these locations and you must edit
all of these into this file.

Do not use the example locations already in the file.

How it works:

The 120 locations are divided up into 6 groups of 20. The Shadow bot selects
one group of 20 at startup and awaits the player to walk on or near one of
those 20 locations. When they do, the Shadow bot calls in the monster(s) and
a battle might ensue. After the battle the Shadow bot will again choose a
group of 20 locations - it might be the same group of 20 or a different set.

Note that each group of 20 is regarded as two sets of 10 by the bot when it
comes to encountering monsters. The first 10 will produce easier to beat
monsters while the second 10 may produce monsters that are very deadly.
Remember this when choosing your locations. 60 of them can be normal and
the other 60 should be in an area that the player would consider more
dangerous to travel in.

Ok, you need 120 locations to edit into this file (replacing the example
locations that are there).

The easiest way to do this is by using a Xelagot's inbuilt script writing.
By selecting a "new" script and having the bot join you, you can walk around
saying "/addpos" at each location you think a monster encounter may occur.
Do this until you have 120 of them, or do 2 groups of 60 - one set for the
easier battles, one set for the difficult battles.

Then merely save the script under some unused name and then edit it and
paste it into Locations1.txt. Note you must add "2" to the altitude of
each location you received in this file or from the bot. it is easier to
add this 2 before editing into the Locations1.txt file.

eg:If the bot coord in your new file is 12.345n 6.753e 0.00a
then the result you edit into the locations file is: 12.345n 6.753e 2.00a
So edit your "new" file first and add 2 to the altitude of each location.

If you are not familiar with using the bot to write location scripts then
go to the Xelagot website and learn how :)

Your editing is now complete.
============================================================================

Starting the Bot!
=================

You should now have everything you need to start the bots. Do so using the
following procedure.

1. Start the Xelagot program.
   If you installed as suggested the 3 bots will already have their names
   and remember their passwords etc.
   (Don't forget to start the bot server here as well!)
   The 3 bots should be Shadow, M1 and M2

2. Select the 3rd bot, it should have its name as "M2".
3. Logon M2 to your world.
4. In the Dialog Scripts menu item have M2 run the script named "M2.txt"
   If all went well M2 should now be in your world at the coords you
   specified. If you followed the advice that will be 10m below where
   the Shadow is going to stand.

5. Follow steps 2, 3 and 4 using the second bot "M1" and have it run
   the script "M1.txt"
   You should get the same result here, now M2 and M1 should be standing
   at the same spot 10m below where Shadow will be.

6. Select the first bot "Shadow"
7. Logon Shadow to your world
8. In the Dialog scripts have Shadow run the script "advshadow1.txt"
   You should notice Shadow go to the position you earlier edited
   for him to stand. Also, both M1 and M2 should leave the world at
   this point - Shadow has commanded them to do so. If they have not,
   check your server to see if all 3 bots are logged into the
   Xelagot server section. If they haven't you have incorrectly edited
   the hostname, port or password or never added them as clients in
   the initial installation.

9. If all worked well, you should merely have Shadow standing at the
   desired location. If this happened then shut down the Xelagot
   program and proceed to step 10. If it failed you need to
   recheck your entire install.

10. Restart the Xelagot program, the bots will have remembered their
    scripts and should start running them automatically and also logon
    to your world by themselves. You have to initiate the Xelagot server
    so the bots can logon to it to talk to each other. Make sure you do.

========================================================================

You are now ready to play.
-------------------------

The command for activating the entire game is "start adventure". When
you say this the first time, Shadow should respond that you have not
made a character as yet and tell you the command to make a character.
Do this and then you can start playing and check to see if everything
is working.

========================================================================

Help me!
--------

If you have serious problems getting it to work I will assist you. If
your problems include questions like "how do I get my locations?" I will
not assist you. You must learn these basic commands from the documentation
on the Xelagot website.

I hope you enjoy this script set, and I hope it gets you interested
enough to expand on it. The original has special quests and items, random
item hints etc etc. By viewing the script you have, you can learn how this
is done and perhaps add sections of your own creation.

I would appreciate an email sent to ricta@ricta.net if you use this set
of scripts, just so I know if its popular and people are using it. You
may also send questions about "serious problems" to that email address.
 

Enjoy!

         Who 230147