Foundry VTT system dev - Part 1: system setup and first item sheet

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

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

  • @oatveal
    @oatveal  3 года назад +12

    PSA: Some of the video is out of date as of Foundry 0.8. Please watch Part 9.5 (link in the description) after this before asking for help. I will NOT make an updated version of this video.

  • @micka190
    @micka190 7 месяцев назад +3

    14:55 - For anyone developing a system, this step also allows your editor to detect the JS Docs that define the official Foundry API. It'll make your Intellisense/code suggestions better and will provide documentation along with it. Do yourself a favor and add it from the start.
    Signed: Someone who waited way too long before actually doing this and is now realizing that it would've made their lives infinitely easier after doing it.

  • @volkanmutlu501
    @volkanmutlu501 Год назад +3

    Thank you so much for this series, its very helpful! Also, absolutely love the Chef John touch at 20:51!

  • @foamheart
    @foamheart 4 года назад +2

    Thank you very much! I just started with Foundry system development and was looking for a good introduction to the API, tooling and project organization. Glad I found your series.

  • @Exluso
    @Exluso 4 года назад +16

    If anyone is struggling with localization as I did, notice that there is a correction at about 21:52 on line 21 of the _config.js_.
    Add the _localize_ keyword in the handlebar's moustache.
    This probably goes without saying for someone used to Handlebars but... took me a good amount of time and neurons to find it out.
    (I admit I am trying to learn handlebars on the go here...)

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

      For me too. I did not understand why the first version of that like did work. But solving the problem all by myself taught me a bit about developing for Foundry.

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

      When I did {{localize fs2e.weapon.attackWith}} it appeared in foundry as "fs2e.weapon.attackWith" instead of what I specified in en.json file. I checked the config.js and made sure it was proper and even changed the config.js text. When I changed the config.js text it worked in foundry but as was pointed out in the video I don't want to hardcode that language in. Any tips?

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

      @@kevinlandwehr2591 Not sure about your workflow, but the first that comes to my mind is: "ouch! I forgot to import the new text file". I create the text on a Calc.ods for each language and export it to FVTT via a macro. Usually when I have the ID in place of the text means that I create the text on the Calc file but didn't update the one in Foundry.
      It's really the silliest advice I can give but it's really the most common mistake I do.

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

      @@Exluso well after a frustrating time trying to figure out where I went wrong I did a console.log of my config and suddenly it worked! I hid the console log statement and it still works. I have not changed any other code... I would love to say I found a solution for others to follow but I think I found something closer to a bug.

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

      @@kevinlandwehr2591 I ran into the same problem. I realised that what was tripping me up was that I loaded my world without the languages option in the system.json and adding it while the world was loaded did not load the en.json, as F5 does not appear to reload the system.json file, or at least not insofar as it will add a langauge when one wasn't in the file when the world first loaded.

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

    Man you are awesome on those videos. I was able to start creating a new system on foundry in less than one day watching your lessons. Thank you so much, it's perfect!

  • @PatrickJoannisse
    @PatrickJoannisse 4 года назад +3

    Wow that chef John reference. This is gonna be a perfect series for me as I want to learn to create character sheets for the upcoming release of a game I'll definitely want to play on this.

  • @Kalin_JDR
    @Kalin_JDR 3 года назад +1

    Merci beaucoup pour le tutoriel très utile. Vous abordez le sujet de manière très clair et en profondeur, je n'ai pas trouvé mieux à ce jour !

  • @Tielc
    @Tielc 4 года назад +2

    Thank you for putting this together. I watched the series through once, and I found it to be fairly comprehensive, which I appreciate. By far the best how to create a system content of any type I've seen so far. It's fast, so now I have to go back and watch it in more digestible chunks to better comprehend everything I saw the first time through.

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

    I've been thinking about learning how to make my own system and this is giving me a very clear start. Really appreciate your work

  • @walterw9829
    @walterw9829 10 месяцев назад +1

    20:52 That's a Chef Johnism! Nice.

  • @dennyw17
    @dennyw17 2 года назад +1

    Awesome series!!! This is definitely useful, if not mandatory, for anyone wanting to build a system or a module. Thank you, soooo much!!!!

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

    Love that you are doing a video series on this. Highly appreciated!!! :) Definitely worth a subscription!

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

    This video series is just so helpful and great for a beginner like myself. Thank you very much for sharing this!

  • @Roders182
    @Roders182 3 года назад +1

    This tutorial has been amazing and incredibly educational. Thank you so much for this!

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

    This is an excellent introduction to system development for Foundry. Keep it up!

  • @ramongusmao6197
    @ramongusmao6197 5 месяцев назад

    God bless you, such a helpful and straight forward tutorial!

  • @mrbrianparker
    @mrbrianparker Год назад

    Very helpful indeed, you explain a lot in a very clear manner, much appreciated.

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

    Thanks, man! This is exactly what I was looking for. I will follow the whole series.

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

    Thanks for this, just started with Foundry and already having a fun time hacking on a system

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

    Thx for this introduction. This was the first time, that something gave me progress :-)

  • @wermfood1514
    @wermfood1514 3 года назад +1

    Hello Sir! I have watched the series a few times and have attempted to complete the first video. I seem to have a strange problem that no one has reported that I can find. Everything renders perfectly for the ItemSheet and when I click the drop downs everything is correctly populated. My issue is that when I select the data, it seems to always clear. Not just this value, but any data does not seem to save. Can you assist me with this issue?

    • @oatveal
      @oatveal  3 года назад +3

      Which version of Foundry are you running? Things have changed a bit in 0.8.
      I'm currently editing a video recapping the changes to 0.8 for this series, but in the meantime, the Foundry wiki has a summary of the changes: foundryvtt.wiki/en/migrations/foundry-core-0_8_x

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

      Thanks for the migration notes below, I figured out I needed {{data.data.whatever}} instead of just {{data.whatever}} in my weapon-sheet.html input value parameters due to 0.8.x changes. So, pretty easy fix compared to as daunting as the migration notes made it seem! :)

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

    Thank you do much. I will have to view this several times to memorize all you do ! But great job Thanks !

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

    I've been messing with my own system. One thing I'm still trying to get my head around, is why are templates needed? Besides providing the types available in the drop-down list, the data structure can be created by just referencing the values on the object. For example, if you did not have description in your item data structure, and you referenced data.description using handlebars, it will create the property data.description anyway. Is there another reason for creating the templates I'm missing?

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

      The short answer is: I don't know, that's the way it's done.
      There was a discussion about it on the Discord not too long ago, but I can't find it. Essentially, there are bits of the code that assume the existence of the template. There might be some server/client replication code that relies on it for all I know.
      I do know that there's some scoping going on, for instance if two actor types have identically named but independently defined properties, they are considered different properties (when selecting them in dropdowns such as "which property to link a token bar to").

  • @ephaltes.
    @ephaltes. 3 года назад +1

    I tried few times to follow Your code. Around 16 minutes You are checking is Your ItemSheet works (the "Hello" part). I have no idea what I'm doing wrong, but it never works for me...

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

      What do you see? Is there an error in the dev console?

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

      @@oatveal So it didn't work for me either till i commented out the unregistersheet line

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

      @@setver1535 Well, technically speaking, unregistering the default sheet is optional.
      It's worth checking if the name of the class has changed since 0.6 (Unlikely, but you never know)

    • @ephaltes.
      @ephaltes. 3 года назад

      @@oatveal I came back finally to this project ;) Anyway - I tried to comment unregirersheet line - it didn't change anything.
      There is no error, just the created sheet is not seen by the foundry. When I am creating an item - don't see the "hello" word. When I am checking which sheet it uses it is "Default Item Sheet". And I can't change it to mine.

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

      @@ephaltes. Are you able to share the code for your main system file somewhere? Like Pastebin or something.

  • @TwitchXk90
    @TwitchXk90 Год назад

    I cant get my dropdown to work at all, its just empty.

  • @gustavorocha3701
    @gustavorocha3701 2 года назад

    Great video! congratulations for the work and commitment.
    I have a question, I followed your code several times, but every time I finish this video I can't access the attack with dropdown to choose the weapon. the only way I managed was to perform hardcoding on attackTypes. I'm on version 9 of FVTT, I haven't updated to version 10 yet because I saw that many things have changed. Do you have any idea how I could solve this?

    • @oatveal
      @oatveal  2 года назад

      Hey, sorry for the delayed response, just saw this. Does the console give any error?

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

    8:25 Welp. I guess there goes my system. I don't have initiative. Does Foundry REQUIRE an order? If so, I'm going to have to make one up as the system has simultaneous turns.

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

      Yes and no. Even if turns are simultaneous, I'm guessing you are going to process things one at a time, so you might want to use the combat tracker to... track who's being processed and who has finished their actions for the turn.
      But maybe you don't, in which case you don't HAVE to use the combat tracker feature at all.
      If you do see a benefit in having a combat tracker, then you might need to write your own (see part 9 of this series)

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

      @@oatveal A combat tracker could still be handy to keep track of who you have processed and not. It is narratively simultaneous, but like you say, you'll process a couple at a time. If Player A attacks NPC A, both these entities consume their action together by each making a skill check to determine who is attacker and defender. So it's all very fluid. I'm gonna have to ponder this, but thanks for the answer, it did give me ideas!

  • @gi66itz
    @gi66itz Год назад

    Important to note: if you're expecting the type selector to appear for your custom Item types, be sure to add more than one! I just lost 30 minutes and a handful of hair to that one...

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

    I have gone through everything multiple times but after finishing the video all of the fields in the form on the weaponSheet clear out after leaving them. I can't figure out where I did wrong :(

    • @oatveal
      @oatveal  3 года назад +1

      Are you using Foundry 0.8? You need to watch Part 9.5 after this video.

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

      @@oatveal I am using Foundry 0.8. I'll take a look at that video. Thanks for the suggestion!

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

      @@oatveal I updated the getData which was causing some of my issues. So now the attacksWith, pumpAction, and description all function as expected but each of the Number fields (damage, reload, etc) still clear after leaving the field. It is like sheetData isn't being updated for these fields.

    • @HoltBuzzing
      @HoltBuzzing 3 года назад +1

      Nevermind, I was just typing in random characters for my testing. If alpha characters are entered into those numeric fields then the field just doesn't get saved (which makes sense I guess :) ). If entering only numeric then the sheet saves. Video 1 is done and working! Looking forward to the rest of the series!

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

    hmm.. cant get my itemsheet to work.. it still loads in the original sheet and never calls mySystem.js

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

      Have you added mySystem.js to system.json? Have you double checked for typos?

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

      @@oatveal I'm working on checking typos now - also you prolly nailed it with system.json - I was wondering where myStsem.js gets called from.. got it
      thanks!

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

      YAY! Thanks! I forgot to register mySystem.js in the esmodules array.

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

    ive followed your code but for some reason when i go to create item i still cannot get the drop down to select what item i am creating :(

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

    I was trying to follow exactly what you were doing, but every time I get to the new sheet it breaks and will not open anything.

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

      Might have been a typo or something. RUclips comments won't be a great place to do debugging, so I recommend popping over to the Discord server for help. I hang out there, though that's the end of the day for me right now.

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

      I was getting an "Invalid shorthand property initializer" error when checking in Foundry's console with F12. Fixed it by changing each ' = ' to ' : ', apart from the "export const..." line and the one just after that starts the list. Here it's "fs2e.attackTypes = {". Hope this helps if it hasn't been sorted already!

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

      @@Skeletom_ I'm confused. Are there parts of the video where I put an equal sign when it should be a colon? (It's entirely possible, this was recorded in multiple takes and edited, so there could very well be mistakes that slipped in).

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

      ​@@oatveal Whoops, looking back at the vid its all fine. Seems like I carried on using = after the start of config.js rather than remembering to change back to : (Coming in with very bare knowledge of JS). Saw this comment and since it was exactly what was happening to me, thought I'd share how I got it working again.

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

      @@Skeletom_ Ah cool, thanks for helping out :)

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

    Does this tutorial still work for the current version of foundry (0.7.10)? I've been copying the code verbatim but the custom sheet won't load for me.

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

      I'm still on 0.7.9 so no idea, but I doubt it would make a difference. 0.8 might be another story, though...

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

      @@oatveal I tried it and had the had the same thing happen to me on 0.7.9

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

      @@sanescientist252 Then you must have missed a step. Check the other comments for common typos, and look in Foundry's console for error messages.

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

      @@oatveal I gave it another look and found a problem in the first line of fs2e.js. It says "'FS2ItemSheet' is declared but its value is never read.ts(6133)" Any idea what this means?

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

      @@sanescientist252 Did you forget to register the sheet in the init?

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

    Amazing tutorial, thank you very much!

  • @Dani_Cano
    @Dani_Cano Год назад

    Is this useful nowadays? Can I use this knowledge on Foundry 10 or 11?

    • @oatveal
      @oatveal  Год назад +1

      I have not touched version 10, so I don't know. I doubt Foundry's architecture has drastically changed, so most of the knowledge should still be relevant, but I'm afraid I won't be able to help with troubleshooting any errors due to differences.

    • @Dani_Cano
      @Dani_Cano Год назад

      @@oatveal Ok. Thanks. With this and other resources I will try to learn.

  • @thadrine
    @thadrine 2 года назад

    Still no word on an official release of the Feng Shui 2 System?

    • @oatveal
      @oatveal  2 года назад

      I'm working on vehicle chases, which is going to take me a little while at the rate I can currently work on this, but after that I think it's ready to go.
      However, if you're happy to be a beta tester, let me know and I can give you early access.

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

    Cedric, this video series is a godsend, but is the system you built publicly available? I want to run Feng Shui so bad, but there isn't direct support for it yetm

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

      It will be, but I'm not finished yet, I'm recording these as I go. Please keep an eye on this series and let me know if there's some Feng Shui specific stuff I'm doing in a way that sounds contentious to you.

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

      @@oatveal I'll do what I can. I'm a release early and release often guy, so I thought a non-feature complete version might be floating around out there 🙂

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

      @@fattom32 Yeah I get you, but didn't want to deal with preserving people's worlds if I had to do a major refactor or something.

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

    It seems I'll have to use notepad++ to write everything as I don't know what app you're using.

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

      Visual Studio Code, I said it in the video.

  • @lazarslavkovic-raco6309
    @lazarslavkovic-raco6309 2 года назад

    Is there gonna be update to this tutorial?

    • @oatveal
      @oatveal  2 года назад

      See the pinned comment

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

    Merci Cédric! Great tutorial, I appreciate you taking the time to do this for the greater community. Would you happen to have your code somewhere we can refer to? If not, would you be able to share with me?

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

      Thanks! As I said in other comments, the source will be available when the system is ready for release, because I'll need the final green light from the game's publisher.

  • @tavaroevanis8744
    @tavaroevanis8744 2 года назад

    I am developing a TTRPG, and I WISH Foundry's code base was C#. Javascript is horrid to work with, IMO. Hence, my reluctance to even start with Foundry. But then again, I would need to write an entirely new VTT in C#, which is way too ambitious for my current skill set. It's a vexing conundrum.

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

    That was super helpful! Thanks!

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

    Could you share the files or make your files public after each video?

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

      Hello, as I mentioned in another thread, I'm actively developing this system so by the time the video is out the source is likely to be slightly different as I tweak various things.
      Moreover, I can't release the system until the publisher has given the final go-ahead, and for that I need to finish it first.
      I understand how it can be useful to have the code to study on the side, but unfortunately it's not something I can offer at the moment.
      But Foundry being what it is, the full source of the system will be automatically available when it's released.

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

    This is awesome, and a nice way to step into js for some html/ccs (copy/pasted js) guy like me. Do you have a Patreon or a Ko-fi by chance?

    • @oatveal
      @oatveal  3 года назад +1

      Thanks for asking! I don't have either, but don't worry about it :)

  • @saushow4662
    @saushow4662 2 месяца назад

    I have an issue with export default class cause when i extends with ItemSheet it says that cannot find name 'ItemSheet'

    • @MougliFGC
      @MougliFGC 2 месяца назад

      Sorry, I haven't touched Foundry in literal years, this tutorial might be outdated and I wouldn't know how to help you

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

    Were you one of my players I'd give an additional XP bonus for the intro! (ops typos)

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

    Salut Cédric,
    Pense tu pouvoir refaire tes tutos en français ? Je sais que c'est beaucoup demander mais l'anglais c'est pas facile facile 😅
    Merci pour ton retour

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

      Salut, désolé, mais je n'ai pas de temps a accorder pour des traductions. Chaque vidéo a des sous-titres en anglais, ce qui pourrait aider si la compréhension orale est diffiicile.

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

      Ok bon il va falloir que je planche sur l'anglais 😁 merci pour tout le job

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

    The community wiki tutorial link was broken for me. Looks like this is it though, if anyone else is looking for it:
    foundryvtt.wiki/en/development/guides/System-Development-for-Beginners

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

      Thanks! Yeah the wiki moved since I posted this. Updated the link in the description.

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

    GG !

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

    Love it... But a few things.
    1) Please slow down a bit.
    2) When you are creating files and folders, say that you are doing that. A couple of times you created things on the fly and did not say that you were doing that.
    3) Source code per session? I have steered clear of JS up to this point because it is a bear to troubleshoot.
    4) And most important, ZOOM In. I can only work from a 15" laptop monitor, and a number of times I had to screen capture what you were doing (especially when dealing with DIR stuff), and zoom in on the capture to see what you are doing.
    Thank you for your effort though. I have been waiting for a series like this for a while.

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

      Hi Brad, thanks for your feedback.
      This series of videos is not meant to be a step-by-step live course where people would replicate what I show on screen in real time. Doing so would mean each video would be about an hour long, and that's exactly the type of video I DON'T want to make.
      The intent is to give a quick and condensed rundown of the key points of Foundry system dev to people who are comfortable with programming (as mentioned in the part of the video where I lay out my assumptions) so they can start building their own system, using an actual system I'm working on as a reference point (and which isn't ready for release yet).
      I'm sorry if this means you are not quite the target audience for this series, but I hope you will still find it useful.
      Re: Zooming in, I can read the text fine on a 13 inch tablet, but I'll look into making the font bigger in future videos.

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

      @@oatveal Yeah I was thinking the video needed to be broken into two or possibly three videos of twenty minutes each. So what you said makes sense.
      I only really had problems reading the directory folders you had up. The code itself was fine.
      So I may not be the best target audience for this series (on the green side a bit for JS), but this is the first tutorial for FVTT (that I know of) that said, "Hey let's make a game system from scratch."
      I broke something between "Handlebar Templates" and the final realization of CoolWeapon for this video. That's why I was asking if you had the source files for this video stored somewhere because I have been back and forth in that area of this video trying to see what I messed up. The weapon entity is even back to pointing to the default sheet rather than the newly customized one like it was doing at the end "Registering Sheet." So I have been really scratching my head on that.

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

      @@dego899 Oh I see. The code has likely changed a bit since I recorded this, but I might be able to help. What's not working, and do you get an error in Foundry's console? (F12)

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

      ​@@oatveal Nope no errors, the Weapon entity just seems to have gone back to the default Weapon entity we had before finishing the new templates at the end of the "Registering Sheet" section. I tried to drop in some consol.log statement in the various changed files but they are not outputting to console. So yeah confusing...

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

      Just to be clear, we're not actually changing the entity, we're only adding a new sheet to view the entity's data.
      Are you seeing the "fs2e | Initialising Feng Shui 2 system" line in the console?
      If not, it means the system is not loading at all. Possible cause could be a malformed JSON, either system.json or template.json
      (e.g. you can't have the last element of a list end with a comma)