Page 1 of 1
Target Lock...?
Posted:
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?
Posted:
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?
Posted:
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?
Posted:
Sat Apr 10, 2004 1:59 pm
by makslane
A MoveTo action on the Mouse Button Down event don't solve this?
Posted:
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?
Posted:
Sat Apr 10, 2004 8:20 pm
by makslane
Yes
Posted:
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?
Posted:
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