Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
attaching animated objects to one another #11124
12/03/02 08:16
12/03/02 08:16

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



I have a basic platform/elevator with normal vector animation applied to it. I would like to "attach" a vertex animated object (in this case a flag) to the elevator. Can this be done, either in WED or through code?

I have considered how to do it with code, but I am unsure how to tell the secondary object (the flag) to follow the movement of the platform. How can I get one object to watch the movement of another object? That doesn't seem like an option along with enable_scan, collide, etc.

Basically I need a good way to have hierarchy among level entities.

Thanks for any suggestions,
Pete
Spokane, WA
www.coercion.com

Re: attaching animated objects to one another #11125
12/03/02 16:29
12/03/02 16:29

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



There are different ways, but you have to code it. Here: a similar sample. In the office level the warlock holds his "stuff" in his hand. There you use a FUNCTION attach_entity();.

Re: attaching animated objects to one another #11126
12/05/02 04:48
12/05/02 04:48

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



thanks for the reply.

Yeah- I have seen attach_entity. Doing the actual attaching is no problem. What I don't know how to do is get pointers to the 2 nonplayers so that one object attaches itself to another one. It appears you can only get a pointer to an object in game if it takes part in some collision or scan or whatever. I just want to attach it to the other object automatically at startup.

Pete

Re: attaching animated objects to one another #11127
12/05/02 23:34
12/05/02 23:34

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



quote:
It appears you can only get a pointer to an object in game if it takes part in some collision or scan or whatever.
Principially yes (move/trace/scan)! But you only get YOU.X/Y/Z, YOU.PAN/TILT/ROLL values from the you pointer(or client, but forget that) and nothing else (like YOU.SKILL12, YOU.FLAG1, YOU.ALPHA and so on.... these values are "local"). (I call it big bullshit!!!).

In your example it should be possible, with trace/move/scan to realize your idea, I think. You also can touch the entity with our mouse (enable_touch), left_mouse click (enable_click), right_mouse click (enable_rightclick) for testing. If the event occures to the elevator, you only have to create a flag where ever you want. Does the following code can help????

code:
DEFINE _FLAG_POS_X, SKILL38;
DEFINE _FLAG_POS_Y, SKILL39;
DEFINE _FLAG_POS_Z, SKILL40;

...
...
IF (event_type == event_mouse)//I was touched by the mouse
{

MY._FLAG_POS_X = MY.X + ...;
MY._FLAG_POS_Y = MY.Y + ...;
MY._FLAG_POS_Z = MY.Z + ...;

ent_create(flag_mdl, MY._FLAG_POS_X, ....);
}

(I personally like testing with left mouse_click, if it runs without problem, I make it with move/trace or scan.)

Re: attaching animated objects to one another #11128
12/06/02 06:59
12/06/02 06:59

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



I'm surprised at how convoluted this would be, so I have just worked around it (in another convoluted way..) but thanks for the suggestion. I don't like the idea of relying on all these traces happening at startup to activate items attachments. seems like it would be too easy to scan the wrong object. Anyway, thanks for the help.

Pete

Re: attaching animated objects to one another #11129
12/06/02 07:36
12/06/02 07:36
Joined: Jul 2000
Posts: 8,973
Bay Area
Doug Offline
Senior Expert
Doug  Offline
Senior Expert

Joined: Jul 2000
Posts: 8,973
Bay Area
It is best to have the base object (the object with the other models attached to it) to create any attached object itself. Then you can be sure that it has the right YOU pointers.


Conitec's Free Resources:
User Magazine || Docs and Tutorials || WIKI
Re: attaching animated objects to one another #11130
12/11/02 08:16
12/11/02 08:16

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Ah-you are saying just do an ent_create. Yes, that would work, but the problem there is, I am trying to create some tools (actions) for our artists to use, where they can set up the scene visually how they would like, and then attach things (using skills or whatever).

I ended up just rewriting the platform action to also play vertex animation along with some other features that were necessary for our purposes.

Thanks,
Pete


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1