Action on group entity

Posted By: harry3174

Action on group entity - 01/07/08 04:08

Hi,

I have taken four sphere as entity.I want to
group them and give action on group, as mouse move they rotate.Also want to
give action on each sphere entity.
Is it possible ? How ?

Please help
Posted By: ultranet

Re: Action on group entity - 01/07/08 06:19

I think you could assign the four spheres to the same ENTITY pointer.
e.g.
ENTITY* sphereGroup;

action sphereAction()
{
me=sphereGroup;
.....
}

Then when you use sphereGroup, it refers to the four spheres.
Posted By: harry3174

Re: Action on group entity - 01/10/08 09:20

Hi,
I have take 4 earth.mdl.Group them and rename "spg".
In wed i take my mouse_move.wdl from map properties.
In which Ihave move_me_by_mouse action.
when i chose spg group and go to its properties,
behaviour option doesnt come.
How can i assign action from choose action on spg group ?

Please help.
Posted By: Futurulus

Re: Action on group entity - 01/12/08 17:54

I would probably make an invisible entity in between them, assign that the mouse move action, then make the spheres' action just a loop that keeps them into the same place relative to the mouse_move entity.
Code:
// !untested!
var invisible_ent;

// assign this to another entity -- doesn't matter what, you won't see it
action move_me_by_mouse
{
my.invisible = on;
my.passable = on;
invisible_ent = me;

// your mouse move code
}

action sphere
{
while(invisible_ent == NULL)
{ wait(1); }
you = invisible_ent;

vec_set(my.skill50, my.x);
vec_sub(my.skill50, your.x);
while(1)
{
vec_set(my.x, your.x);
vec_add(my.x, my.skill50);
wait(1);
}
}

EDIT: I don't think you can assign an action to a group in WED, only individual entities.
Posted By: Ottawa

Re: Action on group entity - 01/18/08 00:34

Hi!

If you assign to each entity in WED the same action...you get 4 entities that
do the same thing at the same time. (a group)

If you want to give one of them a "bigger Spin" assign a number to a skill
In your script you can find this entity with "handle".

Hope this helps
Ottawa
© 2024 lite-C Forums