This week I've been working on a checkpoint system especially for MH servers that is completely automatic, requiring no input from the player. It's almost done but I'm stuck on how to clear a checkpoint if they get placed in certain bad situations. For instance if you survive a fall into a deep well you could get your checkpoint updated to there and be stuck.
Ideally I need to monitor for the client when they use a suicide command. The normal way of ScoreKill Killer check won't do because it clears the points if you fall into lava, etc (which is one of the things I need to help). I really wanted to make this client command-less outside of default stuff but I think I'm painted into a corner here. Would love any ideas if you can help.
Monitoring suicide
-
- Godlike
- Posts: 3776
- Joined: Fri Jan 14, 2011 1:53 pm
- Personal rank: -Retired-
-
- Godlike
- Posts: 1204
- Joined: Mon Aug 31, 2015 10:31 pm
Re: Monitoring suicide
If you know what actor should be reached, then you could make some calculation using one of these functions from within Pawn.uc:JackGriffin wrote:This week I've been working on a checkpoint system especially for MH servers that is completely automatic, requiring no input from the player. It's almost done but I'm stuck on how to clear a checkpoint if they get placed in certain bad situations. For instance if you survive a fall into a deep well you could get your checkpoint updated to there and be stuck.
Ideally I need to monitor for the client when they use a suicide command. The normal way of ScoreKill Killer check won't do because it clears the points if you fall into lava, etc (which is one of the things I need to help). I really wanted to make this client command-less outside of default stuff but I think I'm painted into a corner here. Would love any ideas if you can help.
Code: Select all
//LineOfSightTo() returns true if any of several points of Other is visible
// (origin, top, bottom)
native(514) final function bool LineOfSightTo(actor Other);
// CanSee() similar to line of sight, but also takes into account Pawn's peripheral vision
native(533) final function bool CanSee(actor Other);
native(518) final function Actor FindPathTo(vector aPoint, optional bool bSinglePath,
optional bool bClearPaths);
native(517) final function Actor FindPathToward(actor anActor, optional bool bSinglePath,
optional bool bClearPaths);
//Reachable returns what part of direct path from Actor to aPoint is traversable
//using the current locomotion method
native(521) final function bool pointReachable(vector aPoint);
native(520) final function bool actorReachable(actor anActor);
Some of the stuff I created:
Mods: VisualStreamPlayer, TeamColorOverlay, FunkyMoves, CommandSystem, FunkyPointer, AdvancedMutator, CommandEvent, ParticleSystem, LifeSucks
Gametypes: UTRoyale, UnrealRace
Hacks : Create/Write files with UScript, Read files with UScript, Running files with UScript
Maps: CTF-(POF)-Escher_Fix, CTF-(NotYet)HyperBlast, DM-(NotYet)Condemned, CTF-StalwartXS, UR-Hyperblast, DM-3072-ItalyKinda, DOM-NRMC-Cathode, CTF-TAMC-UnderPressure
Concepts: RabbitHole, Builder gun, HeatMap, Playable arcade cabinet, Stalwartception, Non Conventional Weapons, MainFrame
Memes: Meme#1, Meme#2
Mods: VisualStreamPlayer, TeamColorOverlay, FunkyMoves, CommandSystem, FunkyPointer, AdvancedMutator, CommandEvent, ParticleSystem, LifeSucks
Gametypes: UTRoyale, UnrealRace
Hacks : Create/Write files with UScript, Read files with UScript, Running files with UScript
Maps: CTF-(POF)-Escher_Fix, CTF-(NotYet)HyperBlast, DM-(NotYet)Condemned, CTF-StalwartXS, UR-Hyperblast, DM-3072-ItalyKinda, DOM-NRMC-Cathode, CTF-TAMC-UnderPressure
Concepts: RabbitHole, Builder gun, HeatMap, Playable arcade cabinet, Stalwartception, Non Conventional Weapons, MainFrame
Memes: Meme#1, Meme#2
-
- Godlike
- Posts: 3776
- Joined: Fri Jan 14, 2011 1:53 pm
- Personal rank: -Retired-
Re: Monitoring suicide
Those are good in many situations but I need a pretty foolproof way of clearing any points if the player wants to reset themselves. I've already accounted for being overwhelmed: you can only use a checkpoint once. You must live long enough to spawn another one or you reset to the start. That fixes most of the bad scenarios but with the crazy health that some MH maps give you it's easy to get to the bottom of places like MH-Cliffs and still be alive. In that case the player ends up suiciding to continue as they don't really have another choice. That's really the event I need to catch but I just don't know how without a player subclass. Suicide messages can be personalized so that's out. Grrr, I hate being so close yet so far.
So long, and thanks for all the fish
-
- Godlike
- Posts: 1963
- Joined: Sat Sep 17, 2011 4:32 pm
- Personal rank: Dame. Vandora
- Location: TN, USA
Re: Monitoring suicide
Try a !undoCheckPoint which should take you back to the previous location set? Just an idea.
-
- Godlike
- Posts: 3776
- Joined: Fri Jan 14, 2011 1:53 pm
- Personal rank: -Retired-
Re: Monitoring suicide
Commands are the downfall of a checkpoint system. If the admin wants it implemented it should be silent and just 'work'. I have Bob's version of SamSpawn on my Unreal server and I love it. You don't do anything, it just silently monitors you and respawns if you need it. It's hugely helpful and requires no new knowledge. This version is very much in line with that thinking. It will have a small marker placed at your last saved checkpoint but it's only visible by you to keep map clutter to a minimum. This is really nice to have for maps that are heavy with BT and you suck at that (:raises hand:).JackGriffin wrote:completely automatic, requiring no input from the player
As it is now I'm removing checkpoints when you respawn so you could suicide twice in a row and reset yourself but I'd like it to be cleaner than that.
So long, and thanks for all the fish
-
- Godlike
- Posts: 1204
- Joined: Mon Aug 31, 2015 10:31 pm
Re: Monitoring suicide
You could use the PrevetDeath() callback in Mutator and check if the damage type is 'suicide'.JackGriffin wrote:Ideally I need to monitor for the client when they use a suicide command. The normal way of ScoreKill Killer check won't do because it clears the points if you fall into lava
Some of the stuff I created:
Mods: VisualStreamPlayer, TeamColorOverlay, FunkyMoves, CommandSystem, FunkyPointer, AdvancedMutator, CommandEvent, ParticleSystem, LifeSucks
Gametypes: UTRoyale, UnrealRace
Hacks : Create/Write files with UScript, Read files with UScript, Running files with UScript
Maps: CTF-(POF)-Escher_Fix, CTF-(NotYet)HyperBlast, DM-(NotYet)Condemned, CTF-StalwartXS, UR-Hyperblast, DM-3072-ItalyKinda, DOM-NRMC-Cathode, CTF-TAMC-UnderPressure
Concepts: RabbitHole, Builder gun, HeatMap, Playable arcade cabinet, Stalwartception, Non Conventional Weapons, MainFrame
Memes: Meme#1, Meme#2
Mods: VisualStreamPlayer, TeamColorOverlay, FunkyMoves, CommandSystem, FunkyPointer, AdvancedMutator, CommandEvent, ParticleSystem, LifeSucks
Gametypes: UTRoyale, UnrealRace
Hacks : Create/Write files with UScript, Read files with UScript, Running files with UScript
Maps: CTF-(POF)-Escher_Fix, CTF-(NotYet)HyperBlast, DM-(NotYet)Condemned, CTF-StalwartXS, UR-Hyperblast, DM-3072-ItalyKinda, DOM-NRMC-Cathode, CTF-TAMC-UnderPressure
Concepts: RabbitHole, Builder gun, HeatMap, Playable arcade cabinet, Stalwartception, Non Conventional Weapons, MainFrame
Memes: Meme#1, Meme#2
-
- Godlike
- Posts: 1963
- Joined: Sat Sep 17, 2011 4:32 pm
- Personal rank: Dame. Vandora
- Location: TN, USA
Re: Monitoring suicide
I see. Maybe a detector like it notice the player is in a falling physic, if last longer than 5 seconds, movement keys were pressed but no moves were detected from that location, it could set you back some? Another thought.
-
- Godlike
- Posts: 6443
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: Monitoring suicide
Are you done ? Okay, My turn.
Do this actor normally and owned by player. Player dies, R.I.P. player...
Spawning in bad spot and dying again ? So what "mutate nocheck" to remove that thing for the moment and then allow player to spawn in a normal spot. DONE !
Useful ? Killed by a strong Bad-Ass monster and spawning again nearby for being killed again ? Why do you need this ?
Solution 2 - The clock
Player spawned but died after 5 seconds - this is not a good thing - spot is not safe - remove checker, let player to spawn normally and assign a new checker again or the same checker going disabled for 15 seconds or X time, or configurable time, or... eh, this wine is too good.
Ok, next, carry on...
Do this actor normally and owned by player. Player dies, R.I.P. player...
Spawning in bad spot and dying again ? So what "mutate nocheck" to remove that thing for the moment and then allow player to spawn in a normal spot. DONE !
Useful ? Killed by a strong Bad-Ass monster and spawning again nearby for being killed again ? Why do you need this ?
Solution 2 - The clock
Player spawned but died after 5 seconds - this is not a good thing - spot is not safe - remove checker, let player to spawn normally and assign a new checker again or the same checker going disabled for 15 seconds or X time, or configurable time, or... eh, this wine is too good.
Ok, next, carry on...
-
- Godlike
- Posts: 3776
- Joined: Fri Jan 14, 2011 1:53 pm
- Personal rank: -Retired-
Re: Monitoring suicide
I think I've settled on number two. It lays down a checkpoint every fifteen seconds but deletes it when you use it. This way if you die within 15 seconds of spawning it will take you back to the playerstart. Checkpoints will not spawn in any sort of damage zone, if you are not in contact with the ground, swimming, ghosting, on a mover, or in or near a teleporter/warpzone. I think I've covered all the bases.
I'm going to server test this over a couple of days. If it's all good I'll post a formal release. This is the first part of the MHBasic gametype I'm working on but there's no reason anyone else can't use this now.
I'm going to server test this over a couple of days. If it's all good I'll post a formal release. This is the first part of the MHBasic gametype I'm working on but there's no reason anyone else can't use this now.
So long, and thanks for all the fish