Page 1 of 1

Activation Event to all clones

PostPosted: Tue Apr 22, 2008 9:29 pm
by jimmynewguy
Is there a way to send an activation event to an actor and all its clones, like how ever many are there at the moment because the number will increase or decrease throughout the game :lol: I know its confusing so if you dont understand i can further explain :D thnx :mrgreen:

Re: Activation Event to all clones

PostPosted: Wed Apr 23, 2008 5:01 am
by DST
just pass a variable instead. Normally I have a control actor that takes care of most things...send the activation event to him, and have him direct the actors.

As in ActivationEvent> DestroyActor("Actorname");

all actors with that name will be affected.

Just out of curiosity, what were you wanting the clones to do?

Re: Activation Event to all clones

PostPosted: Thu Apr 24, 2008 2:13 am
by jimmynewguy
I want the clones to move to the mouses position if they are "selected" ( :roll: RTS :roll: ) its a chalange but it helps my coding experience

Re: Activation Event to all clones

PostPosted: Thu Apr 24, 2008 4:11 am
by DST
Well if they are like, say, puzzle pieces....You can simply add an event "mousebuttondown", choose 'enable drag' from the list in the mousebuttondown window, and add a script editor containing nothing but //
Now you can click and drag the object around.

there are other ways...it depends on what selection method you are using for selecting the clones....

Re: Activation Event to all clones

PostPosted: Fri Apr 25, 2008 7:47 pm
by jimmynewguy
Sending it to "Actor" doesn't work, i need all its clones, :| I'm probably just confusing you, here ill explain
you have a filled region "area" and three actors "human" mouse button down on area<send activation event to all clones of human
then on human<activation event from area<if select = 1<move to mouse position :mrgreen:

Re: Activation Event to all clones

PostPosted: Sat Apr 26, 2008 6:21 am
by DST
This is a hard question to answer because i'm still not sure what you want to do. In programming there are 10 ways to do everything but their results vary slightly.

Here's what i mean:
When you click the selection area, do you want only the clones inside that area to come to the mouse, or all clones everywhere?
Are the clones allowed to move to the mouse in any other way than clicking selection? What are the clones doing when they're not moving to the mouse? What are the clones doing when they're not in the selection region?
You say only its clones...is there a human.0 that you don't want to move to the mouse?
Do they need to stop when meeting each other? If not, they'll all pile up under the mouse and you'll only be able to see the top one.

For instance, I had no problem making them all come running, by using this:
Code: Select all
MoveTo("actorname", xmouse, ymouse, 10, "view", "");

On mousebutton down in filled region.

But I have a feeling that there are more selection rules to be met before a clone qualifies, right?
I know this seems less than helpful, but the more I code the more I desire the script to be 'the quickest route between two conditions'. I try not to 'rig' things anymore, but in order to do it, I have to have a clear picture of what i want to do, and the rules that surround that action.

Re: Activation Event to all clones

PostPosted: Sat Apr 26, 2008 8:45 pm
by jimmynewguy
ok cut,dry, and simple;
I want the clones of human to move to the mouse location on mouse button down, but ony if they are selected :mrgreen:

Re: Activation Event to all clones

PostPosted: Sun Apr 27, 2008 2:20 pm
by DST
I can only assume that this would be used for a game along the lines of Age of Empires.....
So here is a demo that does this. Its not the best way as it requires draw actor events, and it might get bogged down if you had >100 humans onscreen, but like i said...it all depends on how ur using it, and the rules of ur game.

Click on an actor to select him, click again to deselect him.

Once selected, click anywhere to make him(them) move there.

I'm also investigating a more complex method but i'm not there yet so see if this one works for you.

Re: Activation Event to all clones

PostPosted: Mon Apr 28, 2008 7:29 pm
by jimmynewguy
thanx for sticking with me and understanding points ++ :D :lol: :mrgreen:

Re: Activation Event to all clones

PostPosted: Tue Apr 29, 2008 5:50 pm
by DST
Glad I could help!