View Full Version : Need help with position check
shinchan
08-03-2013, 06:44 PM
Hey all
im using a carlin dlair free script and it works great. The only problem is with holes, when my char goes down a hole theres always someone that ropes me up and bugs the walker..
so my idea was to implement a position checker:
if not position x then walk y.
can any1 let me know how to write that in a code language?
thanks in advance
dinmamma
08-03-2013, 07:14 PM
Make a simple oneliner after each hole:
setWalkerEnabled(false) if (Self.Position.z() == 7 then setWalkerEnabled(true) else gotoLabel("TryToGoDownAgain") end
So you should change z to whatever u should be at after going down and have a label before the Step which takes you down the hole.
Incase someone ropes you up it checks that you are still not down and goes back to the step where it's going down the hole.
This could leave you in worst case in a loop untill they stop roping you up.
shinchan
08-03-2013, 07:30 PM
Make a simple oneliner after each hole:
setWalkerEnabled(false) if (Self.Position.z() == 7 then setWalkerEnabled(true) else gotoLabel("TryToGoDownAgain") end
So you should change z to whatever u should be at after going down and have a label before the Step which takes you down the hole.
Incase someone ropes you up it checks that you are still not down and goes back to the step where it's going down the hole.
This could leave you in worst case in a loop untill they stop roping you up.
thanks mate, ill have a go at it once i get enough time in me hands.
Infernal Bolt
08-03-2013, 07:57 PM
Make a simple oneliner after each hole:
Stopping the walker in oneliners is just waste of space, it does that automatically.
-- 8 = what floor you want to be on.
if Self.Position().z ~= 8 then Walker.Goto('LabelBeforeHole') end
dinmamma
08-03-2013, 08:02 PM
Stopping the walker in oneliners is just waste of space, it does that automatically.
-- 8 = what floor you want to be on.
if Self.Position().z ~= 8 then Walker.Goto('LabelBeforeHole') end
Good point, I have been doing like that without caring about the space rly :P since all my oneliners look like that after copy/paste I just cba to change them lol
Btw isn't gotoLabel better to use?
Infernal Bolt
08-03-2013, 08:06 PM
Btw isn't gotoLabel better to use?
It's exactly the same function but Walker.Goto looks cleaner imo :rolleyes:
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.