random

Game Editor comments and discussion.

random

Postby I robot » Sun Aug 19, 2007 12:19 am

can any one tell me the code for random create actor? :?: :?: :?: :?: :?: :?: :?: :?: :?: :?: :?: :?:
La La La oh uhh Hi...


...aww i burnt my toast :(


check out j maker's website at

http://www.freewebs.com/gameplanetonline
User avatar
I robot
 
Posts: 11
Joined: Fri Jun 22, 2007 3:50 pm
Location: computer chip
Score: 3 Give a positive score

Postby d-soldier » Sun Aug 19, 2007 12:59 am

Slap this into the event you wish to do the creating, and fill in the blanks below.

int n;
n=rand(5);
if (n==0)
{
//insert create actor script here
}
if (n==1)
{
//insert create actor script here
}
if (n==2)
{
//insert create actor script here
}
if (n==3)
{
//insert create actor script here
}
if (n==4)
{
//insert create actor script here
}
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby I robot » Sun Aug 19, 2007 1:02 am

Thanks :mrgreen: :mrgreen: :D :D :mrgreen: :mrgreen:
La La La oh uhh Hi...


...aww i burnt my toast :(


check out j maker's website at

http://www.freewebs.com/gameplanetonline
User avatar
I robot
 
Posts: 11
Joined: Fri Jun 22, 2007 3:50 pm
Location: computer chip
Score: 3 Give a positive score

Postby Troodon » Sun Aug 19, 2007 11:38 am

d-soldier wrote:Slap this into the event you wish to do the creating, and fill in the blanks below.

int n;
n=rand(5);
if (n==0)
{
//insert create actor script here
}
if (n==1)
{
//insert create actor script here
}
if (n==2)
{
//insert create actor script here
}
if (n==3)
{
//insert create actor script here
}
if (n==4)
{
//insert create actor script here
}


This is off-topic but can the 'int n' be used with the switch function? If yes, it would be shorter wouldn't it? I never adopted the switch code for some unknown reason.
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby d-soldier » Sun Aug 19, 2007 3:44 pm

I never adopted the switch code because I have to idea how to use it... :D So maybe it would... I dunno.
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby Jay S. » Sun Aug 19, 2007 4:13 pm

tekdino wrote:can the 'int n' be used with the switch function? If yes, it would be shorter wouldn't it? I never adopted the switch code for some unknown reason.

I think it can... just tried this code out and it worked:
Code: Select all
int n=0;
switch(n)
{
    case 1:
    //stuff...
    break;
    case 2:
    //more stuff...
    break;
}
User avatar
Jay S.
 
Posts: 118
Joined: Thu Apr 26, 2007 6:51 pm
Location: My computer desk. :P
Score: 9 Give a positive score

Postby I robot » Fri Aug 24, 2007 6:01 pm

thanks all :D :D :D :D :D :D :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :D :mrgreen: :mrgreen:
La La La oh uhh Hi...


...aww i burnt my toast :(


check out j maker's website at

http://www.freewebs.com/gameplanetonline
User avatar
I robot
 
Posts: 11
Joined: Fri Jun 22, 2007 3:50 pm
Location: computer chip
Score: 3 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron