Page 1 of 2

How to make a working quest.

Posted: September 15th, 2010, 8:24 pm
by daltonds1
I couldnt get the post working on wiki so i post here


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
To explain

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
Now to explain
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 )
This mean
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

Re: How to make a working quest.

Posted: October 1st, 2010, 6:23 am
by PizzaLover101
Cool, you really are a helpful person on the SB Forum!

Re: How to make a working quest.

Posted: October 1st, 2010, 8:26 pm
by chocolatepie33
PizzaLover101 wrote:Cool, you really are a helpful person on the SB Forum!
I know. He needs to be on support team #2 if we ever get one.

don't forget, once a map is saved, you can edit the .cfg inside sandbox by using F6 in edit mode.

Re: How to make a working quest.

Posted: March 1st, 2011, 10:03 am
by Jaso55
This is not working for me at all i followed all of your instructions but the npc is just standing there and you see him only move with his hands and i cant even pick up the barrel and when i press escape for the menu i see no inventory button in it.
I tryed to run also the script with f6 but that didnt work either i just did what you told me like giving the barrel the trigger etc.
But you said it was the (3) Number but when i change that the level trigger isnt changing but the type of it does....
So explain what i did wrong.

{Edit}: And i didnt quite understand you with the cfg file because in what program you need to make it?
i just made it in notepad++ but when i do save as there is no type like cfg so i just putted the file in a normal text file like this: my first map.cfg did i do this good?

Re: How to make a working quest.

Posted: April 6th, 2011, 7:33 pm
by daltonds1
Jaso55 wrote:This is not working for me at all i followed all of your instructions but the npc is just standing there and you see him only move with his hands and i cant even pick up the barrel and when i press escape for the menu i see no inventory button in it.
I tryed to run also the script with f6 but that didnt work either i just did what you told me like giving the barrel the trigger etc.
But you said it was the (3) Number but when i change that the level trigger isnt changing but the type of it does....
So explain what i did wrong.

{Edit}: And i didnt quite understand you with the cfg file because in what program you need to make it?
i just made it in notepad++ but when i do save as there is no type like cfg so i just putted the file in a normal text file like this: my first map.cfg did i do this good?
Its outdated

Re: How to make a working quest.

Posted: July 13th, 2011, 2:30 pm
by qdogbondo
this is really helpful does this apply to FPS mode ?

Re: How to make a working quest.

Posted: July 14th, 2011, 9:09 am
by arcones
In essence it should still work, however, it was made for 2.5 and not 2.6< so there is a possibility of bugs in the script.

Re: How to make a working quest.

Posted: July 14th, 2011, 11:47 am
by daltonds1
~THIS IS OUTDATED~

I'll update later

Re: How to make a working quest.

Posted: July 14th, 2011, 5:55 pm
by chocolatepie33
good to see you're still around, last I checked there weren't any major differences in the syntax for Cubescripts, the script should work.

Re: How to make a working quest.

Posted: July 19th, 2011, 6:37 pm
by DrChef
the trigger type should be 11 for npcs
and 12 for the barrel