Page 1 of 3
Scripting
Posted: August 10th, 2010, 4:26 pm
by owenisred
Hi everyone,
I have (I think) become proficient in using all the sandbox's tools that dont require scripting. However I need to know more
I understand that no one is going to spell out a massive scripting tutorial for me. However would it be possible if someone could show me an example of a script, and what it does. Ill try to figure out what it all means, and I'll come back to you with plenty of questions
Thanks in advance,
Owen.
Re: Scripting
Posted: August 10th, 2010, 4:32 pm
by Bigboss
Yeah I cant script either...
IDK how to either

:D:
Re: Scripting
Posted: August 10th, 2010, 5:00 pm
by PizzaLover101
Go on the Wiki
http://sandboxgamemaker.com/wiki/index. ... =Main_Page
or look in the tutorials for scripts
or if you really want one, here's a menu script
Code: Select all
newgui Name [
guitext "Hi, I'm a menu, continue?" chat
guibar
guibutton "Yes"
guibutton "No" ]
Yes = [map mapname]
No = [echo "^fs^f3Have Fun!^fr"]
level_trigger_1 = [showgui Name]
Re: Scripting
Posted: August 10th, 2010, 5:49 pm
by chocolatepie33
hmm... I always thought it was more like this...
Code: Select all
level_trigger_1 = [showgui npc1-1]
newgui npc1-1 [
guitext "Hi."
guibar
guibutton "Hi. What's up? [showgui npc1-2]
guibutton "Ehh... Hi?" [showgui npc1-3]
] "Random person"
If Yes and No are outside of the [], they wouldn't be recognized, would they?
If you haven't seen the "Random Person", that replaces npc1-1. Look at the village configuration file.
Re: Scripting
Posted: August 10th, 2010, 6:29 pm
by PizzaLover101
actually, it works. It's just like that for the whole script, but it doesn't work for my the way you did for some reason
Re: Scripting
Posted: August 11th, 2010, 3:17 am
by owenisred
Thanks for your responces!
Ah I am the biggest idiot ever. I have been on that page so many times looking for tutorials, and I didn't see the
TUTORIALS part... Thanks anyway
So.....
Say I have written my script... How do I impliment that in my game...?
How do I trigger a level trigger?
Thanks once again,
Owen.
Re: Scripting
Posted: August 11th, 2010, 6:12 am
by owenisred
Oh is it the trigger tag of a mapmodel that correlates to the trigger level number in the script? (Edit - yea it is I just tested it

)
If so can the number of trigger tags go above 100, or would there never be that many scripts in a level anyway or what lol...
Sorry about the number of questions, just really trying to bet my head around this :S
Thanks again,
Owen.
Re: Scripting
Posted: August 11th, 2010, 7:02 am
by Bigboss
that sounds right and its OKAY! I'm a noob too

Ive prolly asked OVAH NINE THOUSAND! questions last month...
thats why I procrastinate w/ forum games in Off Topic
Re: Scripting
Posted: August 11th, 2010, 7:45 am
by owenisred
Ok so can the number of trigger tags go above 100?
The brunt of cubescript is concerned with Aliases. Aliases have 3 basic uses.
store lists and values for extended periods of time
store temporary lists and values
grouping a set of commands which are useful when combined
I understand the last one now I think:
You would type
Level_Trigger_X //where X is the Trigger tag number
Any ideas about the first two?
Re: Scripting
Posted: August 11th, 2010, 7:53 am
by owenisred
Ok so can the number of trigger tags go above 100?
The brunt of cubescript is concerned with Aliases. Aliases have 3 basic uses.
store lists and values for extended periods of time
store temporary lists and values
grouping a set of commands which are useful when combined
I understand the last one now I think:
You would type
Level_Trigger_X = [ //where X is the Trigger tag number of the object in the game you are attaching a trigger to
command 1 //where the commands are basic things like echo etc. (is there a proper list of these?)
command 2
command3
]
Then in game you would find an object, set its trigger type 0-29 each one acts in a different way when you come near it, and set its trigger tag to X.
Then the commands will be carried out... ok...
Any ideas about the first two?
Also can you create your own trigger types? (Ambitious?)
Thanks,
Owen.