RE: It doesn't work, maybe impossible?! - FlawlessHappiness - 05-10-2015
I believe you forgot to copy in the rest of the code.
PHP Code: void MoveEntityToEntity(string &in asEntity, string &in asDestEntity, float afSpace, float afFreq) { if(GetLocalVarInt("Moving"+asEntity) == 1) { AddDebugMessage("Object already moving", false); return; } SetLocalVarFloat("MoveFreq_"+asEntity, afFreq); SetLocalVarFloat("MoveSpace_"+asEntity, afSpace); float afAmountX = GetEntityPosX(asDestEntity)-GetEntityPosX(asEntity); SetLocalVarFloat("MoveAmountX_"+asEntity, MathSqrt(MathPow(afAmountX, 2))); SetLocalVarFloat("MoveSpaceX_"+asEntity, afSpace); if(afAmountX < 0) { SetLocalVarFloat("MoveSpaceX_"+asEntity, -afSpace); } float afAmountY = GetEntityPosY(asDestEntity)-GetEntityPosY(asEntity); SetLocalVarFloat("MoveAmountY_"+asEntity, MathSqrt(MathPow(afAmountY, 2))); SetLocalVarFloat("MoveSpaceY_"+asEntity, afSpace); if(afAmountY < 0) { SetLocalVarFloat("MoveSpaceY_"+asEntity, -afSpace); } float afAmountZ = GetEntityPosZ(asDestEntity)-GetEntityPosZ(asEntity); SetLocalVarFloat("MoveAmountZ_"+asEntity, MathSqrt(MathPow(afAmountZ, 2))); SetLocalVarFloat("MoveSpaceZ_"+asEntity, afSpace); if(afAmountZ < 0) { SetLocalVarFloat("MoveSpaceZ_"+asEntity, -afSpace); } AddTimer(asEntity, 0.0f, "MoveObjectTimer"); }
void MoveEntityOnAxis(string &in asEntity, float afAmountX, float afAmountY, float afAmountZ, float afSpace, float afFreq) { if(GetLocalVarInt("Moving"+asEntity) == 1) { AddDebugMessage("Object already moving", false); return; } SetLocalVarFloat("MoveFreq_"+asEntity, afFreq); SetLocalVarFloat("MoveSpace_"+asEntity, afSpace); SetLocalVarFloat("MoveAmountX_"+asEntity, MathSqrt(MathPow(afAmountX, 2))); SetLocalVarFloat("MoveSpaceX_"+asEntity, afSpace); if(afAmountX < 0) { SetLocalVarFloat("MoveSpaceX_"+asEntity, -afSpace); } SetLocalVarFloat("MoveAmountY_"+asEntity, MathSqrt(MathPow(afAmountY, 2))); SetLocalVarFloat("MoveSpaceY_"+asEntity, afSpace); if(afAmountY < 0) { SetLocalVarFloat("MoveSpaceY_"+asEntity, -afSpace); } SetLocalVarFloat("MoveAmountZ_"+asEntity, MathSqrt(MathPow(afAmountZ, 2))); SetLocalVarFloat("MoveSpaceZ_"+asEntity, afSpace); if(afAmountZ < 0) { SetLocalVarFloat("MoveSpaceZ_"+asEntity, -afSpace); } AddTimer(asEntity, 0.0f, "MoveObjectTimer"); }
void MoveObjectTimer(string &in asTimer) { SetLocalVarInt("Moving"+asTimer, 1);
if(GetLocalVarFloat("MoveAmountX_"+asTimer) != 0) { SetEntityPos(asTimer, GetEntityPosX(asTimer)+GetLocalVarFloat("MoveSpaceX_"+asTimer), GetEntityPosY(asTimer), GetEntityPosZ(asTimer)); AddLocalVarFloat("MoveAmountX_"+asTimer, -GetLocalVarFloat("MoveSpace_"+asTimer)); if(GetLocalVarFloat("MoveAmountX_"+asTimer) < 0) { SetLocalVarFloat("MoveAmountX_"+asTimer, 0); } }
if(GetLocalVarFloat("MoveAmountY_"+asTimer) != 0) { SetEntityPos(asTimer, GetEntityPosX(asTimer), GetEntityPosY(asTimer)+GetLocalVarFloat("MoveSpaceY_"+asTimer), GetEntityPosZ(asTimer)); AddLocalVarFloat("MoveAmountY_"+asTimer, -GetLocalVarFloat("MoveSpace_"+asTimer)); if(GetLocalVarFloat("MoveAmountY_"+asTimer) < 0) { SetLocalVarFloat("MoveAmountY_"+asTimer, 0); } }
if(GetLocalVarFloat("MoveAmountZ_"+asTimer) != 0) { SetEntityPos(asTimer, GetEntityPosX(asTimer), GetEntityPosY(asTimer), GetEntityPosZ(asTimer)+GetLocalVarFloat("MoveSpaceZ_"+asTimer)); AddLocalVarFloat("MoveAmountZ_"+asTimer, -GetLocalVarFloat("MoveSpace_"+asTimer)); if(GetLocalVarFloat("MoveAmountZ_"+asTimer) < 0) { SetLocalVarFloat("MoveAmountZ_"+asTimer, 0); } } if(GetLocalVarFloat("MoveAmountX_"+asTimer) == 0 && GetLocalVarFloat("MoveAmountY_"+asTimer) == 0 && GetLocalVarFloat("MoveAmountZ_"+asTimer) == 0) { SetLocalVarInt("Moving"+asTimer, 0); OnArrival(asTimer); return; }
AddTimer(asTimer, GetLocalVarFloat("MoveFreq_"+asTimer), "MoveObjectTimer"); }
void OnArrival(string &in asEntity) { }
This just has to be in your scriptfile somewhere
RE: It doesn't work, maybe impossible?! - Amnesiaplayer - 05-10-2015
(05-10-2015, 07:45 PM)FlawlessHappiness Wrote: I believe you forgot to copy in the rest of the code.
PHP Code: void MoveEntityToEntity(string &in asEntity, string &in asDestEntity, float afSpace, float 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_"+asEntity, afFreq); SetLocalVarFloat("MoveSpace_"+asEntity, afSpace); float afAmountX = GetEntityPosX(asDestEntity)-GetEntityPosX(asEntity); SetLocalVarFloat("MoveAmountX_"+asEntity, MathSqrt(MathPow(afAmountX, 2))); SetLocalVarFloat("MoveSpaceX_"+asEntity, afSpace); if(afAmountX < 0) { SetLocalVarFloat("MoveSpaceX_"+asEntity, -afSpace); } float afAmountY = GetEntityPosY(asDestEntity)-GetEntityPosY(asEntity); SetLocalVarFloat("MoveAmountY_"+asEntity, MathSqrt(MathPow(afAmountY, 2))); SetLocalVarFloat("MoveSpaceY_"+asEntity, afSpace); if(afAmountY < 0) { SetLocalVarFloat("MoveSpaceY_"+asEntity, -afSpace); } float afAmountZ = GetEntityPosZ(asDestEntity)-GetEntityPosZ(asEntity); SetLocalVarFloat("MoveAmountZ_"+asEntity, MathSqrt(MathPow(afAmountZ, 2))); SetLocalVarFloat("MoveSpaceZ_"+asEntity, afSpace); if(afAmountZ < 0) { SetLocalVarFloat("MoveSpaceZ_"+asEntity, -afSpace); } AddTimer(asEntity, 0.0f, "MoveObjectTimer"); }
void MoveEntityOnAxis(string &in asEntity, float afAmountX, float afAmountY, float afAmountZ, float afSpace, float afFreq) { if(GetLocalVarInt("Moving"+asEntity) == 1) { AddDebugMessage("Object already moving", false); return; } SetLocalVarFloat("MoveFreq_"+asEntity, afFreq); SetLocalVarFloat("MoveSpace_"+asEntity, afSpace); SetLocalVarFloat("MoveAmountX_"+asEntity, MathSqrt(MathPow(afAmountX, 2))); SetLocalVarFloat("MoveSpaceX_"+asEntity, afSpace); if(afAmountX < 0) { SetLocalVarFloat("MoveSpaceX_"+asEntity, -afSpace); } SetLocalVarFloat("MoveAmountY_"+asEntity, MathSqrt(MathPow(afAmountY, 2))); SetLocalVarFloat("MoveSpaceY_"+asEntity, afSpace); if(afAmountY < 0) { SetLocalVarFloat("MoveSpaceY_"+asEntity, -afSpace); } SetLocalVarFloat("MoveAmountZ_"+asEntity, MathSqrt(MathPow(afAmountZ, 2))); SetLocalVarFloat("MoveSpaceZ_"+asEntity, afSpace); if(afAmountZ < 0) { SetLocalVarFloat("MoveSpaceZ_"+asEntity, -afSpace); } AddTimer(asEntity, 0.0f, "MoveObjectTimer"); }
void MoveObjectTimer(string &in asTimer) { SetLocalVarInt("Moving"+asTimer, 1);
if(GetLocalVarFloat("MoveAmountX_"+asTimer) != 0) { SetEntityPos(asTimer, GetEntityPosX(asTimer)+GetLocalVarFloat("MoveSpaceX_"+asTimer), GetEntityPosY(asTimer), GetEntityPosZ(asTimer)); AddLocalVarFloat("MoveAmountX_"+asTimer, -GetLocalVarFloat("MoveSpace_"+asTimer)); if(GetLocalVarFloat("MoveAmountX_"+asTimer) < 0) { SetLocalVarFloat("MoveAmountX_"+asTimer, 0); } }
if(GetLocalVarFloat("MoveAmountY_"+asTimer) != 0) { SetEntityPos(asTimer, GetEntityPosX(asTimer), GetEntityPosY(asTimer)+GetLocalVarFloat("MoveSpaceY_"+asTimer), GetEntityPosZ(asTimer)); AddLocalVarFloat("MoveAmountY_"+asTimer, -GetLocalVarFloat("MoveSpace_"+asTimer)); if(GetLocalVarFloat("MoveAmountY_"+asTimer) < 0) { SetLocalVarFloat("MoveAmountY_"+asTimer, 0); } }
if(GetLocalVarFloat("MoveAmountZ_"+asTimer) != 0) { SetEntityPos(asTimer, GetEntityPosX(asTimer), GetEntityPosY(asTimer), GetEntityPosZ(asTimer)+GetLocalVarFloat("MoveSpaceZ_"+asTimer)); AddLocalVarFloat("MoveAmountZ_"+asTimer, -GetLocalVarFloat("MoveSpace_"+asTimer)); if(GetLocalVarFloat("MoveAmountZ_"+asTimer) < 0) { SetLocalVarFloat("MoveAmountZ_"+asTimer, 0); } } if(GetLocalVarFloat("MoveAmountX_"+asTimer) == 0 && GetLocalVarFloat("MoveAmountY_"+asTimer) == 0 && GetLocalVarFloat("MoveAmountZ_"+asTimer) == 0) { SetLocalVarInt("Moving"+asTimer, 0); OnArrival(asTimer); return; }
AddTimer(asTimer, GetLocalVarFloat("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
RE: It doesn't work, maybe impossible?! - FlawlessHappiness - 05-10-2015
Awesome. Now everything should work.
RE: It doesn't work, maybe impossible?! - Amnesiaplayer - 05-10-2015
(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
RE: It doesn't work, maybe impossible?! - FlawlessHappiness - 05-10-2015
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.
RE: It doesn't work, maybe impossible?! - Amnesiaplayer - 05-10-2015
(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...
RE: It doesn't work, maybe impossible?! - FlawlessHappiness - 05-10-2015
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
RE: It doesn't work, maybe impossible?! - Amnesiaplayer - 05-10-2015
(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...
RE: It doesn't work, maybe impossible?! - FlawlessHappiness - 05-10-2015
Oh. Oh well, try making a moving object and see if you can get it working.
|