Raised This Month: $ Target: $400
 0% 

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


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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