MGT Posted June 16, 2014 Report Share Posted June 16, 2014 Hey, not sure if my syntax is correct but im trying to prevent the building of sky bases, by adding this line into player_build.sqf (with correct syntax) work? if (getPosATL _x select 2 > 45.0) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_41"), "PLAIN DOWN"];}; Link to comment Share on other sites More sharing options...
0 TheVampire Posted June 16, 2014 Report Share Posted June 16, 2014 Looks good to me? Link to comment Share on other sites More sharing options...
0 Cash Posted June 16, 2014 Report Share Posted June 16, 2014 What's a Sky Base look like? Link to comment Share on other sites More sharing options...
0 raymix Posted June 16, 2014 Report Share Posted June 16, 2014 I am not sure if you are referring to an actual object unless this is the only code line you've added. If modifying original player_build, then you might want to add this check to an attached object, not the one you publish: _heightCheck = (_object getPosATL select 2); if (_heightCheck > 45) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_41"), "PLAIN DOWN"];}; edit: or at least refer to a player himself if check against attached object doesn't work. Link to comment Share on other sites More sharing options...
0 Incar Posted June 16, 2014 Report Share Posted June 16, 2014 What's a Sky Base look like? A base floating in the sky? lol. I've done it out of boredom sorta, but it was actually a treehouse. Thing is people can keep building as high as they want so, if they have too much time on their hands, it can be 500 feet in the air, only accessible by heli. Link to comment Share on other sites More sharing options...
0 MGT Posted June 16, 2014 Author Report Share Posted June 16, 2014 I am not sure if you are referring to an actual object unless this is the only code line you've added. If modifying original player_build, then you might want to add this check to an attached object, not the one you publish: _heightCheck = (_object getPosATL select 2); if (_heightCheck > 45) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_41"), "PLAIN DOWN"];}; edit: or at least refer to a player himself if check against attached object doesn't work. Yes, the object check didn't work, testing your edit now Just trying to prevent building above a certain height, we have a few sky bases appearing at over 200m in the sky! The thing is, they've not been built up and then had the bits removed, they've been built from scratch in the sky somehow, no one's telling me how though ;) Link to comment Share on other sites More sharing options...
0 Incar Posted June 16, 2014 Report Share Posted June 16, 2014 Yes, the object check didn't work, testing your edit now Just trying to prevent building above a certain height, we have a few sky bases appearing at over 200m in the sky! The thing is, they've not been built up and then had the bits removed, they've been built from scratch in the sky somehow, no one's telling me how though ;) My guess would be they just build a floor/ceiling and keep raising the height of it then land on it and continue building the rest. After testing I can just Alt+PageUp an item endlessly. Not sure if there is a script somewhere that defines controls for raising/lowering, if there is perhaps you could add a count to add/subtract each time it's raised/lowered, causing it to cancel out of building if above 5 or below -5. Link to comment Share on other sites More sharing options...
0 MGT Posted June 16, 2014 Author Report Share Posted June 16, 2014 So another way to prevent it would be to have the build timer or remove the alt+pageup so big moves are impossible. If I can this way to work it should still prevent it as they wont be able to land on the high platform and continue building. Edit, Raymix, your edit breaks building, even with _heightcheck added in to the array You said "select 2", are the coord positions in the array for x,y,z - 0,1,2? Link to comment Share on other sites More sharing options...
0 TheVampire Posted June 16, 2014 Report Share Posted June 16, 2014 This should work. (The _vehicle code is there so you know the location) _vehicle = vehicle player; _inVehicle = (_vehicle != player); if (((getPosATL _vehicle) select 2) > 45) exitWith {DZE_ActionInProgress = false; cutText ["Your fear of heights prevents you from building!","PLAIN DOWN"];}; MGT 1 Link to comment Share on other sites More sharing options...
0 DarrikVkir Posted June 16, 2014 Report Share Posted June 16, 2014 My guess would be they just build a floor/ceiling and keep raising the height of it then land on it and continue building the rest. After testing I can just Alt+PageUp an item endlessly. Not sure if there is a script somewhere that defines controls for raising/lowering, if there is perhaps you could add a count to add/subtract each time it's raised/lowered, causing it to cancel out of building if above 5 or below -5. This code in player_build should prevent endlessly alt-pageup'ing? It's in stock Epoch. if(abs(_objHDiff) > 5) exitWith { _isOk = false; _cancel = true; _reason = "Cannot move up or down more than 5 meters"; detach _object; deleteVehicle _object; }; I can't verify it myself, as I'm using snapbuilding which modifies that code. Link to comment Share on other sites More sharing options...
0 Incar Posted June 16, 2014 Report Share Posted June 16, 2014 This code in player_build should prevent endlessly alt-pageup'ing? It's in stock Epoch. if(abs(_objHDiff) > 5) exitWith { _isOk = false; _cancel = true; _reason = "Cannot move up or down more than 5 meters"; detach _object; deleteVehicle _object; }; I can't verify it myself, as I'm using snapbuilding which modifies that code. Yah I see that. Pretty sure that's based on character position though, not object. So if your character moves up or down 5 meters it cancels. Like when you move side to side or forward and back more then 5 meters. Overall it just cancels out building based on player movement. Edit: Think I'm wrong on what I just said. Link to comment Share on other sites More sharing options...
0 MGT Posted June 16, 2014 Author Report Share Posted June 16, 2014 This code in player_build should prevent endlessly alt-pageup'ing? It's in stock Epoch. if(abs(_objHDiff) > 5) exitWith { _isOk = false; _cancel = true; _reason = "Cannot move up or down more than 5 meters"; detach _object; deleteVehicle _object; }; I can't verify it myself, as I'm using snapbuilding which modifies that code. They must be building it somehow in the sky then! Some bases have gone up in a matter of hours so are definitely not using the build/remove method - Also, they're established players, not dupers or hackers. Link to comment Share on other sites More sharing options...
0 fr1nk Posted June 16, 2014 Report Share Posted June 16, 2014 Can you build while on top of an osprey? Link to comment Share on other sites More sharing options...
0 Incar Posted June 16, 2014 Report Share Posted June 16, 2014 They must be building it somehow in the sky then! Some bases have gone up in a matter of hours so are definitely not using the build/remove method - Also, they're established players, not dupers or hackers. Ok the problem with "if(abs(_objHDiff) > 5) exitWith {" is that it counts every raise as an increase of 0.1 whether you're using alt, ctrl or just pageup as normal. Basically something needs to be changed within... if(_zheightchanged) then { detach _object; _position = getPosATL _object; if(_zheightdirection == "up") then { _position set [2,((_position select 2)+0.1)]; _objHDiff = _objHDiff + 0.1; }; if(_zheightdirection == "down") then { _position set [2,((_position select 2)-0.1)]; _objHDiff = _objHDiff - 0.1; }; if(_zheightdirection == "up_alt") then { _position set [2,((_position select 2)+1)]; _objHupDiff = _objHupDiff + 1; }; if(_zheightdirection == "down_alt") then { _position set [2,((_position select 2)-1)]; _objHDiff = _objHDiff - 1; }; if(_zheightdirection == "up_ctrl") then { _position set [2,((_position select 2)+0.01)]; _objHupDiff = _objHupDiff + 0.01; }; if(_zheightdirection == "down_ctrl") then { _position set [2,((_position select 2)-0.01)]; _objHDiff = _objHDiff - 0.01; }; _object setDir (getDir _object); if((_isAllowedUnderGround == 0) and ((_position select 2) < 0)) then { _position set [2,0]; }; _object setPosATL _position; //diag_log format["DEBUG Change BUILDING POS: %1", _position]; _object attachTo [player]; }; to increase count more when using Alt+PageUp. It shows like it should be doing it more when Alt+Up but it doesn't seem to. Edit: you guys think maybe this would work? if(_zheightdirection == "up" && _zheightdirection == "alt") Link to comment Share on other sites More sharing options...
0 MGT Posted June 16, 2014 Author Report Share Posted June 16, 2014 This should work. (The _vehicle code is there so you know the location) _vehicle = vehicle player; _inVehicle = (_vehicle != player); if (((getPosATL _vehicle) select 2) > 45) exitWith {DZE_ActionInProgress = false; cutText ["Your fear of heights prevents you from building!","PLAIN DOWN"];}; Bingo! This works, you can be on the ground and place a plot and alt+pageup the plot pole, then a metal floor, but as soon as you take your heli and get up there, you cant build any more and it exits with your message, i've posted the whole player_build.sqf on pastebin, would be nice if Awol etc could add a variable that can be called in the init to restrict height on building in 1.0.5 http://pastebin.com/6iv3H8xe Link to comment Share on other sites More sharing options...
0 DarrikVkir Posted June 16, 2014 Report Share Posted June 16, 2014 Yah I see that. Pretty sure that's based on character position though, not object. So if your character moves up or down 5 meters it cancels. Like when you move side to side or forward and back more then 5 meters. Overall it just cancels out building based on player movement. Edit: Think I'm wrong on what I just said. Yeah, location1/location2 is player location, objHDiff is on the object. They must be building it somehow in the sky then! Some bases have gone up in a matter of hours so are definitely not using the build/remove method - Also, they're established players, not dupers or hackers. It's not impossible to do it in a few hours, just a lot of work. Two ways I can think of off the top of my head: 1) When in the preview mode with a modular item, other players can walk on it. So... if I wanted to be really ballsy, I could preview a floor, two of my buddies could climb on it, I could then raise it as far as it could go. one of them could then preview another piece, the other could climb on it... with a big enough group, I could get substantial high without placing any pieces. Place the last piece and you've got a floor 5 x (# of buddies) high. Helicopter everyone up to that piece and start over. It would suck if one of you lost connection or accidently hit your mouse button... and it's a massive PITA, though. 2) It's a lot faster to just place a crap ton of (relatively cheap) wooden stairs and keep walking up them until you reach the desired height. Place your initial floors and go back down, removing stairs as you go. Fast skyhook. I imagine construction death is a common occurence. An overall limit in height should fix it, though. Hopefully Vampire's last code works? Link to comment Share on other sites More sharing options...
0 insertcoins Posted June 16, 2014 Report Share Posted June 16, 2014 Please a picture of these bases Link to comment Share on other sites More sharing options...
0 Defent Posted June 16, 2014 Report Share Posted June 16, 2014 I've had a few players use the building preview model, jumping up on it and the other player pressing alt pg up. This could be one of the ways they do it. Link to comment Share on other sites More sharing options...
0 MGT Posted June 16, 2014 Author Report Share Posted June 16, 2014 TheVampires method stops any building by a player above x metres Link to comment Share on other sites More sharing options...
0 Incar Posted June 16, 2014 Report Share Posted June 16, 2014 Yeah, location1/location2 is player location, objHDiff is on the object. Yah, I'm pretty sure the issue lies in the next post I made which talks about the portion calculating the counts. I think the issue is the fact that it's spread into multiple if statements, and it's checking to see if the first one matches the requirements before the rest. It doesn't seem to care if a person is pressing Alt+Up, so long as just the Up requirement is met. Thinking perhaps it needs to be restructured to check Up and Down last out of all of them. I'm going to do a quick test on it and see. If it still presents an issue, I may need to add in a series of else's. TheVampires method stops any building by a player above x metres Saw that, but now the other thing is bugging me because it's broken, lol Link to comment Share on other sites More sharing options...
0 Defent Posted June 16, 2014 Report Share Posted June 16, 2014 You already have thse lines defined in the player_build.sqf, MGT, you just need ot place your code below it =) _vehicle = vehicle player; _inVehicle = (_vehicle != player); Also, wouldn't you need to loop it, or is a if boolean enough? Preferably that is. Link to comment Share on other sites More sharing options...
0 DarrikVkir Posted June 16, 2014 Report Share Posted June 16, 2014 Yah, I'm pretty sure the issue lies in the next post I made which talks about the portion calculating the counts. I think the issue is the fact that it's spread into multiple if statements, and it's checking to see if the first one matches the requirements before the rest. It doesn't seem to care if a person is pressing Alt+Up, so long as just the Up requirement is met. Thinking perhaps it needs to be restructured to check Up and Down last out of all of them. I'm going to do a quick test on it and see. If it still presents an issue, I may need to add in a series of else's. Saw that, but now the other thing is bugging me because it's broken, lol This thread's busy. 4 replies came in while I was typing my last post! :) if(_zheightdirection == "up_alt") then { _position set [2,((_position select 2)+1)]; _objHupDiff = _objHupDiff + 1; This will trigger on alt-pageup. The "up" will only trigger on a regular pageup. So you can only alt-up a maximum of 5 times before it rejects it. 1) When in the preview mode with a modular item, other players can walk on it. So... if I wanted to be really ballsy, I could preview a floor, two of my buddies could climb on it, I could then raise it as far as it could go. one of them could then preview another piece, the other could climb on it... with a big enough group, I could get substantial high without placing any pieces. Place the last piece and you've got a floor 5 x (# of buddies) high. Helicopter everyone up to that piece and start over. It would suck if one of you lost connection or accidently hit your mouse button... and it's a massive PITA, though. Actually, looking at the code, you may be able to do this with two people a lot easier than I wrote... first guy previews a floor, second guy previews another floor. Each of you makes sure your floor is below your buddy, then one of you raises his. I believe if YOUR position raises, the floor you are previewing will move up the same amount. But not entirely sure on that without testing it, pretty much depends on how the attachto code works, which I don't know much about. But Vampire's code fixed this, so all good! Link to comment Share on other sites More sharing options...
0 Incar Posted June 16, 2014 Report Share Posted June 16, 2014 Note:For both fixes combined and ready to use, grab player_build.sqf from post below this one. Ok, after several alterations to the script, I discovered what the issue was. Wish I saw it sooner, would have saved me time. Anyway... For player_build.sqf if(_zheightchanged) then { The parts dealing with alt+up and ctrl+up had incorrect code. _objHupDiff = _objHupDiff + 1; and _objHupDiff = _objHupDiff + 0.01; Should be. _objHDiff = _objHDiff + 1; and _objHDiff = _objHDiff + 0.01; With that change, walls raised above 5 meters for Alt+PageUp and Ctrl+PageUp will cancel out correctly. Now I'll quote the fix for cancelling out anything built over a certain elevation so anyone reading this thread late will see. This should work. (The _vehicle code is there so you know the location) _vehicle = vehicle player; _inVehicle = (_vehicle != player); if (((getPosATL _vehicle) select 2) > 45) exitWith {DZE_ActionInProgress = false; cutText ["Your fear of heights prevents you from building!","PLAIN DOWN"];}; Bingo! This works, you can be on the ground and place a plot and alt+pageup the plot pole, then a metal floor, but as soon as you take your heli and get up there, you cant build any more and it exits with your message, i've posted the whole player_build.sqf on pastebin, would be nice if Awol etc could add a variable that can be called in the init to restrict height on building in 1.0.5 http://pastebin.com/6iv3H8xe Hope my fix helps some people. And that elevation check might come in handy so... thank you guys. Edit: This thread's busy. 4 replies came in while I was typing my last post! :) Just saw your post now. Yah, I knew what was controlling it but it wasn't working properly, so I thought perhaps it could be something to do with the order. I'm still getting used to this scripting, used to working with C# in MonoDevelopment and it's got it's fair amount of differences. However, turns out it was a typo in the original scripting the whole time. MGT 1 Link to comment Share on other sites More sharing options...
0 MGT Posted June 16, 2014 Author Report Share Posted June 16, 2014 Excellent, stops the unlimted alt+pageups Updated player_build.sqf with building height limit at 45m and pageup bug fix Incar 1 Link to comment Share on other sites More sharing options...
0 DarrikVkir Posted June 16, 2014 Report Share Posted June 16, 2014 The parts dealing with alt+up and ctrl+up had incorrect code. _objHupDiff = _objHupDiff + 1; and _objHupDiff = _objHupDiff + 0.01; Should be. _objHDiff = _objHDiff + 1; and _objHDiff = _objHDiff + 0.01; Nice catch. How many times did I look at that code today and not catch that? It's even still there after adding snap building, so made the change on mine as well. Thanks. Link to comment Share on other sites More sharing options...
0 MGT Posted June 17, 2014 Author Report Share Posted June 17, 2014 So many cries on my server that they can't raise base parts to the sky ;) Incar 1 Link to comment Share on other sites More sharing options...
Question
MGT
Hey, not sure if my syntax is correct but im trying to prevent the building of sky bases, by adding this line into player_build.sqf (with correct syntax) work?
Link to comment
Share on other sites
37 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now