Hi, I have run into a problem when getting the size of an entity at runtime (code).
What I am trying to do:
I have some vehicles that spawn in a certain place one after the other. what I want to do is make them wait before moving till the new car "fits" behing the car in front of it.
In pseudocode it would be something like this:
action Car_Move (ENITY* Previos_Spawn)
{
make me passable and invisible;
var my_size = get_my_length(me); //get my size
var preceding_size = get_my_length(Previous_Spawn); //get car in front size
var Distance; //store distance
while(1)
{
Distance = abs(my.x - Previous_Spawn.x); //calculate distance
if(Distance > ((my_size.x / 2) + (preceding_size.x / 2))) //compare distance with vehicle sizes to see if I fit
{
make me visible;
make me non-passable;
my.x++; //move forward
}
wait(1);
}
}
Does anyone know what I can use to make the function "get_my_length(ENTITY*)" ?
And how to use "my_size" and "preceding_size" in "action Car_Move(ENTITY*)" ?
I would apreciate any help or hints to achieve this