Page 1 of 1

Making quests and items

Posted: September 5th, 2010, 4:04 pm
by mack635
Hey i was wondering How you can make storylines,quests,weapons,Npcs to attack you, Npcs to Own Merchandise On the stores you make. And How you can attatch maps together or make it online, Thanks For Your Suport.

Re: Making quests and items

Posted: September 5th, 2010, 5:22 pm
by chocolatepie33
Most of this stuff is related to a map's configuration file, where you can add this stuff.

In-game, (assuming you know how to add a mapmodel), you can use f3 to change a mapmodel's trigger type and level trigger, then use the configuration file to add effects like what you're talking about. To edit a .cfg file, save your map, then go to f6 in edit mode to edit it. Once you save it, it's Mapname.cfg in the mystuff/packages/base folder (note: it's NOT Mapname-art.cfg!!!)

A script to have a character talk would be:

Code: Select all

level_trigger_1 = [showgui dialogue]
newgui dialogue [
guitext "Hi."
guibar
guibutton "Uh... Hi?" [cleargui]
guibutton "What's up?" [cleargui]
]
The command showgui pulls up the menu, while newgui is what's shown. Guitext is what's printed/typed out, so you can read it. Guibar makes a horizontal (left-right) bar, and guibutton is a clickable button for choices/options. Cleargui is a command that closes the menu.

If you look around the wiki (@ http://sandboxgamemaker.com/wiki/index. ... =Main_Page) and the tutorials and support forums here, you can find a lot of stuff like this. Good Luck.

Re: Making quests and items

Posted: September 5th, 2010, 6:18 pm
by mack635
Ok thanks, and One more question is tis program is it possible to make the Npc Hold, merchandise and acctualy sell it?

Re: Making quests and items

Posted: September 5th, 2010, 9:15 pm
by chocolatepie33
You can't actually have the NPC's model hold an item and give it to you, but you can make a shop script.
The script would be something like this:

Code: Select all

on_start = [
dollars = 0
cookies = 0
cakes = 0
]
level_trigger_1 = [ money = ( + $money 5 ) ]
level_trigger_2 = [showgui ShopKeeper]
newgui ShopKeeper [ 
guitext "What would you like?"
guibar
guistayopen [
guibutton "Cookies: 2 for $5" [ if ( >= $money 5 ) [cookies = ( + $cookies 2 )  money = ( - $money 5 ) ] ]
guibutton "Cakes: 1 for $5" [ if ( >= $money 5 ) [cakes = ( + $cakes 2 ) money = ( - $money 5 ) ] ]  
]
guitext "Anything else?"
guibar
guibutton "No sir." [cleargui]

newgui inventory [
guitext ( format "You have %1 dollar(s)." $money )
guitext ( format "You have %1 cake(s)." $cakes )
guitext ( format "You have %1 cookie(s)." $cookies )
]

newgui main [
        guilist [
           guilist [
              guibutton "inventory" [showgui inventory]
           ]
        ]
        guibar
        @main
     ]
The command on_start lets you initialize and set amounts of items. The command used in level trigger 1 adds 5 dollars to your wallet. The command guistayopen [ ] makes it so guibuttons don't close guis. The code after the guibuttons checks to see if there's enough money, then adds/subtracts items as needed. The code %1 items calls up the number of items there are. The last bit of code, newgui main [ ] adds a section to the top of the main menu (the ESC button) that gives you a button to show inventory.

Also: One last thing here: Please post your questions in the Support section, not the chat section.