LoginSignup
0
0

【UEFN】 マップインジケーターの仕掛けをVerseで扱ってみる

Posted at

背景

チュートリアルやタイクーンなどでとてもよく使われているデバイスになります。どのように利用するか知りたかったので調査しました。

やること

トリガーを押して順番に次の目標を指すようにする

動画

実装

利用するDevice

トリガー
image.png
マップインジケーターの仕掛け
image.png

デフォルトの設定のまま使います。

配置

トリガーそれぞれの位置にインジケータを重ねて配置します。
image.png

全体コード

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

map_indicator_controller_device := class(creative_device):

    @editable
    Initial:trigger_device=trigger_device{}

    @editable
    SecondIndicator:map_indicator_device=map_indicator_device{}

    @editable
    ThirdIndicator:map_indicator_device=map_indicator_device{}

    @editable
    Second:trigger_device=trigger_device{}

    @editable
    Third:trigger_device=trigger_device{}

    OnBegin<override>()<suspends>:void=
        Initial.TriggeredEvent.Subscribe(Initialize)
        Second.TriggeredEvent.Subscribe(ActivateSecond)
        Third.TriggeredEvent.Subscribe(ActivateThird)

    Initialize(QAgent:?agent):void=
        if (Agent:=QAgent?):
            SecondIndicator.ActivateObjectivePulse(Agent)

    ActivateSecond(QAgent:?agent):void=
        if (Agent:=QAgent?):
            SecondIndicator.DeactivateObjectivePulse(Agent)
            ThirdIndicator.ActivateObjectivePulse(Agent)

    ActivateThird(QAgent:?agent):void=
        if (Agent:=QAgent?):
            ThirdIndicator.DeactivateObjectivePulse(Agent)

Initialトリガーでインジケータの矢印を有効化しセカンド、サードトリガーでインジケータの有無効化して順番に次の目標を指すように設定しています。

まとめ

タイクーンの場合だとインジケータデバイスの量が膨大になってしまいそうなので何とかして少なくしてみたいと考えています。こちらもAgentさえ取得できれば簡単にできそうですね。

余談

この度UEFN/Verseに関するオープンコミュニティサーバーを建ち上げました。ちょっとでも興味があれば奮ってご参加くださいませ。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0