Page 1 of 1
GiveUp as reset to spawn (TM2)
Posted: 03 Sep 2016, 22:28
by BigBang1112
Hello
I'm asking again a very simple thing, but I just can't find it ANYWHERE.
Which functions should I use to get GiveUp event work as in TM solo or TimeAttack in custom gamemode?
I looked at Platform mode, TimeAttack mode which got these working, there's almost nothing seen about it.
Can ya help me? Thanks for any answers.
Re: GiveUp as reset to spawn (TM2)
Posted: 03 Sep 2016, 23:42
by Dommy
This enumerator defines all kinds of respawn events handling possible:
Code: Select all
CTmMode::ETMRespawnBehaviour {
Normal,
DoNothing,
GiveUpBeforeFirstCheckPoint,
AlwaysGiveUp
}
To get it working you need to change this variable:
Code: Select all
ETMRespawnBehaviour CTmMode::RespawnBehaviour
Quick summary of all respawn buttons behaviours:
- Normal - Backspace always fires "Respawn" and Delete always fires "GiveUp" (Rounds mode behaviour, also used for Pursuit)
- DoNothing - Nothing is fired
- GiveUpBeforeFirstCheckPoint - Both buttons fire "GiveUp", except that Backspace fires "Respawn" if player crossed at least one checkpoint (TimeAttack mode behaviour)
- AlwaysGiveUp - Both buttons always fire "GiveUp"
Re: GiveUp as reset to spawn (TM2)
Posted: 03 Sep 2016, 23:51
by BigBang1112
Well, I didnt mean that exactly,
I already set this variable to AlwaysGiveUp, but how do I get the player to spawn again and not became spectator?

Re: GiveUp as reset to spawn (TM2)
Posted: 04 Sep 2016, 01:00
by Dommy
Code: Select all
foreach (Player in Players) if (TM2::IsWaiting(Player)) TM2::StartRace(Player);
This will spawn all players that are not spawned yet.
Re: GiveUp as reset to spawn (TM2)
Posted: 04 Sep 2016, 13:19
by BigBang1112
It kind of works, but the player is frozen with ??? time.
I bet it's some simple function again, but I can't find it anywhere xD
Re: GiveUp as reset to spawn (TM2)
Posted: 04 Sep 2016, 14:30
by Dommy
Make sure that you have set this after starting map:
Code: Select all
UIManager.UIAll.UISequence = CUIConfig::EUISequence::Playing;
It might also be a problem in this case:
There shouldn't be problem when you set it to:
Re: GiveUp as reset to spawn (TM2)
Posted: 18 Mar 2017, 17:23
by BigBang1112
I'm here from the future.
I found the best way to do the respawn technique.
Code: Select all
while(!ServerShutdownRequested) {
foreach (Player in Players)
if(PlayersWaiting.exists(Player))
SpawnPlayer(Player,0,Now + 3000);
}
No need to include any library with this way.