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 multiply and divide?

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 multiply and divide?

Post by Venima »

New question: I've tried doing

Number1 = (* $Number1 4)

or Number1 = (/ $Number1 2)

it doesn't recognise the syntax. Can I have the symbols for multiply and divide? Also, what language does sandbox use? Maybe that would help if I come across anything else syntax related.



Old question: Say I want to make you play a guessing game with an npc, and you have to guess the right number. How can I make the right number be random? Just looking for the syntax
Last edited by Venima on February 17th, 2010, 5:40 pm, edited 3 times in total.
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: How do I create a randomly generated number?

Post by Hirato »

rnd x will return a pseudo-random number between 0 and x - 1

the functionality is used in a great many places
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: How do I create a randomly generated number?

Post by Venima »

so for example I could do:

chosen_number = rnd 4 (the range being 0 to 3)
or
chosen_number = (+ $chosen_number rnd 4)

right?
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
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 multiply and divide?

Post by Venima »

New question
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
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: How do I create a randomly generated number?

Post by Venima »

Hirato wrote:rnd x will return a pseudo-random number between 0 and x - 1

the functionality is used in a great many places
Ok for anyone else reading this you have to put rnd x withing brackets e.g. (rnd 10)
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