Delegating

Поделиться
HTML-код
  • Опубликовано: 27 янв 2025

Комментарии • 8

  • @Slangnegativ
    @Slangnegativ 3 года назад

    Hey, just wanted to say I discovered your videos and it has been super useful. Thank you very much!

  • @nottud
    @nottud  4 года назад +1

    Looks like when I deleted the example int parameter I forgot to remove the , after the string one. That should have been removed but somehow it didn't break anything. Also out of interest which I did not cover - when providing multiple pieces of information you comma separate them like I did for the receiving end. Finally, when receiving a value if the caller does not provide a value then the default value is used - for the message example an empty string would have been used if I did not provide a message text. Providing default values in the declarations is mandatory for Age of Mythology.

  • @philipwolfe4231
    @philipwolfe4231 4 года назад

    Is it possible to delegate with the "for players" trigger? I tried several different ways but couldn't ever make it work.

    • @nottud
      @nottud  4 года назад

      You should be able to delegate as per usual but you don't be able to use variable substitution in the delegate name as it won;t recognise what you are delegating to. Of course you can pass variable p as an int parameter though!

    • @philipwolfe4231
      @philipwolfe4231 4 года назад

      ​@@nottud It seems it works by putting For Players in the trigger running the delegation, but doesn't seem to work when I put For players inside the delegation trigger itself, however I might have the syntax wrong. I don't think you show the trigger actually using the delegate effect in the video.
      In your example here, what is the triggerChat effect syntax? I assume the effect is Delegate and the parameter name is redChatSound, but what do you put for the Parameters and are there any other effects you need to put in there or just the Delegate effect?

    • @nottud
      @nottud  4 года назад +1

      @@philipwolfe4231 Using a for each player as a delegate condition and effect doesn't make such sense with the way I coded it so I am not surprised it does not work that way round. Parameters are just how to pass pieces of information - you can put something like int x = 2, int y = 5 in the parameters in the delegate effects method (Each declaration comma seperated), with will declare variables x and y to be available for the rest of the trigger. When calling deleate you just put the values you want to set x and y to be e.g. 12, 23 (Each value comma seperated). This will set values from of the variables to those values. If you omit providing values the default declared values will be used for each variable not declared - in my example 2, 5.

    • @philipwolfe4231
      @philipwolfe4231 4 года назад

      @@nottud Works perfectly! Thanks a bunch!

  • @aomcustommaps5471
    @aomcustommaps5471 4 года назад

    :)