Avoiding an actor getting stuck onto another actor while teleporting or moving while non-solid?
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
Avoiding an actor getting stuck onto another actor while teleporting or moving while non-solid?
Basically what i want to know is that is there a known hack or solution around teleporting an actor or have a physical-state undone without having said actor stuck inside another by accident? Some games fixes a such issue by slightly pushing the actors away from eachother until they aren't inside one another but i am not certain if that is even possible in doom. Like perhaps there's a way to make a character get a through actor flag until its not inside another actor or something?
By the way i would like to detail i am trying to find a way to do this without causing telefrags if possible? Because i intend to have some weapons with special mobility options but i don't want them to be exploited to get cheap insta-kills 24/7 but neither want people to get stuck and not able to un-do it.
Been thinking having an actor use a_warp on itself by testing possible areas in a single tick until its possible and teleports there but im not sure its even possible and i fear that even then it might lead to a player getting stuck inside ANOTHER actor by then.
By the way i would like to detail i am trying to find a way to do this without causing telefrags if possible? Because i intend to have some weapons with special mobility options but i don't want them to be exploited to get cheap insta-kills 24/7 but neither want people to get stuck and not able to un-do it.
Been thinking having an actor use a_warp on itself by testing possible areas in a single tick until its possible and teleports there but im not sure its even possible and i fear that even then it might lead to a player getting stuck inside ANOTHER actor by then.
Re: Avoiding an actor getting stuck onto another actor while teleporting or moving while non-solid?
Well, it's shitty to manage. It's totally possible though. You should use SetActorPosition, as it doesnt force the player to teleport, and returns whenever it succeeded in teleporting. If it's false, you can move coordinates around a bit with some math until it works.
- ibm5155
- Addicted to Zandronum
- Posts: 1641
- Joined: Tue Jun 05, 2012 9:32 pm
- Location: Somewhere, over the rainbow
Re: Avoiding an actor getting stuck onto another actor while teleporting or moving while non-solid?
spawn something solid at the coord that you want, if it failed to spawn you know he'll get stucked there.
But still there re no good ways, maybe teleport the actor, make him call an script that sets him non solid only when there's nothing under him
But still there re no good ways, maybe teleport the actor, make him call an script that sets him non solid only when there's nothing under him
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!
<this post is proof of "Decline">
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!
<this post is proof of "Decline">
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
Re: Avoiding an actor getting stuck onto another actor while teleporting or moving while non-solid?
Hm... i suppose it could work... one idea i had was to use a playermorph when teleporting where the player is temporarily turned into an alternate version of its class which has +thruactors for a single tick and cancels if it is possible to un-transform, and keeps it that way if not.Fused wrote: ↑Thu Apr 05, 2018 9:53 pmWell, it's shitty to manage. It's totally possible though. You should use SetActorPosition, as it doesnt force the player to teleport, and returns whenever it succeeded in teleporting. If it's false, you can move coordinates around a bit with some math until it works.
But it seems i'll have some tinkering to do, thanks for the starting point.
Re: Avoiding an actor getting stuck onto another actor while teleporting or moving while non-solid?
You should be able to apply flags on an actor by simply giving an item, calling A_ChangeFlag. I had this working before but it's broken now, so I will have to check why before giving a good example
Re: Avoiding an actor getting stuck onto another actor while teleporting or moving while non-solid?
I quickly made a function that checks if a location has enough room for said actor:
You could pass this function as an argument or use it in an if statement to make sure it's safe to teleport an actor.
Code: Select all
function bool EnoughRoom (str class, int x, int y, int z)
{
int tempTID = UniqueTID();
int canSpawn = Spawn(class, x, y, z, tempTID);
if (!canSpawn)
return false;
Thing_Remove(tempTID);
return true;
}
<Dynamo_>uh
<Dynamo_>did you just take the thread away
<FusedQyou>Dunno
<FusedQyou>ask the thread
<Dynamo_>did you just take the thread away
<FusedQyou>Dunno
<FusedQyou>ask the thread
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
Re: Avoiding an actor getting stuck onto another actor while teleporting or moving while non-solid?
I just realized my technique won't work because the player's velocity is stopped whenever it is morphed or un-morphed, which will get obnoxious very quickly i feel.
Also:
Also:
The problem with this is that, doesn't it suck when you try to use an item in a game and it decides to tell you "no" for something that is beyond your control?jdagenet wrote: ↑Fri Apr 06, 2018 9:57 pmI quickly made a function that checks if a location has enough room for said actor:You could pass this function as an argument or use it in an if statement to make sure it's safe to teleport an actor.Code: Select all
function bool EnoughRoom (str class, int x, int y, int z) { int tempTID = UniqueTID(); int canSpawn = Spawn(class, x, y, z, tempTID); if (!canSpawn) return false; Thing_Remove(tempTID); return true; }