JuryOfYourFears Posted January 25, 2024 Posted January 25, 2024 function ISPlumbHelperCursor2:isValid(square) local objects = square:getObjects() for index=0, objects:size()-1 do local object = objects:get(index) if object:hasModData() and object:getModData().canBeWaterPiped then return true end end return false end This is finding the objects (things that can be plumbed) but I need to check one floor down and I'm still learning, so I've kind of hit a wall here. Any advice is appreciated!
JuryOfYourFears Posted February 3, 2024 Author Posted February 3, 2024 For posterity, this is what I ended up with: function ISPlumbHelperCursor2:isValid(square) local x,y,z = square:getX(),square:getY(),square:getZ()-1 local squareA = getCell():getGridSquare(x, y, z) if not squareA then return false end local objects = squareA:getObjects() for index=0, objects:size()-1 do local object = objects:get(index) if (object:hasModData() and object:getModData().canBeWaterPiped) or (instanceof(object, "IsoObject") and object:getSprite() and object:getSprite():getProperties() and object:getSprite():getProperties():Is(IsoFlagType.waterPiped)) then return true end end return false end Hugo Qwerty 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now