Spawn on checkpoint or freeze/unfreeze player
Moderator: English Moderator
Spawn on checkpoint or freeze/unfreeze player
I need a short duration of inactivity before or after a player is respawned at a checkpoint. A normal spawn procedure would be good but is it possible to spawn a player at the checkpoint? If not, is it possible to freeze player after a respawn at a checkpoint, then unfreeze?
- BigBang1112
- Posts: 389
- Joined: 20 Jul 2015, 12:44
- Manialink: bigbang1112
- Location: Czech Republic
- Contact:
Re: Spawn on checkpoint or freeze/unfreeze player
Script-defined spawning outside the Start waypoint isn't currently possible.
There's only one solution to this I can think of.
I haven't tested, but you might be able to disable player movement by applying a UI sequence UIInteraction to the player when Respawn event is detected:
Here is my idea:
Hope my a bit late answer helps!
There's only one solution to this I can think of.
I haven't tested, but you might be able to disable player movement by applying a UI sequence UIInteraction to the player when Respawn event is detected:
Here is my idea:
Code: Select all
foreach(Event in PendingEvents) {
switch(Event.Type) {
case CTmModeEvent::EType::Respawn: { // On event respawn to checkpoint (not to start)
declare Integer Frozen for Event.Player; // Variable will be held by the player
Frozen = Now; // Frozen variable is basically timestamp when player froze
UIManager.GetUI(Event.Player).UISequence = CUIConfig::EUISequence::UIInteraction;
}
}
}
foreach(Player in Players) {
declare Integer Frozen for Event.Player;
if(Frozen != 0) { // If the player is actually frozen, 0 means not being frozen
if(Now - Frozen >= 5000) { // If the player is frozen for 5 seconds
Frozen = 0; // Set the player to not be frozen
UIManager.GetUI(Event.Player).UISequence = CUIConfig::EUISequence::Playing; // Unfreezes the player
}
}
}
Creator and competent racer. YouTube Discord
- ENVIMIX (out in open-source)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows
- ENVIMIX (out in open-source)
- Challenge (OUT NOW)
- Leaderboards (OUT NOW)
- Compute Shadows
Who is online
Users browsing this forum: No registered users and 0 guests