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
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#12
RE: It doesn't work, maybe impossible?!

(05-10-2015, 07:45 PM)FlawlessHappiness Wrote: 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;
    }
    
Now I get a lot of Errors... Do I need to fill Everything in the script either?! :O
    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

Oh, So I have to paste it into my script?! lol, K I paste it at the end Smile
(This post was last modified: 05-10-2015, 08:05 PM by Amnesiaplayer.)
05-10-2015, 08:03 PM
Find
FlawlessHappiness Offline
Posting Freak

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

Awesome. Now everything should work.

Trying is the first step to success.
05-10-2015, 08:27 PM
Find
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#14
RE: It doesn't work, maybe impossible?!

(05-10-2015, 08:27 PM)FlawlessHappiness Wrote: Awesome. Now everything should work.

Nope.. It doesn't work ;( Now it gives me like, 1 million errors! most of them actually say like No matching signatures etc Sad
05-10-2015, 08:30 PM
Find
FlawlessHappiness Offline
Posting Freak

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

Then delete everything you added from my script.

It may be because you don't have 1.3 but it seems my solution is too complicated to try out right now.
Try studying the MoveObject type instead, and how FrictionalGames did.

Trying is the first step to success.
05-10-2015, 08:36 PM
Find
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#16
RE: It doesn't work, maybe impossible?!

(05-10-2015, 08:36 PM)FlawlessHappiness Wrote: Then delete everything you added from my script.

It may be because you don't have 1.3 but it seems my solution is too complicated to try out right now.
Try studying the MoveObject type instead, and how FrictionalGames did.

Or I just something else ;( Like rocks next to the place where I need to cover..
But how can I get 1.3 then?! I installed it like 3 times, and it still doesn't count... damn... But I think I hate 1.3, Since the Human skull pile things _2 is glitchy...
05-10-2015, 08:39 PM
Find
FlawlessHappiness Offline
Posting Freak

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

1.3 should fix the skull pile.

You have to both update your game, AND your editor.

Game update:
http://www.frictionalgames.com/forum/thread-24334.html

Tools:
https://wiki.frictionalgames.com/hpl2/tools/start

Trying is the first step to success.
05-10-2015, 09:01 PM
Find
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#18
RE: It doesn't work, maybe impossible?!

(05-10-2015, 09:01 PM)FlawlessHappiness Wrote: 1.3 should fix the skull pile.

You have to both update your game, AND your editor.

Game update:
http://www.frictionalgames.com/forum/thread-24334.html

Tools:
https://wiki.frictionalgames.com/hpl2/tools/start

Yeah I did both of those, 3 times...
05-10-2015, 09:14 PM
Find
FlawlessHappiness Offline
Posting Freak

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

Oh. Oh well, try making a moving object and see if you can get it working.

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




Users browsing this thread: 4 Guest(s)