Author Topic: How to check if a projectile is still alive  (Read 924 times)

How do you check if a projectile is still alive?

if(isObject(projectileid))?

if(isObject(projectileid))?

This man here knows what he's talking about.

Now, teeeeechnically, Blockland recycles object IDs when it runs out, so it's possible for there to be a new object using the same ID. However, the chances of that happening before you check if the projectile still exists are roughly zero.

...Now, teeeeechnically, Blockland recycles object IDs when it runs out...
No it doesn't?

What happens when it runs out? It crashes? It would make sense for it to recycle them.

What happens when it runs out? It crashes? It would make sense for it to recycle them.
why would it run out

Because Torque runs out of numbers to assign? I honestly have no clue, I've just heard that it can.

What happens when it runs out? It crashes? It would make sense for it to recycle them.
If I'm not mistaken, an objects ID can go up to 2,147,483,647. (Highest number you can get with int32. If Blockland was a 64bit program it could even go up to 9,223,372,036,854,775,807! Now think about that.)
Even then it'd roll over to the negatives, not sure if a objectID can be negative though.
« Last Edit: December 28, 2011, 12:00:58 AM by Khepri »

They do recycle (last time I heard anyways), but you're not ACTUALLY going to be writing an object's ID in script anyways.

There is also zero chance of two objects having the same ID. There wont ever be a conflict.

If I'm not mistaken, an object's ID can go up to 2,147,483,647.

I thought object IDs could only go up to 9999999.
I'll have to test later.

ObjectID's cannot be negative.
But okay, isObject. will do. Locking topic!