Raised This Month: $51 Target: $400
 12% 

Velocity by sidemove and forwardmove


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 05-01-2014 , 16:57   Velocity by sidemove and forwardmove
Reply With Quote #1

I'm trying to make entity which player could move. It would like to copy player movements and give them to that entity. I can make entity move in the angle of player aiming, but how to add sidemove so it would work together?
Here is the stock i'm found in forum:
PHP Code:
stock AnglesToVelocity(const Float:angles[3], Float:speedFloat:velocity[3])
{
    
engfunc(EngFunc_MakeVectorsangles);
    
global_get(glb_v_forwardvelocity);
    
    new 
Float:length vector_length(velocity);
    
velocity[0] *= (speed length);
    
velocity[1] *= (speed length);
    
velocity[2] *= (speed length);

__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-01-2014 , 17:27   Re: Velocity by sidemove and forwardmove
Reply With Quote #2

Can't you just use MOVETYPE_FOLLOW?
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 05-01-2014 , 17:40   Re: Velocity by sidemove and forwardmove
Reply With Quote #3

Does it really work? I think movetype_follow only works if you attach entity to bone. I need to control entity from away, not attached to player.

EDIT: Tested and works as I thought. Thanks anyways.
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness

Last edited by GuskiS; 05-01-2014 at 17:43.
GuskiS 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 01:34.


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