Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
It doesn't work, maybe impossible?!
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#11
RE: It doesn't work, maybe impossible?!

I believe you forgot to copy in the rest of the code.

PHP Code: (Select All)
void MoveEntityToEntity(string &in asEntitystring &in asDestEntityfloat afSpacefloat afFreq)
{
    if(
GetLocalVarInt("Moving"+asEntity) == 1)
    {
        
AddDebugMessage("Object already moving"false);
        return;
    }
    
    
SetLocalVarFloat("MoveFreq_"+asEntityafFreq);
    
    
SetLocalVarFloat("MoveSpace_"+asEntityafSpace);
    
    
float afAmountX GetEntityPosX(asDestEntity)-GetEntityPosX(asEntity);
    
SetLocalVarFloat("MoveAmountX_"+asEntityMathSqrt(MathPow(afAmountX2)));
    
SetLocalVarFloat("MoveSpaceX_"+asEntityafSpace);
    if(
afAmountX 0)
    {
        
SetLocalVarFloat("MoveSpaceX_"+asEntity, -afSpace);
    }
    
    
float afAmountY GetEntityPosY(asDestEntity)-GetEntityPosY(asEntity);
    
SetLocalVarFloat("MoveAmountY_"+asEntityMathSqrt(MathPow(afAmountY2)));
    
SetLocalVarFloat("MoveSpaceY_"+asEntityafSpace);
    if(
afAmountY 0)
    {
        
SetLocalVarFloat("MoveSpaceY_"+asEntity, -afSpace);
    }
    
    
float afAmountZ GetEntityPosZ(asDestEntity)-GetEntityPosZ(asEntity);
    
SetLocalVarFloat("MoveAmountZ_"+asEntityMathSqrt(MathPow(afAmountZ2)));
    
SetLocalVarFloat("MoveSpaceZ_"+asEntityafSpace);
    if(
afAmountZ 0)
    {
        
SetLocalVarFloat("MoveSpaceZ_"+asEntity, -afSpace);
    }
    
    
AddTimer(asEntity0.0f"MoveObjectTimer");
}

void MoveEntityOnAxis(string &in asEntityfloat afAmountXfloat afAmountYfloat afAmountZfloat afSpacefloat afFreq)
{
    if(
GetLocalVarInt("Moving"+asEntity) == 1)
    {
        
AddDebugMessage("Object already moving"false);
        return;
    }
    
    
SetLocalVarFloat("MoveFreq_"+asEntityafFreq);
    
    
SetLocalVarFloat("MoveSpace_"+asEntityafSpace);
    
    
SetLocalVarFloat("MoveAmountX_"+asEntityMathSqrt(MathPow(afAmountX2)));
    
SetLocalVarFloat("MoveSpaceX_"+asEntityafSpace);
    if(
afAmountX 0)
    {
        
SetLocalVarFloat("MoveSpaceX_"+asEntity, -afSpace);
    }
    
    
SetLocalVarFloat("MoveAmountY_"+asEntityMathSqrt(MathPow(afAmountY2)));
    
SetLocalVarFloat("MoveSpaceY_"+asEntityafSpace);
    if(
afAmountY 0)
    {
        
SetLocalVarFloat("MoveSpaceY_"+asEntity, -afSpace);
    }
    
    
SetLocalVarFloat("MoveAmountZ_"+asEntityMathSqrt(MathPow(afAmountZ2)));
    
SetLocalVarFloat("MoveSpaceZ_"+asEntityafSpace);
    if(
afAmountZ 0)
    {
        
SetLocalVarFloat("MoveSpaceZ_"+asEntity, -afSpace);
    }
    
    
AddTimer(asEntity0.0f"MoveObjectTimer");
}

void MoveObjectTimer(string &in asTimer)
{
    
SetLocalVarInt("Moving"+asTimer1);

    if(
GetLocalVarFloat("MoveAmountX_"+asTimer) != 0)
    {
        
SetEntityPos(asTimerGetEntityPosX(asTimer)+GetLocalVarFloat("MoveSpaceX_"+asTimer), GetEntityPosY(asTimer), GetEntityPosZ(asTimer));
        
AddLocalVarFloat("MoveAmountX_"+asTimer, -GetLocalVarFloat("MoveSpace_"+asTimer));
        if(
GetLocalVarFloat("MoveAmountX_"+asTimer) < 0)
        {
            
SetLocalVarFloat("MoveAmountX_"+asTimer0);
        }
    }

    if(
GetLocalVarFloat("MoveAmountY_"+asTimer) != 0)
    {
        
SetEntityPos(asTimerGetEntityPosX(asTimer), GetEntityPosY(asTimer)+GetLocalVarFloat("MoveSpaceY_"+asTimer), GetEntityPosZ(asTimer));
        
AddLocalVarFloat("MoveAmountY_"+asTimer, -GetLocalVarFloat("MoveSpace_"+asTimer));
        if(
GetLocalVarFloat("MoveAmountY_"+asTimer) < 0)
        {
            
SetLocalVarFloat("MoveAmountY_"+asTimer0);
        }
    }

    if(
GetLocalVarFloat("MoveAmountZ_"+asTimer) != 0)
    {
        
SetEntityPos(asTimerGetEntityPosX(asTimer), GetEntityPosY(asTimer), GetEntityPosZ(asTimer)+GetLocalVarFloat("MoveSpaceZ_"+asTimer));
        
AddLocalVarFloat("MoveAmountZ_"+asTimer, -GetLocalVarFloat("MoveSpace_"+asTimer));
        if(
GetLocalVarFloat("MoveAmountZ_"+asTimer) < 0)
        {
            
SetLocalVarFloat("MoveAmountZ_"+asTimer0);
        }
    }
    
    if(
GetLocalVarFloat("MoveAmountX_"+asTimer) == && GetLocalVarFloat("MoveAmountY_"+asTimer) == && GetLocalVarFloat("MoveAmountZ_"+asTimer) == 0)
    {
        
SetLocalVarInt("Moving"+asTimer0);
        
OnArrival(asTimer);
        return;
    }

    
AddTimer(asTimerGetLocalVarFloat("MoveFreq_"+asTimer), "MoveObjectTimer");
}

void OnArrival(string &in asEntity)
{
    


This just has to be in your scriptfile somewhere

Trying is the first step to success.
05-10-2015, 07:45 PM
Find


Messages In This Thread
RE: It doesn't work, maybe impossible?! - by FlawlessHappiness - 05-10-2015, 07:45 PM



Users browsing this thread: 1 Guest(s)