Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Test arrival of actor
Test arrival of actor
2003-06-01, 2:52 AM #1
Hi!
I'm wondering, how do I test if an actor has arrived at a ghost position if I say AISetMovePos(a_guy,GetThingPos(ghost));

/Edward
Edward's Cognative Hazards
2003-06-01, 4:59 AM #2
this way may work.
check the distance between the actor and the ghost pos and if it is <=0.1 then the actor is at that ghost pos. like this:
Code:
arrived:
  if(VectorDist(GetThingPos(actor), GetThingPos(ghost_pos0)) <= 0.1)
    {
    //-Actor is at ghost_pos(0), do something.
    return;
    }
  else
  if(VectorDist(GetThingPos(actor), GetThingPos(ghost_pos1)) <= 0.1)
    {
    //-Actor is at ghost_pos(1), do something.
    return;
    }
  etc.....
return;

the 0.1 might be able to be lower, but when i was testing this out the actor didnt get that close to the ghost_pos.
it works fine from my testing but if you use the same ghost_pos twice it may mess something up, and if two ghost_pos are too close to each other it could mess things up too.

------------------
Famous last words - "It seemed like a good idea at the time."

[This message has been edited by DSLS_DeathSythe (edited June 01, 2003).]
Famous last words - "It seemed like a good idea at the time."
2003-06-01, 5:35 AM #3
Hm... Didn't work. Maybe because I put GetSenderRef() to see if it is THAT guy. I have more than one guy in this COG. Help?

Some more info...
The actor is the size of an r5 unit, and the ghost is on the floor line (meaning if the floor is at pos Z=0, then ghost is pos Z=0)...

Code:
- = floor
* = ghost
a = actor

+----------------+
|                |
|                |
|                |
|               a|
+----*-----------+



[This message has been edited by Edward (edited June 01, 2003).]
Edward's Cognative Hazards
2003-06-01, 8:14 AM #4
have you tried putting the ghost_pos things up at like 0.1 from the floor?

put Print("arrived at pos"); at the top of the arrived message part. (just for while you are testing stuff)
if the "arrived at pos" never prints then your actors arent fully getting to the places you send them to, and that could be part of your problem.

------------------
Famous last words - "It seemed like a good idea at the time."

[This message has been edited by DSLS_DeathSythe (edited June 01, 2003).]
Famous last words - "It seemed like a good idea at the time."
2003-06-01, 3:17 PM #5
You might try raising the ghosts up to the same Z value that the actor has (or relatively close). Then you could compare the distance more accurately.

------------------
"The Just shall live by faith." - Galatians 3:11
To edit is human... To COG is divine!!
Catloaf, meet mouseloaf.
My music

↑ Up to the top!