Macros 102

Sdílet
Vložit
  • čas přidán 10. 09. 2020
  • Github Link: github.com/spacemandev-git/fv...
    You want the "attackMacro.js" file :)
    League of ExtraOrdinary Foundry Developers Discord: / discord
    Please remember to like this video and comment what kind of content you want to see next!

Komentáře • 51

  • @Neopoleon-I
    @Neopoleon-I Před 4 měsíci +3

    Noooo!!! Where did you go? We need more you! I've been reading docs, watching "tutorials", scouring Reddit... "Macros 101" and "Macros 102" are the most useful Foundry scripting resources I've found. Just had to do a little rewiring to conform all the data.data.data.data stuff to the v10 system.* stuff.
    Please come back. Give us a chance to Patreon you into the stratosphere. Or the troposphere. Any -sphere you'd like.
    I'm making a homebrew TTRPG (like everybody else in the whole universe), and it's been so. much. fun. But Foundry's documentation is a nightmare (thanks for publishing your horrifying API and three paragraphs of explanations, guys!).
    You're awesome. Please consider returning. You'd get a lot more traction now that so many of us have hopped from Roll20 to Foundry.
    Just saying.
    Even the wind is speaking. Listen to it: "Spaaaaaacemandeeeeeeev... come baaaaaaaaack... make videos... make moneeeeeeeeeeeeee..."

  • @drabodows
    @drabodows Před 2 lety +1

    Thanks for these videos. Sorry to see the series end.

  • @criticallyaccursed1628
    @criticallyaccursed1628 Před rokem +1

    I've been doing tons of work in Foundry for a custom TTRPG system I'm building and this is video has taught me more about macros and scripts than hours of googling ever could. Following along has not only been incredibly helpful, but also a fantastic way to learn. Thank you for the help!

  • @drunemeton
    @drunemeton Před 3 lety +6

    This is the beginning of a truly awesome series! Thank you.

  • @hexaedre
    @hexaedre Před 3 lety +3

    Thank you so much for these videos, they helped me get started. Now I can't stop!

  • @kapcore
    @kapcore Před 3 lety +2

    Thank you very much! I've created some wonderfull macro with zero knowledge in js thanks to you! Looking forward for new videos, hope you wil not throw far away creating such wonderfull content

  • @rodrickcampbell8817
    @rodrickcampbell8817 Před 2 lety

    Fandamntastic! Thank you for these videos.

  • @thiagosannafreiresilva4366

    Thank you so much for this series, man! Perfect amount of content and depth, and pacing as well. Cheers!

  • @PhilWaller
    @PhilWaller Před 3 lety +1

    Fantastic, thank you. Please show us more.

  • @Kram994
    @Kram994 Před 3 lety +1

    Once again a great tutorial and thanks for covering hooks too.

  • @ericnull3470
    @ericnull3470 Před 3 lety

    I wish there were more videos. In this series and in general. There were like 3 ppl making tutorials for FG coding and through them and the written info I got to where I could make my own extensions.
    I'm still struggling to use "changes" and make it so custom class features actually work in foundry. This community desperately needs more pros to do stuff like this.
    P.s. don't apologize for making mistakes. Ppl writing code that is all done "in advance" and perfect is actually less helpful. There is far more to be learned from mistakes than there is from just cutting and pasting perfect code. I'll be watching this (sadly short) series many times over. Thanks a million.

  • @VassTheKeeper
    @VassTheKeeper Před 3 lety +1

    Love your videos! Keep them coming!

  • @ptanstaafl
    @ptanstaafl Před 3 lety

    Fantastic stuff, learning a lot.

  • @MW-ic5yb
    @MW-ic5yb Před 3 lety +1

    Thanks for the great tutorials. I'd love to see more about writing script macros that incorporate rollable tables (and including the Better Tables module).

  • @mikk01975
    @mikk01975 Před 3 lety

    Super awesome and helpful video. The hardest part for me, not being a js programmer, was the seeming randomness of when a line should end with a semicolon and when not 😄

  • @bioinfolucas5606
    @bioinfolucas5606 Před 3 lety +1

    Don't stop it man! It's being pretty interesting!

  • @vitoremmanuel6939
    @vitoremmanuel6939 Před 2 lety

    wow! you covered a lot of topics! Thank you so much!

  • @Mike-gz8gy
    @Mike-gz8gy Před 3 lety

    Super solid series!!

  • @denysbielkin4471
    @denysbielkin4471 Před 3 lety

    Thanks a lot, man - you really helped me

  • @thomas054800
    @thomas054800 Před 2 lety

    This is sooo helpfull, thank you so much !

  • @haroldemmers3678
    @haroldemmers3678 Před 3 lety +1

    Great stuff, keep it up.
    And always keep the live debugging --> That's real life

  • @Metalpaved
    @Metalpaved Před 3 lety

    You're a hero Spacemandev

  • @darleth
    @darleth Před 3 lety

    Please continue with the macro tutorials. I find them amazing.

  • @brevbomb
    @brevbomb Před 3 lety

    Very nice. Hope you will make some more foundry tutorials.

  • @HytaleBrasilHC
    @HytaleBrasilHC Před 3 lety +3

    Wonderful series, man! I'm learning a lot from your videos. Looking forward to the next. Thanks for the amazing work!
    Taking advantage of the opportunity, is there any way to add variables, which are not native to the system, that can be used in multiple macros?

    • @Devenish97
      @Devenish97  Před 3 lety +1

      Absolutely, you can do this through flags or settings and store values on entities or on the game world respectively

    • @HytaleBrasilHC
      @HytaleBrasilHC Před 3 lety

      @@Devenish97 Sure. I'm not really a dev, but I think I understand. I'll do some tests later. Thank you!

    • @Devenish97
      @Devenish97  Před 3 lety +2

      @@HytaleBrasilHC we will cover flags and settings in my next video which will be a modules 101

    • @HytaleBrasilHC
      @HytaleBrasilHC Před 3 lety

      @@Devenish97 Great. I'm waiting.

  • @carllunden800
    @carllunden800 Před 3 lety

    So glad I found this video series! It gave me a great baseline of knowledge to feel confident enough to poke around with script macros. I'm trying to write a macro for Wild Surges in dnd 5e....Any idea how I would make a macro that prompts a player with a popup box to roll a d20 when whenever they expend a spell slot?

  • @edpacca
    @edpacca Před 3 lety

    This is fantastic stuff for learning the foundry api. I have been hacking away with foundry having a great time but have found JS wild to decipher, coming from junior level .NET. Would love to see a video building a simple module, how a module actually modifies the UI behind the scenes, and possibly how one makes the module options and settings for instance.
    One pointless finickity question, is there a reason in both your macro vids you go for "length == 0 || length > 1" rather than just "length != 1" ? Wondering if it's considered more readable or something like that.

  • @wesleyoliver1580
    @wesleyoliver1580 Před 2 lety

    Hello, I understand I'm a bit late lol, lovin the videos, great help. I just recently got foundry and started watching your videos. Quick question, how would you go about adding `flavor` to the `roll.toMessages` and have it populate with your selection of weapon from the drop down list? Or is there a different way to get the same effect? Thanks

  • @Parker8752
    @Parker8752 Před 3 lety +3

    The missing quote from the mod input is driving me nuts...

  • @thatclimberguy4883
    @thatclimberguy4883 Před 2 lety +1

    spacemandev would you be interested in discussing a macro that moves a token on the canvas? I am trying to spice up my vortex warp automation.

  • @NahrAlma
    @NahrAlma Před 2 lety

    Classic CSS issues with the float property. Float is an absolute mess. I will avoid that like the plague. You can very easily get unpredictable behaviour when using float, at least as long as you are a mere mortal. I'm sure the webdev gods of old will have mastered the trial that is float though.

  • @ThisQuietKid
    @ThisQuietKid Před 3 lety +1

    At 40:15, where do you go to find out what possible fields there are for a given object? i.e. how did you know that "speaker:" and "content:" were the keys you had to program in to set what you want?

    • @RainNoh
      @RainNoh Před 3 lety

      I'd like to know this as well. Is there some comprehensive, up-to-date documentation for the essential stuff somewhere or should one just go through Foundry author's code and look for examples? I know there's the official API documentation but it seems to missing some important stuff e.g. there's zero info on available options for ChatMessage.create() at foundryvtt.com/api/ChatMessage.html#.create

    • @ThisQuietKid
      @ThisQuietKid Před 3 lety +2

      @@RainNoh open the console (F12), console.log(game.messages), check out the data structure there. the discord is a bit more helpful for asking questions and learning than the online API doc

  • @p-leif630
    @p-leif630 Před 3 lety

    wow do I make a makro that works for hex crawls let me select tier of play terrain and then selcts the tables reols on a diffrtent tabke at certain results before putting it out

  • @ArnlaugBe
    @ArnlaugBe Před 3 lety

    Is there a way to refrence a specific actor without selecting a token? We do a lot of theatre of the mind and quite often there are no tokens to click.

  • @MrSour1
    @MrSour1 Před 2 lety

    for some reason on my end, it will only roll the weapon damage when i click the first button that appears on chat. after that, the other button's doesn't do anything. would anyone know what's going on?

  • @SoloMona18
    @SoloMona18 Před 2 lety

    I'm trying to make a Macro for Channel Divinity: Knowledge of the ages. where it automatically consumes a charge of the actor.resource labelled Channel Divinity, and if I can I want to input what skill I'm proficient in for the duration. Then I want it to remind me after 10 minutes to remove that proficiency. But I can't for the life of me figure out how to even find what resource has the label "Channel Divinity", anyone able to help with that?
    P.S. These tutorials are awsome, TY SO MUCH, been learning so much

  • @r2roberts
    @r2roberts Před 3 lety

    Since when can we use Optional Chaining (?. syntax)? I thought it isn't supported in Node until v14.x, and FVTT uses Node v12.x.

    • @Devenish97
      @Devenish97  Před 3 lety +3

      All the modules on Foundry run client side, not server side. There's no code that you can write that executes on the server. As such, the limitation of the ? syntax is limited by the browser implementations, which all now support it. developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining

    • @r2roberts
      @r2roberts Před 3 lety

      spacemandev Duh! I should have known that. Thanks. That’s something I need to keep in mind.

  • @alexrusanu3784
    @alexrusanu3784 Před rokem

    Hey is there any way to send messeges to you let me know i want to learn more from you but if you can please make a video to explain to me how to do it Basicly i want an atack macro for a sword but when i click on it i need a window to pop up and let me choose from multiple option and of course depending on the choice to afect the roll .
    Like for example i want to atack someone but i am in water i want the macro to ask me are you fighting in water. and if the answerr is yes to basicly subtract a penalty of 20 out of a d 100 roll.
    Please contact me i realy need some help to get things started .

  • @r2roberts
    @r2roberts Před 3 lety

    Aren't you afraid of a (very unlikely) race condition between ChatMessage.create() and Hooks.once()? ChatMessage.create() is async and, IIRC, awaits other async methods. Couldn't it happen if some other player created a chat message at just the wrong time?

  • @warzbent
    @warzbent Před 2 lety +1

    What ever happen to this guy?

  • @Freeze014
    @Freeze014 Před 3 lety +1

    So I used your excellent Macros 102 to improve/change the potion macro from last tutorial. Using the names of the 5e potions (Potion of Healing, Potion of Greater Healing, Potion of Superior Healing, Potion of Supreme Healing).
    And it works like a charm, it finds which potions the selected_token has, and puts those in a list in the drop down list, heals the targeted_token and removes 1 potion from the inventory. Yay all is great!
    But there is a but... it is ordered by the order they were added to the inventory (the order selected_actor.items.filter(item =>..... etc.... finds them in.). I would prefer to sort them by powerlevel. So the weakest is the first option and so on down to Supreme Healing. Is there a way to do that?
    i.imgur.com/Qxpafp7.png

    • @Devenish97
      @Devenish97  Před 3 lety +1

      Yes for that, simply sort the list by their heal value. Try something like this: stackoverflow.com/questions/43773092/how-to-sort-objects-by-value

    • @Freeze014
      @Freeze014 Před 3 lety

      @@Devenish97 That link was very helpful, however something quite interesting popped up. The object before sorting is iterable, after sorting the object is no longer iterable directly, and needs a step in between to iterate over the items in the object. Luckily that wasnt too hard to figure out, with the help of stackoverflow.com ;)