Page 1 of 1

Target Lock...?

PostPosted: Sun Mar 28, 2004 9:17 pm
by linux_man007
Makslane, is possible to aquire the data members of another actor through a pointer?

I think this would create a lock-on feature.

Is there any way to target another actor?

PostPosted: Mon Mar 29, 2004 1:45 pm
by makslane
To get a pointer to any actor, use:

Actor *p = getclone("youractorname.0"); //you must put the clone index

Is there any way to target another actor?


What do you want?

PostPosted: Sat Apr 10, 2004 5:54 am
by linux_man007
What I want is to be able to click on another actor so that I can move the actor by clicking again somewhere on the screen, (if the actor player-controlled), or set the actor's target by clicking the mouse while it is hovering over the actor you want to target, so that the player may either interact with the actor(if it is friendly) or attack it(if it is an enemy).

Since the time I brought this subject up, I've been working on a target lock script.

What I believe I have to do for targeting an actor at coordinates x,y is this:

Actor *lock;

lock = getactor(x, y);

So, to target a clone by the name of 'monster.0', I type this:

Actor *lock;

lock = getclone("monster.0");

And to target the collide actor, I type this:

Actor *lock;

lock = &


Am I correct?

PostPosted: Sat Apr 10, 2004 1:59 pm
by makslane
A MoveTo action on the Mouse Button Down event don't solve this?

PostPosted: Sat Apr 10, 2004 5:30 pm
by linux_man007
Is the mouse button down event executed only when the mouse pointer hovers over an actor?

PostPosted: Sat Apr 10, 2004 8:20 pm
by makslane
Yes

PostPosted: Sat Apr 10, 2004 8:33 pm
by linux_man007
If I had a mouse pointer object follow the coordinates for the mouse,
and I used the global code:

Actor *lock;

lock = getactor(xmouse,ymouse)

The pointer called lock would point to the mouse pointer actor.

Am I correct?

PostPosted: Sun Apr 11, 2004 2:25 pm
by makslane
Yes, but you can try this:

When you mouse pointer actor receives a click, store the mouse coordinates, or xscreen and yscreen, and send an Activation Event to your other actors.

When the other actors receive the Activation Event from your pointer actor, do a MoveTo action to the stored coordinates