Raised This Month: $ Target: $400
 0% 

Move Entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
victorngl
Member
Join Date: Feb 2011
Old 04-25-2013 , 01:40   Move Entity
Reply With Quote #1

how to move the entity forward based to where she pointed?
victorngl is offline
Send a message via MSN to victorngl Send a message via Skype™ to victorngl
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-25-2013 , 06:51   Re: Move Entity
Reply With Quote #2

Be more specific of what you want to do.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 04-25-2013 , 07:34   Re: Move Entity
Reply With Quote #3

Or try searching, i found around 10 useful threads.
EpicMonkey is offline
victorngl
Member
Join Date: Feb 2011
Old 04-25-2013 , 07:42   Re: Move Entity
Reply With Quote #4

[IMG]http://img37.**************/img37/6559/entbz.jpg[/IMG]

I want the entity to move to the opposite side of the player or a wall.
victorngl is offline
Send a message via MSN to victorngl Send a message via Skype™ to victorngl
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-25-2013 , 07:49   Re: Move Entity
Reply With Quote #5

No picture is worth a thousand words.
Give a detailed description if you'd like to be helped.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 04-25-2013 , 07:55   Re: Move Entity
Reply With Quote #6

Quote:
Originally Posted by hornet View Post
No picture is worth a thousand words.
Give a detailed description if you'd like to be helped.
I think:
When player moves towards an entity, the entity moves exactly the same way as the player.
Unkolix is offline
victorngl
Member
Join Date: Feb 2011
Old 04-25-2013 , 07:55   Re: Move Entity
Reply With Quote #7

I want an entity to move to the opposite side of the player.
I tested with velocity_by_aim, but if the player aim at the sky, the entity goes to sky, I want it only to move to the opposite side of the player.
victorngl is offline
Send a message via MSN to victorngl Send a message via Skype™ to victorngl
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-25-2013 , 08:36   Re: Move Entity
Reply With Quote #8

You should have posted what you tried so we wouldn't have to guess as much.

Is this what your after? ( Entity remains behind the player at all times? )
Code:
#include <amxmodx> #include <engine> #include <xs> #define DIST        100 #define THINK_TIME  0.05 new const g_szModel[] = "models/w_c4.mdl"; public plugin_init() {     register_clcmd( "say /create", "MakeEnt" );         register_think( "MyEnt", "EntThink" ); } public MakeEnt( id ) {     new iEnt = create_entity( "info_target" );         entity_set_string( iEnt, EV_SZ_classname, "MyEnt" );     entity_set_model( iEnt, g_szModel );         entity_set_edict( iEnt, EV_ENT_owner, id );         entity_set_float( iEnt, EV_FL_nextthink, get_gametime() + THINK_TIME ); } public EntThink( iEnt ) {     static Float:flOrigin[ 3 ], Float:flBaseOrigin[ 3 ], id;         if( !id )         id = entity_get_edict( iEnt, EV_ENT_owner );         velocity_by_aim( id, DIST, flOrigin );     entity_get_vector( id, EV_VEC_origin, flBaseOrigin );         flOrigin[ 2 ] = flBaseOrigin[ 2 ] - 25.0;     xs_vec_sub( flBaseOrigin, flOrigin, flOrigin );         entity_set_vector( iEnt, EV_VEC_origin, flOrigin );         entity_set_float( iEnt, EV_FL_nextthink, get_gametime() + THINK_TIME ); }
To test the effect, you can change xs_vec_sub() to xs_vec_add().
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 04-25-2013 at 08:38.
hornet is offline
Psychic
Junior Member
Join Date: Apr 2013
Old 04-25-2013 , 10:02   Re: Move Entity
Reply With Quote #9

check if player aim at the sky with the engfunc function:
PHP Code:
engfunc(EngFunc_PointContentsorigin) == CONTENTS_SKY // origin = Float:origin[3] 
Psychic 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 00:09.


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