Sign in to follow this  
Followers 0
DEN

Possible random number of area in mission.sqm ?

4 posts in this topic

Is it possible ?
Randome number for use in variable  a and b in class marker

Example

rand = random(from x, to y);
a = rand;
b = rand;

 

Share this post


Link to post
Share on other sites
6 hours ago, DEN said:

Is it possible ?
Randome number for use in variable  a and b in class marker

Example


rand = random(from x, to y);
a = rand;
b = rand;

 

_a   = (2 + (round (random 3)));

_b   = (1 + (round (random 4)));

using just random will make a decimal number, round will round that to the nearest whole number, there is also floor (round down) and ceil (round up)

 

https://community.bistudio.com/wiki/round

1 person likes this

Share this post


Link to post
Share on other sites
Advertisement
15 minutes ago, red_ned said:

_a   = (2 + (round (random 3)));

_b   = (1 + (round (random 4)));

using just random will make a decimal number, round will round that to the nearest whole number, there is also floor (round down) and ceil (round up)

 

https://community.bistudio.com/wiki/round

Thank you

Share this post


Link to post
Share on other sites
23 minutes ago, DEN said:

Thank you

np

remember all private variables (local to that script) must start with an underscore or the server will think it a global variable

1 person likes this

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.