Hi,
I have a lot of triggers on the map and I want to select them all (a tag is placed on triggers) and add them automatically to the tracker in place “incremental progress”.
I need to use verse for this.
Thanks
Hi,
I have a lot of triggers on the map and I want to select them all (a tag is placed on triggers) and add them automatically to the tracker in place “incremental progress”.
I need to use verse for this.
Thanks
You’d want to create a tag, mark the trigger devices with the tag. Then go through every device with a for loop, and subscribe to the .TriggeredEvent(). Then, call another function, which will increment the tracker. In my case, it looks like this:
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /Verse.org/Simulation/Tags }
triggers := class(tag){}
trigger_increment := class(creative_device):
@editable Tracker : tracker_device = tracker_device { }
OnBegin<override>()<suspends>:void=
for (TriggerObject : GetCreativeObjectsWithTag(triggers{}),
Trigger := trigger_device[TriggerObject]):
Trigger.TriggeredEvent.Subscribe(OnTrigger)
OnTrigger(MaybeAgent : ?agent):void=
if (Agent := MaybeAgent?):
Tracker.Increment(Agent)
Thanks, I have one more question if you can help me.
When it comes to multiplayer, I need when a player activates the trigger, the trigger is deactivated for that player, but others players can activate it, and of course for each player who activates it after that trigger deactivated for him.
As far as I know, it’s not possible to locally show the trigger being disabled - meaning, that visually it will be the same for every person in the server. I might be wrong though.
What you can do, is add the players to a map when they trigger the device. If they then again try to trigger the device, you check the map for their name. If it exists, they’ve already triggered the device, so therefore we just ignore the trigger. Otherwise, we can pursue as we would normally.
Hope that makes sense.