Raised This Month: $ Target: $400
 0% 

Is it possible to attach a sprite to a non-player model?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 06-30-2004 , 15:29   Is it possible to attach a sprite to a non-player model?
Reply With Quote #1

I know there is the TE_PLAYERATTACHMENT which allows you to attach a sprite to a player.

But can I spawn a model somewhere on a map (empty/blank). And then attach a sprite to it? Or am I just going to have to make my sprite into a model?

Josh
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Ryan
Senior Member
Join Date: May 2004
Location: NH, USA
Old 06-30-2004 , 17:44  
Reply With Quote #2

I believe with TE_PLAYERATTACHMENT, as the name states, you can only attach the sprites to a player, and not any entity.

However, you can attach a sprite or model to any entity with the following code.

Code:
new iEnt = create_entity( "someclassname" ); // .. do your entity properties here // here is where you want to set your offsets new Float:fOrigin[3]; entity_get_vector( iSomeOtherEnt, EV_VEC_origin, fOrigin ); // .. Offsets (here we'll use only a z-offset, so the model/sprite appears above the entity) fOrigin[2] += 20.0; entity_set_origin( iEnt, fOrigin ); // now set the entity to follow an existing entity entity_set_int( iEnt, EV_INT_movetype, MOVETYPE_FOLLOW ); entity_set_edict( iEnt, EV_ENT_aiment, iSomeOtherEnt );

Thing to note is that the really only reliable way to follow an entity is by giving it a z-coordinate only, since any x/y coord will not rotate with the player when their angles change.

Hope this helps.
__________________
Warcraft 3: Expansion
Homepage | Downloads | Forums
Ryan is offline
Send a message via AIM to Ryan
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:54.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode