Page 1 of 2

Adding NPC's and items to your map

Posted: June 24th, 2010, 3:12 pm
by Chaze007
This tutorial will teach you how to make basic GUI code. This code basically allows NPCs and stuff to talk.

Code: Select all

//Test GUI
 newgui diologue1 [
        guitext "Hello, this is where the text is entered." chat
 ]   "Hello, this is the title"
As you can see above, everything is writen in a neat fashion.
newgui - Tepresents a new GUI window, where your character will speak.
newgui diologue1 - The diologue1 text is the name of your gui window.
guitext - This represents what the character will say. Always make sure to put quotations (" ") around the text, and "chat" without quotations, at the ending.
The very last line, after the closing bracket represents the title that will appear at the top of your GUI window.

Let's move on to something more advanced.

Code: Select all

 //Test GUI
 newgui diologue2 [
 	guitext "First line of text!" chat
 	guitext "Second line of text!" chat
 	guitext "Third line of text!." chat	
 ]   "Lines of text
."

Adding more lines can make your diologue longer. Keep this in mind when explaining something big in your map.

Code: Select all

//Test GUI
 newgui diologue3 [
 	guitext "^fs^f0Hello, I am green text^fr" chat
 ]   "Green Text"
Adding color tags allow you to color text
The ^fs represents the starting point basically, of where your colored text will be.
The ^f0 is the color of your text, 0 being green.
The ^fr represents the ending point of your text.
These combined allow for scattered colored text.

Code: Select all

 //Test GUI
 newgui diologue4 [
 	guitext "^fs^f0Hello^fr, I am ^fs^f1blue^fr, no wait! ^fs^f3RED!^fr." chat
 ]   "Colored Text"
Here is the full list of different colored text.
^f0 - Green
^f1 - Blue
^f2 - Yellow
^f3 - Red
^f4 - Gray
^f5 - Magneta
^f6 - Oramge
^f7 - White

^fA - Apricot
^fB - Brown
^fC - Corn
^fD - Dodger Blue
^fE - Emerald
^fF - Fuchsia
^fG - Gold
^fH - Heliotrope
^fI - Indigo
^fJ - Jade
^fK - Khaki
^fL - Lemon
^fM - Mint
^fN - Navajo White
^fO - Olive
^fP - Pink
^fR - Rose
^fS - Silver
^fT - Turqoise
^fU - Ultramarine
^fV - Violet
^fW - Wheat
^fY - Yellow
^fZ - Zinnwaldite

^fs - Start of Text
<li>^fr - End of Text</ul>

These allow for a combination of brilliant colors if used in the correct manner.
Next I will show you how to execute your GUI, and make an item for your map.

Code: Select all

//Diologue Triggers
 level_trigger_1 = [showgui diologue1; sound $select]
the level trigger chooses which tag your npc will have. As you can see it's told in the action to show the GUI of diologue1, and to play a sound.

Code: Select all

 //Item Triggers
 level_trigger_2 = [jumpvel 600; sound $eatapple; showgui eatapple; echo "You've eaten an apple! You can now jump HIGHER!"]
As you can see here, this is something you'd most likely assign to be an item, the action tells it to increase the jumping velocity, to play a sound, to show a GUI, and to show text in the top left corner.

Mixing these unique functions can make for an exciting map. We hope this tutorial helped you in your troubles.

Re: Adding NPC's and items to your map

Posted: June 24th, 2010, 4:49 pm
by arcones
Ahh, thanks Chaze!

The jump vel change at the end is very helpful :)

Re: Adding NPC's and items to your map

Posted: June 24th, 2010, 5:25 pm
by GR1M
Level_trigger_1 = (echo "I liked the tutorial please provide more!")

Re: Adding NPC's and items to your map

Posted: June 25th, 2010, 5:00 am
by Chaze007
Lol, in due time, in due time.

Re: Adding NPC's and items to your map

Posted: June 25th, 2010, 8:06 am
by arcones
SUPPORT TEAM! That's one vote :D

Re: Adding NPC's and items to your map

Posted: June 25th, 2010, 12:43 pm
by Chaze007
I used to be a mod around here ;D but them I got inactive ):

Re: Adding NPC's and items to your map

Posted: August 3rd, 2010, 6:25 pm
by InHumanUnit
Where do I put it?

Re: Adding NPC's and items to your map

Posted: August 3rd, 2010, 7:29 pm
by PizzaLover101
IHU, check out this tutorial that I made:

viewtopic.php?f=24&t=1532

Re: Adding NPC's and items to your map

Posted: August 4th, 2010, 11:00 am
by InHumanUnit
Thanks, my sister is currently testing my game, she can't get past the first trap. LOL!!!

Re: Adding NPC's and items to your map

Posted: August 4th, 2010, 4:40 pm
by chocolatepie33
Nice tutorial, I vote for you on support team.
I was wondering... What's the bakerspeak in the village map do, and everything? I know it has to do with the text particle, but I'm lost...