Raised This Month: $ Target: $400
 0% 

Change entity moving pls help!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
BANDIT228
Member
Join Date: Sep 2017
Old 08-06-2018 , 02:17   Change entity moving pls help!
Reply With Quote #1

Quote:
public @CreateMafubaBeamEntity(__int_Entity, const __int_Owner, const Float:__float_Scale, const __int_Velocity)
{
__int_Entity = create_entity("env_sprite");

entity_set_model(__int_Entity, "sprites/mafuba.spr");

entity_set_int(__int_Entity, EV_INT_spawnflags, SF_SPRITE_STARTON);

DispatchSpawn(__int_Entity);

entity_set_int(__int_Entity, EV_INT_renderfx, kRenderFxGlowShell);
entity_set_int(__int_Entity, EV_INT_rendermode, kRenderTransAdd);

entity_set_float(__int_Entity, EV_FL_animtime, get_gametime());
entity_set_float(__int_Entity, EV_FL_framerate, float(10));

entity_set_string(__int_Entity, EV_SZ_classname, "mafuba");

entity_set_float(__int_Entity, EV_FL_renderamt, float(254));

entity_set_float(__int_Entity, EV_FL_scale, __float_Scale);

entity_set_int(__int_Entity, EV_INT_movetype, MOVETYPE_FLY);

entity_set_size(__int_Entity, Float:{-8.000_000, -8.000_000, -8.000_000}, Float:{8.000_000, 8.000_000, 8.000_000});

entity_set_int(__int_Entity, EV_INT_solid, SOLID_TRIGGER);

//entity_set_edict(__int_Entity, EV_ENT_owner, __int_Owner);
set_pev(__int_Entity,pev_owner, __int_Owner)
entity_set_edict(__int_Entity, EV_ENT_pContainingEntity, __int_Entity);

static Float:__float_Origin[3];
entity_get_vector(__int_Owner, EV_VEC_origin, __float_Origin);

entity_set_origin(__int_Entity, __float_Origin);

static Float:__float_Velocity[3];
velocity_by_aim(__int_Owner, __int_Velocity, __float_Velocity);

entity_set_vector(__int_Entity, EV_VEC_velocity, __float_Velocity);
set_task(0.1, "follow_enemy", __int_Entity,_,_,"b")

message_begin( MSG_BROADCAST,SVC_TEMPENTITY )
write_byte( TE_BEAMFOLLOW )
write_short( __int_Entity )
write_short( engfunc( EngFunc_ModelIndex,"sprites/mafubatrail2.spr" ) )
write_byte( 20 )// 持续时间[] life in 0.1's
write_byte( 30 )// 宽度[] line width in 0.1's
write_byte( 255 )// Red
write_byte( 255 )// Green
write_byte( 255 )// Blue
write_byte( 255 )// Brightness
message_end( )
}
this code spawns a entity and that one follows the nearest enemy <---works perfectly!
BUT i would need a circular movement andlong that....in order to create something like this:
https://images-ext-2.discordapp.net/...96/unknown.png

a buddy made that but lost the code....and i lost the buddyXD

since the entity is moving automatly forward i only would need to have it move in circle.........with the trail it creates it should look then like a spiral.

so how can i have that thing move in a cirle? i want a radial movement around a center. can someone help there? pls
BANDIT228 is offline
 



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 12:28.


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