Page 5 of 6

Re: Shop Example Script

Posted: January 31st, 2011, 7:18 am
by Dunstan
You can create a more graphical shop script and a more graphical directory by using the third parameter in "guibutton" and the second parameter in "guitext". It determines the icon, which is in front of your text. You can create 128x128 PNG images of the things your shop offers, and put it in a directory data/hud/xxx/icons/inventory. Then you can use these images like this:

Code: Select all

guitext ( format "You have %1 moneys in your wallet." $money ) "inventory/money.png"

or:

Code: Select all

           guibutton "Pie: 10 moneys" [
              if ( > $money 9 ) [
                 money = ( - $money 10 )
                 pie = ( + $pie 1 )
              ]
           ] "inventory/pie.png"

To determine xxx, which is the version of hud (which means heads up display, I think) you are using, try to use the modified script. If Sandbox doesn't find the images you specified, it gives an error message, which contains the full path to the icons directory.
You can also use these options to display the face of the character, who is talking to you:

Code: Select all

guitext "What're ya buyin, stranger?" "chars/shopkeeper.png"

Re: Shop Example Script

Posted: January 31st, 2011, 6:02 pm
by chocolatepie33
You can modify the gui, you know, such as adding your own icons and stuff... If that helps.

Re: Shop Example Script

Posted: February 1st, 2011, 3:56 am
by Dunstan
chocolatepie33 wrote:You can modify the gui, you know, such as adding your own icons and stuff... If that helps.


That is exactly what I wrote, although my intention was to amend the original, not to create a new one. It is not so difficult, so a beginner can also use it, and it will make the game nicer. ;)

Re: Shop Example Script

Posted: February 1st, 2011, 10:11 am
by arcones
I have to say, that's pretty nifty. Good work.

Arcones

Re: Shop Example Script

Posted: February 1st, 2011, 3:19 pm
by chocolatepie33
Dunstan wrote:
chocolatepie33 wrote:You can modify the gui, you know, such as adding your own icons and stuff... If that helps.


That is exactly what I wrote, although my intention was to amend the original, not to create a new one. It is not so difficult, so a beginner can also use it, and it will make the game nicer. ;)


Well, I mean you can create your own icons, not pulling up certain ones that are already there... like you could make a chicken icon if you needed to whereas the guis don't normally have one. But yeah, I think we're on the same page.

Re: Shop Example Script

Posted: February 2nd, 2011, 1:40 am
by Dunstan
It seems, the authors have thought about it as well: in the hud/2.3 there are robochimp and ogre icons. So, if you use an ogre as shopkeeper, put "ogre" in place of "chat", like this:

Code: Select all

guitext "What're ya buyin, stranger?" ogre

Re: Shop Example Script

Posted: May 14th, 2011, 9:24 am
by salomonders
Very Nice script why we not make a Anial Crossing like Tom nook?
This will be nice for kids.
Or lets make a mod for PAS Like Dopewars but in 3D and with a Big sized City

Scry for my English XD

Re: Shop Example Script

Posted: May 16th, 2011, 12:25 pm
by Leo_V117
Hey, pretty good work... For Rookies! =3

Lets see what else you can do!

Re: Shop Example Script

Posted: October 11th, 2011, 1:25 am
by joeSephALien
Great help Leo.
I've DL the EasyScriptBuilder, and I had a little problem making the script for the first time until I read this thread
viewtopic.php?f=9&t=2802.

Re: Shop Example Script

Posted: February 14th, 2012, 5:15 pm
by ArtFan
Hirato wrote:*grumble grumble*
docs are written not to be read
*grumble grumble*
http://sandboxgamemaker.com/wiki/index. ... FDecisions
*grumble grumble*

just keep in mind there's a 25 word limit, the command is the first so you can provide up to 24 additional arguments


Ahhh, thanks for clearing that up :mrgreen: