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.

Shop Example Script

Learn more on how to use Sandbox, or submit your own tutorials or resources.
User avatar
Eagle
Member
Member
Posts: 148
Joined: December 15th, 2009, 11:40 pm
Name: Vickie Eagle

Re: Shop Example Script

Post by Eagle »

This is outstanding! thank you so much!

Always~
Vickie ;)
I put time in a bottle ... just saying :))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
User avatar
PizzaLover101
Member
Member
Posts: 1751
Joined: October 23rd, 2009, 1:33 pm
Name: NAME
IRC Username: DaItsicle
Location: By a computer
Contact:

Re: Shop Example Script

Post by PizzaLover101 »

is there any way you can put this into 2.6, ya know, just click a button, and Poof, it's there?
Project 1: Da Chest Collector [TBD]
Project 2: Tis a secret [End of summer] announcement June 22 2011
Project 3: An even bigger secret!

http://pizzagametime.tk/
http://forums.pizzagametime.tk/
User avatar
GR1M
Support Team
Support Team
Posts: 1305
Joined: August 22nd, 2009, 4:35 pm
Name: Luke
IRC Username: Gr1m
Location: Texas
Contact:

Re: Shop Example Script

Post by GR1M »

Some one has to make the script to do that.
Image
Want a user bar like this one? PM Leo
User avatar
klimyriad
Support Team
Support Team
Posts: 969
Joined: December 23rd, 2009, 1:43 pm
Name: liam
Contact:

Re: Shop Example Script

Post by klimyriad »

HI i trying to put the scripted to sandbox how do i do it
Firstspace the attack Progress. Image
Maps= Image finishing the town of hisal map.
Models and textures Image Just started finding these.
Menus, script's and other stuff. Image
User avatar
Leo_V117
Support Team
Support Team
Posts: 1640
Joined: February 16th, 2010, 8:00 pm
Name: Leo
IRC Username: Leo_V117
Location: That one place...
Contact:

Re: Shop Example Script

Post by Leo_V117 »

heh. Did someone say "Someone has to make a script for that"? A script for what? If its an app or module. im willing to code it in.
the game masters G.D
Member
Member
Posts: 13
Joined: April 11th, 2010, 8:01 pm
Name: spencer

Re: Shop Example Script

Post by the game masters G.D »

can you use the sword
User avatar
Leo_V117
Support Team
Support Team
Posts: 1640
Joined: February 16th, 2010, 8:00 pm
Name: Leo
IRC Username: Leo_V117
Location: That one place...
Contact:

Re: Shop Example Script

Post by Leo_V117 »

Nope. Weapon implementation is currently unnavailable.
Harrison
Member
Member
Posts: 1
Joined: June 30th, 2010, 12:34 am
Name: Harrison

Re: Shop Example Script

Post by Harrison »

Hello guys I'm a little knew here. I was reading this thread and I noticed that he said he could not figure out how to make the shopkeeper say if he didn't have enough money. Well lucky for you guys I know a little programing :D . I'm positive this will work.

Code: Select all

    "on_start" = [
       money = 0
       pie = 0
       sword = 0
       treasure = 0
       ]

    "level_trigger_1" = [ money = ( + $money 5 )
       echo "You got 5 moneys."
       ]

    "level_trigger_2" = "showgui Shopkeeper"

    newgui Shopkeeper [
       guitext "What're ya buyin, stranger?" chat
       guibar
       guilist [
          guibutton "Pie: 10 moneys" [
             if ( > $money 9 ) [
                money = ( - $money 10 )
                pie = ( + $pie 1 )
             ]
            else if ( < $money 10 ) [
               guitext "Sorry, you don't have enough money to buy this." chat
            ]
          ]
          guibar
          guibutton "Sword: 20 moneys" [
             if ( > $money 19 ) [
                money = ( - $money 20 )
                sword = ( + $sword 1 )
                ]
             else if ( < $money 20 ) [
               guitext "Sorry, you don't have enough money to buy this." chat
            ]
             ]
          guibar
          guibutton "Treasure: 40 moneys" [
             if ( > $money 39 ) [
                money = ( - $money 40 )
                treasure = ( + $treasure 1 )
                ]
            else if ( < $money 40 ) [
               guitext "Sorry, you don't have enough money to buy this." chat
            ]
             ]
       ]
    ]

    newgui Inventory [
    guibutton "Back" "cleargui 1"
    guibar
    guitext ( format "You have %1 moneys in your wallet." $money )
    guitext ( format "You have %1 pies.  Yum." $pie )
    guitext ( format "You have %1 swords.  Not that you can use them..." $sword )
    guitext ( format "You have %1 treasures.  Lucky you!" $treasure )
    ]

    newgui main [
       guilist [
          guilist [
             guibutton "Inventory" "showgui Inventory"
          ]
       ]
       guibar
       @main
    ]


Try that out. ;) all you had to do was add

Code: Select all

            else if ( < $money 10 ) [
               guitext "Sorry, you don't have enough money to buy this." chat
            ]
after everything. How easy was that? :mrgreen:
arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Shop Example Script

Post by arcones »

:lol: Well, most of us knew what was needed but thanks anyways ;)
Image
Want a user bar like this one? PM Leo!
User avatar
Leo_V117
Support Team
Support Team
Posts: 1640
Joined: February 16th, 2010, 8:00 pm
Name: Leo
IRC Username: Leo_V117
Location: That one place...
Contact:

Re: Shop Example Script

Post by Leo_V117 »

Quick Note Harrison... Change it to this:

Code: Select all

                 else if ( < $money 10 ) [
                   echo "Sorry, you don't have enough money to buy this!"
                ]
That way it tells you instead of opening a new gui
Post Reply