This will show you how to make a quest in sandbox
In this tut i will show how to make a simple quest where you talk to a guy. Then you Pick up a barrel then you take it to another guy.
This is the first we need to do.
Open up your custom map
PlatinumArtsSandbox2.5\my_stuff\packages\base\
If you dont have a .cfg file make a new .cfg file named of your map so if your map name was daltonds you would name it daltonds.cfg
After that add this at the top
Code: Select all
//Picking up items
level_trigger_1 = [
barrel = (+ $barrel 1)
echo "You picked up a Barrel"
]
//End Picking up items
Level Trigger_1 = The level trigger you will set on the barrel so that it can be picked up.
Echo "You picked up a barrel" = Will say this at the top left You picked up a barrel in blue
Now to set a Level trigger on a barrel first spawn a barrel and press . after that a code will come up. Change the 3rd number which would be 0 to 1 and press enter
Now we are going to make the NPC You would like to talk
Under //end picking up items add this
Code: Select all
// Start Quest
level_trigger_2 = [
showgui Quest
]
newgui Quest [
guitext "Hello? Can i help you?" chat
guibar
guibutton "Im looking for a quest" "showgui Quest_Yes"
guibutton "No" "cleargui"
]
newgui Quest_Yes [
guitext "Alright i think i have one for you..." chat
guitext "See these barrels behind me?" chat
guibar
guibutton "Yes" "showgui Quest_Yes1"
guibutton "Good bye" "cleargui"
]
newgui Quest_Yes1 [
guitext "Pick up one for me and take it to my friend" chat
guitext "Hes over there next to the gates to leave the town." chat
guibar
guibutton "Thank you bye" "cleargui"
]
level_trigger_3 = [showgui Guard]
newgui Guard [
guitext "Hello? Can i help you?" chat
guibar
guibutton "I have a item for you." "showgui Guard1"
guibutton "No" "cleargui"
]
newgui Guard1 [
guitext "What item is?" chat
guibar
guibutton "I have a barrel from a guy i don't know." "showgui Guard2"
guibutton "I don't know bye" "cleargui"
]
newgui Guard2 [
guitext "Ok please hand it over." chat
guibar
guilist [
guibutton "Hand over item." [
if ( > $barrel 0 ) [
money = ( + $money 20 )
barrel = ( - $barrel 1 )
echo "Quest Completed: You earn 20 gold."
]
]
]
]
//End quest
Again spawn your npc and put the 3rd number which would be 0 to 2 now its 2 this time cause level trigger = 2
Now spawn another NPC some where else and put his level trigger at 3. This is the guy you will be giving the barrel to.
Code: Select all
if ( > $barrel 0 ) [
money = ( + $money 20 )
barrel = ( - $barrel 1 )
if ( > $barrel 0 )
if you have 1 barrel you can finish the quest if you don't you cant
money = ( + $money 20 ) = This will add 20 Gold into your inv
barrel = ( - $barrel 1 ) = this will remove that 1 barrel out of your inv