Gamestudio Links
Zorro Links
Newest Posts
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, VoroneTZ, 1 invisible), 1,578 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Random actions #153062
09/09/07 21:19
09/09/07 21:19
Joined: Aug 2006
Posts: 152
vector(200,45,338)
Marwan Offline OP
Member
Marwan  Offline OP
Member

Joined: Aug 2006
Posts: 152
vector(200,45,338)
Hi, i've written a script that makes an entity do random actions , i give a variable a random value from 0 to 0.5 , each value between those gives the entity a random action to do , the problem i have is that the var re randomizes its value almost every frame , how can i make it randomize only one time with out stopping the current action given by its corresponding value??

Re: Random actions [Re: Marwan] #153063
09/09/07 22:14
09/09/07 22:14
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
save a random number in a variable then use it, instead ofalways using the random-instruction

Re: Random actions [Re: Scorpion] #153064
09/10/07 19:57
09/10/07 19:57
Joined: May 2006
Posts: 398
Bot190 Offline
Senior Member
Bot190  Offline
Senior Member

Joined: May 2006
Posts: 398
you could have another variable that is set to 1 when the entity is doing something then when its done it is set to 0.

Code:
Var Busy
var random

//code that gives the variable "random" a value

Function random1
{
busy = 1
//code for random actions
busy = 0
}
if busy == 1 && random = 1
{
random1()
}




Wait, there isn't a "Make My Game Now" button?
Re: Random actions [Re: Bot190] #153065
09/11/07 11:44
09/11/07 11:44
Joined: Aug 2006
Posts: 152
vector(200,45,338)
Marwan Offline OP
Member
Marwan  Offline OP
Member

Joined: Aug 2006
Posts: 152
vector(200,45,338)
thanks very much , i'll try to implement this , i hope i do it right


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1