events

  • This topic has 4 replies, 3 voices, and was last updated 4 years ago by das.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #15241
    elefantopia
    Participant

    I see in the doc that events are strings

    are there any other types that are more performant?

    #15259
    Gavalakis
    Keymaster

    Hello from here as well,

    There are two types of events, string-based events and Signals.
    String-Based events are the original events implemented a long time ago.
    In recent versions, Signals (scriptableobject-based) events were also implemented as an alternative events solution. (kudos to @aFoolsDuty on discord for their implementation).
    Both string-based events (old way) and signal-based events (new) can be used for the same purpose.

    Please take a look at the documentation here -> https://nodecanvas.paradoxnotion.com/documentation/?section=using-signal-events but also please feel free to ask me if you need any more information.

    Thank you.

    Join us on Discord: https://discord.gg/97q2Rjh

    #15291
    das
    Participant

    Oh I see, thank you.

    Let’s say a creature A spawns creatures B and when A is being attacked all B are attacking the attackant.

    How would I do this in the most performant manner? (it’s for the Switch)

    #15303
    Gavalakis
    Keymaster

    Hey,
    This is a bit of a vague question and can be done in many ways 🙂
    But, in general, you will need to store the “attacker”, then inform all other creatures that their “friend” is attacked and who the attacker is.
    This can probably be done easier with a global event (either string-based or Signal), and have the event also carry the “attacker” information as an argument (so that friends know whom the attacker is and attack it).
    I hope this helps 🙂

    Join us on Discord: https://discord.gg/97q2Rjh

    #15312
    das
    Participant

    It does, thank you.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.