file PlatinumQuest .mis mod callbacks

  • HiGuy
  • HiGuy's Avatar Topic Author
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1333
  • Thank you received: 604
13 Jul 2017 21:07 - 13 Jul 2017 21:08 #1
There are a bunch of functions you can use in your .mis file to do code routines at various points. These are reset on mission load and you can override them without causing any conflicts. Here's a list of the callbacks:

[hr]Client Callbacks:

Code:
function clientCbOnOutOfBounds() {}
Called when you go out of bounds.

Code:
function clientCbOnRespawn() {}
Called when you respawn on the startpad, or a trigger in a hunt match.

Code:
function clientCbOnRespawnOnCheckpoint() {}
Called when you respawn on a checkpoint.

Code:
function clientCbOnActivateCheckpoint() {}
Called when you activate a new checkpoint.

Code:
function clientCbOnPlayerJoin() {}
Called when a player joins the server you're on.

Code:
function clientCbOnPlayerLeave() {}
Called when a player leaves the server you're on.

Code:
function clientCbOnMissionLoaded() {}
Called when the mission finishes loading.

Code:
function clientCbOnMissionEnded() {}
Called right before the mission is unloaded.

Code:
function clientCbOnMissionReset() {}
Called when the mission resets, this mostly for restarts.

Code:
function clientCbOnRestartLevel() {}
Called when the mission is explicitly restarted (via button or oob).

Code:
function clientCbOnEndGameSetup() {}
Called before the end game screen is shown.

Code:
function clientCbOnHuntGemSpawn() {}
Called when a set of gems spawns in a hunt match.

Code:
function clientCbOnFrameAdvance(%delta) {}
Called every frame, %delta is the frame time in milliseconds.

[hr]Server Callbacks

Code:
function serverCbOnMissionLoaded() {}
Called when the mission finishes loading.

Code:
function serverCbOnMissionEnded() {}
Called right before the mission is unloaded.

Code:
function serverCbOnMissionReset() {}
Called when the mission resets, this mostly for restarts.

Code:
function serverCbOnEndGameSetup() {}
Called before the end game screen is shown.

Code:
function serverCbOnOutOfBounds() {}
Called when a client on the server goes out of bounds.

Code:
function serverCbOnRespawn() {}
Called when a client on the server respawns.

Code:
function serverCbOnFrameAdvance(%delta) {}
Called every frame, %delta is the frame time in milliseconds.


In general you should use the server callbacks (especially if it's a multiplayer map) for map logic and map-global events. Client callbacks are better for interface updates.

This signature is real code
Code:
function clientcmd12dothepq() { commandToClient(LocalClientConnection, '34onthedancefloor'); }
Last edit: 13 Jul 2017 21:08 by HiGuy. Reason: Formatting
The following user(s) said Thank You: Regislian, Weather, Yoshicraft224

Please Log in or Create an account to join the conversation.

  • Posts: 193
  • Thank you received: 69
17 Jul 2017 22:01 #2
Can these be used for custom levels? Like if you want something to happen after someone does one of these things?

SoundCloud page here:

Please Log in or Create an account to join the conversation.

  • Weather
  • Weather's Avatar
  • Offline
  • Professional Marbler
  • Professional Marbler
  • Posts: 483
  • Thank you received: 262
17 Jul 2017 22:34 #3

Please Log in or Create an account to join the conversation.

  • HiGuy
  • HiGuy's Avatar Topic Author
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1333
  • Thank you received: 604
18 Jul 2017 01:42 #4
Slight change coming to these in 2.0.13, serverCbOnOutOfBounds and serverCbOnRespawn will now take a %client arg (duh).

This signature is real code
Code:
function clientcmd12dothepq() { commandToClient(LocalClientConnection, '34onthedancefloor'); }

Please Log in or Create an account to join the conversation.

Moderators: Doomblah
Time to create page: 0.868 seconds
We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.