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.

What is the syntax for creating a method?

Having issues not related to a specific Sandbox game mode? Get help here!
Please also read the rules for support when posting support requests.
Failure to comply with the forum rules may result in your topic being locked without resolution.
Locked
User avatar
Venima
Support Team
Support Team
Posts: 259
Joined: February 17th, 2010, 4:56 am
Name: Tombstone
IRC Username: Venima
Location: Somewhere in the eternal planes between the living and the dead

What is the syntax for creating a method?

Post by Venima »

What is the syntax for creating a method?

To show you roughly what I mean, newgui <name> [] creates a gui. But I want to run a block of code that doesn't have a gui, but does have a name.

What is the syntax for:

1. Creating the method (e.g. in C++ it would be something like void <name> {etc.})

2. Calling the method (e.g. in C++ it would be <name>();)
Tombstone's Tournament round 2 has begun! Tombstone's Posting Tournament

Try out my: CFG Easy Text Editor (Note: still in beta)

-----Venima
Image
Image
Hirato
Developer
Developer
Posts: 689
Joined: May 30th, 2009, 1:23 pm
IRC Username: hirato

Re: What is the syntax for creating a method?

Post by Hirato »

in cubescript these are called aliases. the proper term for those things in other programming languages, is function.
there are plenty of examples here http://sandboxgamemaker.com/wiki/index. ... Cubescript

Code: Select all

  myalias = [echo hi!]
  myalias
I'll write something a bit later regarding arguments
This is not a url, clicking it is pointless
User avatar
Venima
Support Team
Support Team
Posts: 259
Joined: February 17th, 2010, 4:56 am
Name: Tombstone
IRC Username: Venima
Location: Somewhere in the eternal planes between the living and the dead

Re: What is the syntax for creating a method?

Post by Venima »

ahhh right...that makes sense now thanks.
Tombstone's Tournament round 2 has begun! Tombstone's Posting Tournament

Try out my: CFG Easy Text Editor (Note: still in beta)

-----Venima
Image
Image
Locked