Hi! Welcome to the forum for Platinum Arts Sandbox Free 3D Game Maker. I currently have the forums locked as I am attempting to properly update them.

In the meantime please join the new Discord Server!

If you have any questions please e-mail me through the Platinum Arts website.

talking to a npc then him saying something after

Learn more on how to use Sandbox, or submit your own tutorials or resources.
Post Reply
daltonds1
Member
Member
Posts: 368
Joined: September 13th, 2010, 12:26 am
Name: Dalton
IRC Username: Daltonds1
Location: Tomball, Texas

talking to a npc then him saying something after

Post by daltonds1 »

So i posted help on how to do this but it was no help.

viewtopic.php?f=15&t=1845

Some people said it was impossible but it was not..
klimyriad wrote:ermm i done this with different maps like 1 map has 1 menu and a different map with a different menu but the way you want to do it i do not think it is possible.
I came up with my way to do it

This is what we will be doing



Lets start

First we want to open your maps .cfg
PlatinumArtsSandbox2.5\my_stuff\packages\base

After that

find this

Code: Select all

"on_start" = [
   coin = 1
   food = 0
   sword = 0
   treasure = 0
   hp = 0
   mp = 0
   barrel = 0
   book = 1
   ]
If you don't have it add this at the top

Code: Select all

"on_start" = [
   book = 1
   ]
This is basically just tells what you start with

Now we want to start.
Now find your GUI were your NPC talks... Now find the VERY LAST Gui he says...
this is mine

Code: Select all

newgui Buying [
   guitext "Ok, please but me 14 food, And bring it back" chat
   guitext "Heres the money also" chat
   guibar
      guibutton "Take Gold" 
]
Now
under

Code: Select all

guibutton "take Gold"
(MEANING YOUR BUTTON CODE)
your going to want to add this

Code: Select all

 if ( > $book  0 ) [
            book = ( - $book 0 )
            book = ( + $book 25 )
            ]
         ]
So it will look like this now

Code: Select all

      guibutton "Take Gold" [
         if ( > $book  0 ) [
            book = ( - $book 0 )
            book = ( + $book 25 )
            ]
         ]
Then the hole thing will be this

Code: Select all

newgui Buying [
   guitext "Ok, please but me 14 food, And bring it back" chat
   guitext "Heres the money also" chat
   guibar
      guibutton "Take Gold" [
         if ( > $book  0 ) [
            book = ( - $book 0 )
            book = ( + $book 25 )
            ]
         ]
]
Now were down wit this part
This will basically say If Book number is 0 or higher it will take 0 books away and add 25 so now the int is 26

now find the VERY FIRST thing he says

mine is this

Code: Select all

newgui Athely [
   guitext "I have a quest for you? Can you help?" chat
   guibar
   guibutton "Yes i can." "showgui quest"
   guibutton "No. not right now" "cleargui"
]
You going to want to add this

Code: Select all

         if ( > $book  25 ) "showgui ?" [
Above the first GUI TEXT so it looks like this

Code: Select all

newgui quest [
         if ( > $book  25 ) "showgui ?" [
   guitext "Can you buy something for me? Ill give money" chat
   guibar
   guibutton "Yes i can." "showgui Buying"
   guibutton "No. not right now" "cleargui"
]
Change showgui ? (? is the GUI name you want to show)

Have fun!
User avatar
Runescapedj
Member
Member
Posts: 1706
Joined: January 9th, 2010, 9:06 am
Name: Michiel
IRC Username: Sandboxdj
Location: Deventer, the Netherlands

Re: talking to a npc then him saying something after

Post by Runescapedj »

lol, I'm busy 4 a house 4 that map (benv helped 2), in co-op, I hope this'll be a good map
User avatar
goldstylez
Member
Member
Posts: 35
Joined: May 22nd, 2010, 11:40 am
Name: goldstylez
IRC Username: goldstylez

Re: talking to a npc then him saying something after

Post by goldstylez »

i gonna try=3
loooks difficult, but i think it's easy, if you do a few time.. :D
come to the dark side
we have cookies=3
Post Reply