DayZ
PvZmoD_TheDarkHorde
 This topic has been pinned, so it's probably important
Liven  [developer] Feb 26, 2021 @ 7:52am
How to trigger a custom teleportation event
Here is the instructions to allows the admins to trigger the custom teleportation event.

First Step, you have to allow the system to run custom events.
In Pvz_TheDarkHorde_EventManager.xml :
Activate_Namalsk_Event_System set to 0.
Activate_Custom_Event_System set to 1.
You can’t activate both together.

Note that when a custom event is trigger, the settings from “Pvz_TheDarkHorde_EventManager.xml” are used except “Teleport_Players_During_Namalsk_EVR_Storm” section.

Trigger the event by shortcut:
A shortcut have been added in your game settings (in the Dark Horde section of the game shortcuts). By default this shortcut is not set to not conflict with other features as it shouldn’t be used often (and to not accidentally trigger the event), so you first have to choose the key you want to trigger the event.
Now you can easily trigger the event if you are an admin (your SteamID is in Admins.txt), you just have to press your “Custom event” shortcut.
All players will be teleported to a location near to the horde.

Trigger the event by code:
You can trigger the event with code if you need to trigger it at a specific time or to teleport only some players.
You will have to code yourself the conditions to trigger the event and to choose the players who will be teleported.
You can use these functions to manage the custom events:

Get_Pvz_DH_TriggerEvent.StartEventForAllPlayers();
It will instantly trigger the event for all players, nothing else to do (like the Manual trigger shortcut).

If you want to choose the players to teleport, you first have to trigger the horde (this activate the custom event):
Get_Pvz_DH_TriggerEvent.TriggerTheHorde();
Then teleport one by one the players you want:
Get_Pvz_DH_TriggerEvent.TeleportPlayer(notnull PlayerBase thePlayerBase, bool refreshHordePosition = false, bool forceTeleportation = false);
  • thePlayerBase (PlayerBase) : Player that will be teleported.
  • refreshHordePosition (bool) : Set it to true if the “Teleport_The_Horde_To_An_Empty_Place” is set to 0 or if the player is teleported at least few seconds after the horde have been teleported (note that the horde is teleported after “TriggerTheHorde” is called and “Horde_Spawn_Timer” has ended).
  • forceTeleportation (bool) : You don’t need it, keep it to false.
Don’t forget to set a “Horde_Spawn_Timer” if you need time between the “TriggerTheHorde” and the horde teleportation.
Remember you can find useful informations in the help.txt files included in the profile folder.
Last edited by Liven; Feb 26, 2021 @ 7:53am