Drunken Wrestlers 2

Drunken Wrestlers 2

Time Trial
 This topic has been pinned, so it's probably important
Oleg Skutte  [developer] 26 Dec, 2019 @ 5:51am
How to make a map for this gamemode
0) Open this gamemode in editor and add IgnoreObject component to "Gamemode" GameObject

1) Make a map with start and finish

2) Call TimeTrial.StartTimer() when player starts and TimeTrial.Finish() when player finishes.

Example of collision triggered finish script:
using UnityEngine; using DrunkenWrestlers2.Gameplay; public class TimerFinish : MonoBehaviour, IPlayerCollisionHandler { public void OnPlayerCollision(PlayerCollisionData collision) { if(collision.Player==GameplayManager.LocalPlayer) TimeTrial.Finish(); } }
Make sure you ignore everyone but the local player as demonstrated with if(collision.Player==GameplayManager.LocalPlayer) in the code above

3) OPTIONAL:
If your map is failable, you can use TimeTrial.SetCheckpoint() to set a checkpoint and TimeTrial.ToCheckpoint() if a player has failed.

Example of setting a checkpoint:
using UnityEngine; using DrunkenWrestlers2.Gameplay; public class Checkpoint : MonoBehaviour, IPlayerCollisionHandler { public Vector3 offset; public void OnPlayerCollision(PlayerCollisionData collision) { if(collision.Player==GameplayManager.LocalPlayer) TimeTrial.SetCheckpoint(transform.position+offset); } }

4) When uploading to workshop, use this compatibility tag: time01

You can see more examples by opening this map in the editor:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1944652237
Last edited by Oleg Skutte; 12 Feb, 2020 @ 10:57am