O Ilusionista
Captain 100K
I am trying to code a healing factor, which will heals the player from time to time.
I tried to use Modulus, but OpenBOR crashes. It isn't supported?
This is what I was doing (this is declared at SCRIPT):
I was trying using simple division, works, but not as I wanted to be:
Any idea?
I tried to use Modulus, but OpenBOR crashes. It isn't supported?
This is what I was doing (this is declared at SCRIPT):
void main(){
void self = getlocalvar("self"); //Get calling entity.
void health = getentityproperty(self,"health"); //get health
int time = openborvariant("elapsed_time");// get time
//int eta = openborvariant("game_speed")*0.5;
if ( time % 1000=0 )
{
changeentityproperty(self, "health", health+1);//add health
}
}
I was trying using simple division, works, but not as I wanted to be:
void main(){
void self = getlocalvar("self"); //Get calling entity.
void health = getentityproperty(self,"health"); //get health
int time = openborvariant("elapsed_time");// get time
//int eta = openborvariant("game_speed")*0.5;
if ( (time/1000)*2 )
{
changeentityproperty(self, "health", health+1);//add health
}
}
Any idea?