• Unstuck command
    51 replies, posted
I love those kind of user created scripts, small fixes that are useful as zip
Doesn't seem to be working at the moment - Zombie survival gamemode
Any idea on how we can get this to check if you are stuck first (before trying to unstuck you)?
Any chance you reupload your most recent version? Kind of want to use it :3
[B]Made a solution with completely rewritten unstuck algorithm: [URL]https://dl.dropboxusercontent.com/u/2719927/unstuck.zip[/URL][/B] Why rewrite ? Well i could only download the version in the 1st post, but the old version: - spammed the chat - jammed the server for 3s - didn't work at all (event not while supporting it by looking into the right direction) now this version should always find a walkable area. (always the closest one - cant cheat through walls). even if you fall out of map. even if you are a big soda machine on prop hunt. even if you are stuck in a small corridor with 20000 props or between walls somewhere ...... ah just always. you can type /unstuck (besides !unstuck) now [B]@rejax:[/B] DUDE, don't be mad on me. i normally don't do this - neither registering on message boards nor correcting people. But since i searched OVER 2 DAYS unsuccessfully for an addon like this, i thought its time to help. (funny fact - writing it was much faster than searching -__-) And here are some hints / questions: 1.) why do you spawn invisible Oildrums and abuse their physic calculation ?? wtf xD. you never EVER should use workarounds like this 2.) why do you rely on the aim-position of the user ? (using it as unstuck target) never do that, the addon gets unusable for the common player 3.) why do you rely on the fact, that the player is as big as an oildrum ? that would narrow the use of the addon a lot. (in other gamemodes - like ph, you could be something really big - like a soda-machine) 4.) why freezing the player ... why iterating over the positions on the traceline 5.) why dont you search the area around the player or calculate his collision box ... ... and so on aaah i forgot all the rest ^^ i just learned lua on the fly, deleted your core code and rewrote it - but its not fully tested since i only had 3 hours in the morning from 1am - 4am and it works like this: - get player speed vec (even stuck you have -4 z-speed) - accel him upwards by 250 (is like jumping) - look 0.1s later if he got accelerated (the ONLY 100% secure way) - now calc his collision box (at least 8 points and some mid points) - now begin to grow a cloud of random offset vectors around is origin - ...until his collision box fits in all points (IsInWorld()) on a new pos - now get all Entities in this new box and look which would collide - go to the next random offset if this box will stuck him again You can calc the accessibility with 90% success with that. (regarding world collision and props) - now you call yourself recursively (the 1st accel test again) - if you are again stuck then u ported into a replacement map - shift position by 30 and loop - count recursitions ...now you have like 99% success i guess and need nearly no calculation time gime any bugreports greetings, Rei
Simply put- I wrote this a while ago while still very much learning and I've never really cared to write a better one I haven't checked your code but i have no doubt it's better than what i was doing (seriously look how the chat messages are sent hahaha) To answer your questions: 1 and 3) at the time i figured it would be about the size of the player, and if there were obstacles it would position the player on top of them 2 and 4) So that players could choose a position? I can't really remember 5) fuck knows Anyway good luck with your version, sounds like you've got a plan - I don't know why you think I'd be mad with you releasing a better version of my old crap :)
One issue Rei, it tends to push you through the ceiling, onto the roof if you're stuck between the ceiling and something below it :)
This is used in a BHOP server I play on and it consistently gets you unstuck but tp's you back and says failed. The way to bypass this is to crouch. Not sure if its a bug or not.
Just added this to my new server and it works great. I have another one of your addons as well and I've yet to have any problems with either of them.
@TripsLetash: yea, if you are under a ceiling. if i try to prefer pushing sideways more it would push you through walls more often. dunno if thats not worse ? lets wait for more feedback. We are using my version on LAN parties atm for gmod: sandbox, TTT, prophunt, zombiesurvival and all are very happy with it. @Onii_Chan: thats some other unstuck addon or another addon interfering. this one will only unstuck when u enter the command /unstuck
Don't get me wrong ,it does it's job perfectly! Maybe one thing that could be of use is checking if the player is actually touching anything at all before it tries to unstuck? Some of my players are exploiting it to double jump :c Not touching anything would mean that you're not stuck, right?
[QUOTE=TripsLetash;45835438]Don't get me wrong ,it does it's job perfectly! Maybe one thing that could be of use is checking if the player is actually touching anything at all before it tries to unstuck? Some of my players are exploiting it to double jump :c Not touching anything would mean that you're not stuck, right?[/QUOTE] I had this same problem. This quick fix worked for me: [code] local function UnStuck( ply ) if( ply:GetMoveType() == MOVETYPE_OBSERVER or not ply:Alive() or not ply:IsOnGround() ) then return end SendMessage( ply, 1 ) timer.Simple( 3, function() ply:Freeze( true ) FindNewPos( ply ) for k,v in pairs( player.GetAll() ) do if v:IsAdmin() or v:IsSuperAdmin() or v:IsUserGroup( "mod" ) then SendMessage( v, 7, ply ) end end end ) end [/code] I just added "IsOnGround()" so they can't do it mid air. This might break something else. There's tons of different ways to figure out if a player is stuck. I don't think one idea will cover everything. Creating a entity and all the timers is inefficient, I would imagine. I would recommend doing a hull trace, (on the player) with mins and maxs slightly larger then the player and checking if it's stuck. Just offering my input, not trying to sound rude.
[QUOTE=Drak_Thing;45836387]I had this same problem. This quick fix worked for me: [code] local function UnStuck( ply ) if( ply:GetMoveType() == MOVETYPE_OBSERVER or not ply:Alive() or not ply:IsOnGround() ) then return end SendMessage( ply, 1 ) timer.Simple( 3, function() ply:Freeze( true ) FindNewPos( ply ) for k,v in pairs( player.GetAll() ) do if v:IsAdmin() or v:IsSuperAdmin() or v:IsUserGroup( "mod" ) then SendMessage( v, 7, ply ) end end end ) end [/code] I just added "IsOnGround()" so they can't do it mid air. This might break something else. There's tons of different ways to figure out if a player is stuck. I don't think one idea will cover everything. Creating a entity and all the timers is inefficient, I would imagine. I would recommend doing a hull trace, (on the player) with mins and maxs slightly larger then the player and checking if it's stuck. Just offering my input, not trying to sound rude.[/QUOTE] Hey dude, the version i posted in this thread has no entity (oildrum) spawning. the original plugin doesnt even work - it only freezes the server. and in my version the size of the player AAB ("hull") is used to find a free spot. @double jump exploit: well i wrote this for LAN so there was no exploiting at all since we all love each other :D but if you have such dumbasses on your server you should maybe just ban them ;) if you really want to prevent this abuse just heavily accel them downwards for half sec then upwards. compensates the first jump. or you can do the world collision check and then the entitiy collision check before you unstuck as i had it in the beginning. BUT this may not catch all cases of beeing stuck especially when the solid world you are stuck in is a VERY small edge or you are burried under a prop and do not really collide with it but cant move.... But you should [B][U]NEVER EVER[/U][/B] use [B]IsOnGround()[/B], since most of the time you get stuck between props, you WONT touch the ground anymore. and that would completly render the plugin useless since you cant use it in 90% of the time then. (and in most cases you get stuck between props or above ground after dismounting a vehicle or hoverboard) Another exploit is for example, that you can use it to get through walls. i could prevent this by checking line of sight between old and new spot. if i have time and get more requests for this, i will maybe implement both anti-exploit mechanics. or you do it yourself or you just increase the cooldown delay for using it.
this may sound like a noobish comment but do I save this file in addons?
I also have the noobie question of where the hell do I put the zip file? I assume it's under "Gmod/garrysmod/gamemodes/prop_hunt/gamemodes/lua" and then put the autorun folder there? I currently have it there and have no luck with the !stuck command. I've tried !stuck /stuck !unstuck /unstuck and no luck. So I have to assume I have it in the wrong spot? I've also tried putting it in Gmod/garrysmod/addons and no luck there either.. Any help? Por favor!!!!???!!! Pleeeeeease!?
[QUOTE=Katiealey;46237589]I also have the noobie question of where the hell do I put the zip file? I assume it's under "Gmod/garrysmod/gamemodes/prop_hunt/gamemodes/lua" and then put the autorun folder there? I currently have it there and have no luck with the !stuck command. I've tried !stuck /stuck !unstuck /unstuck and no luck. So I have to assume I have it in the wrong spot? I've also tried putting it in Gmod/garrysmod/addons and no luck there either.. Any help? Por favor!!!!???!!! Pleeeeeease!?[/QUOTE] Download the zip file. Open the zip file. Inside there is a folder called 'unstuck'. Place the folder called 'unstuck' into /garrysmod/addons/. Restart your server.
[QUOTE=smithy285;46241413]Download the zip file. Open the zip file. Inside there is a folder called 'unstuck'. Place the folder called 'unstuck' into /garrysmod/addons/. Restart your server.[/QUOTE] Oh my gosh thank you so much T-T I love you. lol <3<3<3 Been looking for where to put it EVERYWHERE lol. Thank youuuuuuuuuuuuu!!!!
Link is down, please re-upload?
Why do you say the link is down ? My version from the 1st page is still online: [URL="https://dl.dropboxusercontent.com/u/2719927/unstuck.zip"]https://dl.dropboxusercontent.com/u/2719927/unstuck.zip[/URL] ...and thats the only one you should use, its rewritten. The thread starter should put the download link in his first post, if he cares.
Why don't you just use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/PhysObj/IsPenetrating]PhysObj:IsPenetrating[/url]? It's got a sexy name and it should work more accurately, considering the prop in question's origin might not be within the OBB of the player.
My only issue with the new version is now users in prophunt go through floors and ceilings when stuck in some maps lol. Not sure how that can be prevented.
[QUOTE=Eccid;44067249]Great update, thanks :D For anyone who wants more commands for this, or who want to customize them easily, you can always do this. On the latest version, go to line 131 and replace this: [code]if ( text == "!unstuck" or text == "!stuck" ) then[/code] with this: [code]if table.HasValue( STUCKCOMMANDS, string.lower(text) ) then[/code] and put this at the top of the file: [code]STUCKCOMMANDS={ "!stuck", "!unstuck" }[/code] You can modify and add more commands there, and it will work fine.[/QUOTE] In what folder/file is it?
Sorry, you need to Log In to post a reply to this thread.