Raised This Month: $ Target: $400
 0% 

Follow Entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SentryIII
Junior Member
Join Date: Oct 2004
Old 10-29-2005 , 03:13   Follow Entity
Reply With Quote #1

I cant get this to work for the life of me, the entity doesnt follow the player. It only spawns at the players origin and sits there...

Code:
public view(id, target){     new Float:origin[3]     new entFollow = create_entity("info_target")         entity_set_string(entFollow, EV_SZ_classname, "follow_entity")         entity_set_int(entFollow, EV_INT_movetype, MOVETYPE_FOLLOW)     entity_set_int(entFollow, EV_INT_solid, SOLID_NOT)     entity_set_edict(entFollow, EV_ENT_aiment, target)     entity_get_vector(id, EV_VEC_origin, origin);     entity_set_origin(entFollow, origin)     attach_view(id, entFollow)         viewing[id]=true     return PLUGIN_HANDLED }

Heres the function to go back to the players own view which doesnt work either...
Code:
public client_command(id){     if(viewing[id]){         new button = get_user_button(id)         if(button & IN_USE ||button & IN_ATTACK){             attach_view(id, id)             viewing[id]=false         }     } }
SentryIII is offline
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 10-29-2005 , 04:14  
Reply With Quote #2

Get rid of these two lines:

Code:
entity_set_int(entFollow, EV_INT_movetype, MOVETYPE_FOLLOW)   entity_set_edict(entFollow, EV_ENT_aiment, target)

Apparently those are the lines that causes those errors. Instead you should constantly change the origin of the follow_entity, using client_PreThink.
__________________
GRR If only the amxmod programming were in Java.....
Java and C used to be two different languages, now Java is turning into another C. My logevent plugin
Batman/Gorlag is offline
MrDev
Member
Join Date: Sep 2005
Old 10-29-2005 , 17:30  
Reply With Quote #3

or even better. Register a think function for the entity and update it's position say ever 0.1s - See amx help on register_think.

if an entity of Classname[] thinks, its entity ID is forwarded to the named function
MrDev is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-29-2005 , 19:54  
Reply With Quote #4

any view function in AMXX seems to be messed up in both the engine and fakemeta modules even Eng_Fucn() calls....


Avalanche posted this a while back in bug reports so hopefullu it will be fixed in the next version of amxx
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
SentryIII
Junior Member
Join Date: Oct 2004
Old 10-29-2005 , 22:26  
Reply With Quote #5

Thanks for the nfo!
SentryIII is offline
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 10-30-2005 , 01:56  
Reply With Quote #6

The view functions are only messed up if you try to directly attach a view to a player. Otherwise it works just fine, to directly attach a view to non-player entities.
__________________
GRR If only the amxmod programming were in Java.....
Java and C used to be two different languages, now Java is turning into another C. My logevent plugin
Batman/Gorlag is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-30-2005 , 09:11  
Reply With Quote #7

No its still broken.... i would know...

If you dont belive me you can try out htis little script...
Attached Files
File Type: sma Get Plugin or Get Source (camera.sma - 818 views - 5.5 KB)
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Reply



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 23:42.


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