Setting a variable to a random number?

Have any questions or problems in making your game, subscribing and/or using our software? Post here.
Forum rules
Make sure you are using the newest version. This can be downloaded at the top of the site via the "downloads" link.

Use a very good subject. "Problem" or "Help" are unacceptable titles.

Use the search feature before posting a question, as the answer is probably already here.

Subscript out of range error 9: This is a generic error, and we'll need way more information than that to figure out the problem. If you get this, strongly consider following the instructions of submitting your project through the Submit Bug feature within the editor.
Halstrom
Junior Member
 
Joined: Sat Jan 06, 2018 3:37 pm

Setting a variable to a random number?

Postby Halstrom » Thu Jan 18, 2018 1:40 am

In the add script thing I basically want:

If MagicPoints <= 0
Set MagicPoints to RND(1-100)
Endif

I can't seem to find a function to set an Actor Variable to a random number.

User avatar
AnvilHouse
001 Support
 
Joined: Mon Mar 04, 2013 1:19 am
Location: Wisconsin, USA

Re: Setting a variable to a random number?

Postby AnvilHouse » Thu Jan 18, 2018 1:50 am

What you are looking for is Actor Variable operation under the Actors category, then with it open click the square use value button, lastly under the math category there should be a random number use value that you can select

If it doesnt show up check the Show all box at the bottom, and make sure in the top left corner you have the highest scripting level enabled (the signal bar looking things)
Image Image Image

https://www.patreon.com/Anvilhouse ...yes...I am on Patreon!


-The store is under construction-
All items are guaranteed to work with 001 ;)

Halstrom
Junior Member
 
Joined: Sat Jan 06, 2018 3:37 pm

Re: Setting a variable to a random number?

Postby Halstrom » Thu Jan 18, 2018 2:15 am

Cool, thanks for quick reply :)


Return to Technical Support Questions

Who is online

Users browsing this forum: No registered users

cron