GithubHelp home page GithubHelp logo

foundryvtt / worldbuilding Goto Github PK

View Code? Open in Web Editor NEW
28.0 6.0 31.0 107 KB

A simple game system for Foundry VTT which allows for flexible definition of Actors and Items to assist with worldbuilding or for running games which do not have a more complete system implementation available.

Home Page: https://foundryvtt.com/packages/worldbuilding

License: MIT License

JavaScript 66.44% CSS 6.93% Less 6.51% HTML 20.11%
foundryvtt

worldbuilding's Introduction

Simple Worldbuilding System

A simple game system for Foundry VTT which allows for flexible definition of Actors and Items to assist with worldbuilding or for running games which do not have a more complete system implementation available.

worldbuilding's People

Contributors

aaclayton avatar asacolips avatar fyorl avatar njharman avatar operation404 avatar operativ avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

worldbuilding's Issues

Pick-up_stix Doesn't seem compatible

In GitLab by @rholman-PRFT on Nov 1, 2020, 18:05

Sadly, the default simple-item template seems to preclude the option of creating items of other types from modules? I am trying to use Pick-Up-Stix, but I don't see a way to create a container item.

Can't open character sheet

In GitLab by @ChrisFlyGD on Jan 14, 2022, 09:49

Hi!

I'm using this system since a year and it's the first time i got an issue with it: i can't open any character sheet.
It appeared with the last update of FoundryVTT & the system.
I already tried to disable all modules, it looks like the issue comes from the system, here's what i got:

image

I looked on my drive and there is no actor-sheet.html at the given location.
I don't know if i can do something to fix this but i can't play without my sheets.

I hope you'll be able to help me or find a fix.

Thank you and have a nice day

Add support for item groups on character sheets.

In GitLab by @asacolips on Dec 8, 2020, 10:18

Similar to the recent attribute group feature for the attributes tab, it would helpful for organization purposes if the items tab of character sheets supported custom groups to be defined for items.

Add options for diagonal movement

In GitLab by @mrkwnzl on Sep 7, 2020, 24:04

As a rules agnostic system, it would be useful to have different options for diagonal movement on a square grid. I think the options in the 5e system work well (1-1-1, 1-2-1, euclidian), but maybe a 2-2-2 would be useful as well.

Thanks!

calculate total weight on item sheet

This system is simple and flexible and very wonderful.

Since you can set the Quantity and Weight for an item, it is useful to be able to display that number in the Actor's item column.
Weight shows the total, and Quantity shows the item by item.
I would be happy if I could do it.

Dragging an dropping a Macro throws an error

https://discord.com/channels/170995199584108546/722566083499786352/921787492187914242

macro.js:11 Uncaught (in promise) ReferenceError: item is not defined
[Detected 1 package: system:worldbuilding]
    at macro.js:11
    at Map.find (collection.mjs:46)
    at createWorldbuildingMacro (macro.js:11)
    at simple.js:102
    at Function._call (foundry.js:304)
    at Function.call (foundry.js:289)
    at Hotbar._onDrop (foundry.js:52064)
    at DragDrop.callback (foundry.js:44037)
    at DragDrop._handleDrop (foundry.js:44088)

Cannot update system

When I try to update the simple world-building system I get the following error
image

Obtaining number results from roll table for calculations

I would like to submit an enhancement request for simple world building system. I would like there to be a way to make a roll table result produce a number result. For my purposes I would want that number result be useful for damage calculation purposes.

For example this weapon invokes power table 12. Rolling on this table produces a result of 4. This 4 can then be added to the final result of damage.

  • What the feature should do
    This feature would allow gamers to use roll tables to aid in damage roll calculations, expanding what systems could be featured in simple worldbuilding.

  • Why the feature will be helpful
    There are a few game systems that use a randomized table to determine damage results. Having that functionality built into simple world building would allow these systems to be captured in foundry and make use of the roll table feature in a different way.

  • a consideration
    "Something else I would consider as part of the issue is letting either tables or macros be acceptable solutions. If you can let a rollable attribute on the sheet invoke a macro instead of a dice formula, it can then do whatever it needs to (including rolling from a table)." - asacolips

Adding custom attribute may become broken after deletion

In GitLab by @imposeren on Apr 27, 2020, 14:29

Scenario:

  1. Add 3 attributes to item or character
  2. Remove second attribute. Do not rename anything (keep default names)
  3. Try adding new attribute without. Error.

Fix may look like this:

diff --git a/module/actor-sheet.js b/module/actor-sheet.js
index 2817ad2..aa00367 100644
--- a/module/actor-sheet.js
+++ b/module/actor-sheet.js
@@ -81,9 +81,15 @@ export class SimpleActorSheet extends ActorSheet {
 
     // Add new attribute
     if ( action === "create" ) {
-      const nk = Object.keys(attrs).length + 1;
+      const objKeys = Object.keys(attrs);
+      let nk = Object.keys(attrs).length + 1;
+      let newValue = `attr${nk}`;
       let newKey = document.createElement("div");
-      newKey.innerHTML = `<input type="text" name="data.attributes.attr${nk}.key" value="attr${nk}"/>`;
+      while ( objKeys.includes(newValue) ) {
+        ++nk;
+        newValue = `attr${nk}`;
+      };
+      newKey.innerHTML = `<input type="text" name="data.attributes.attr${nk}.key" value="${newValue}"/>`;
       newKey = newKey.children[0];
       form.appendChild(newKey);
       await this._onSubmit(event);
diff --git a/module/item-sheet.js b/module/item-sheet.js
index 8d378e1..c19ca80 100644
--- a/module/item-sheet.js
+++ b/module/item-sheet.js
@@ -67,9 +67,15 @@ export class SimpleItemSheet extends ItemSheet {
 
     // Add new attribute
     if ( action === "create" ) {
-      const nk = Object.keys(attrs).length + 1;
+      const objKeys = Object.keys(attrs);
+      let nk = Object.keys(attrs).length + 1;
+      let newValue = `attr${nk}`;
       let newKey = document.createElement("div");
-      newKey.innerHTML = `<input type="text" name="data.attributes.attr${nk}.key" value="attr${nk}"/>`;
+      while ( objKeys.includes(newValue) ) {
+        ++nk;
+        newValue = `attr${nk}`;
+      }
+      newKey.innerHTML = `<input type="text" name="data.attributes.attr${nk}.key" value="${newValue}"/>`;
       newKey = newKey.children[0];
       form.appendChild(newKey);
       await this._onSubmit(event);

Support 2d6 systems

In GitLab by @kraetos on Aug 13, 2020, 21:23

It would be great if there was a version of the Simple Worldbuilding system where 2d6 was the default dice roll instead of 1d20. Managing initiative and turn order using Simple Worldbuilding for any system other than one that uses 1d20 as the default roll is a huge pain.

Items can not pull attributes from actor they are attached to.

In GitLab by @petejones.wrexham on Oct 25, 2020, 05:33

When using an Item in an actor you can use a forumla on the Actor that will pull in a Item attribute and roll correctly (example: 1d6 + @items.item_name.attributes_group.attribute).

With Items you can roll a formula referencing any attribute within the item itself but you cannot reference any attributes on the Actor you are attached to. I have tried the following and none worked:
1d6 + @attributes_group.attribute
1d6 + @character.attributes_group.attribute
1d6 + @character.character_name.attributes_group.attribute
1d6 + @character.attributes.attributes_group.attribute
1d6 + @character.character_name.attributes.attributes_group.attribute

Creation of actors or items fail in FVTT 0.7.3 with error "Required type not present"

Steps to reproduce:

  1. open SWS on 0.7.3
  2. attempt to create an actor or item with name.

Error thrown:

Uncaught (in promise) Error: Required field type not present in Item.
    at Item._validateRequiredField (home/anathema/foundry/resources/app/dist/database/odm/abstract.js:1)
    at Item.validate (home/anathema/foundry/resources/app/dist/database/odm/abstract.js:1)
    at Item.save (home/anathema/foundry/resources/app/dist/database/odm/document.js:1)
    at async Function._onCreate (home/anathema/foundry/resources/app/dist/database/odm/document.js:1)
    at async Socket.handleEvent (home/anathema/foundry/resources/app/dist/sockets.js:1)

Attributes not associated with rolls should be correctly displayed in text editor boxes like they are in chat via macros

In GitLab by @cyanomys on May 15, 2020, 24:40

Right now, when you use [[@ATTR1]] with no dice in a macro it returns the value in chat, but if you use [[@attr]] with no dice in a journal entry or the actor description, it returns 0. Additionally, neither use case handles string or boolean correctly. Booleans are returned as 0's and strings are returned as undefined. I can make a separate issue for that if you think it's a very different problem, however.

Correcting this functionality would be a huge boon to those of us who are using Simple Worldbuilding to make ghetto character sheets for unsupported games without coding. Improving the ability of the Simple Worldbuilding System to fully support returning attributes in text editors, as well as creating an easier-to-find guide for using it, could make Foundry much more accessible and appealing to people who want to play weird games without learning to code. We could even create a sort of secondary Foundry modding community of newbs who mod simple worldbuilding :)

Potential Issue with using actor attributes in a custom initiative formula

Thanks for the great system! I'm having an issue with the custom initiative. I created a character sheet with attributes. One of them is perception bonus (PB). I can use it to modify rolls from macros so I know I at least have that part right. However if I add it to the custom initiative (1d10 + @PB) I get an error saying "the attribute @PB was not present in the provided roll data".

Interestingly it still works for the current session, but if i log out and back in it no longer works and I have to re-enter it (and get the error again).

Do I need to establish the perception attribute somewhere else other than within a character sheet?

Create owned item hook not invoked

In GitLab by @kamcknig on Oct 5, 2020, 18:40

I'm unsure if this is a system issue or a foundry issue.

When opening an actor's sheet and dragging and dropping an item onto the sheet, the createOwnedItem hook is never invoked when doing this in Simple world building, but it is invoked in other systems.

Dungeons and dragons

dnd5e-create-owned-item

Simple world building

swb-creaet-owned-item

Fatal error with _applyItemsFormulaReplacements()

From CrenshawJS in Discord:

Summary

Players are unable to use chat macros due to a fatal error in _applyItemsFormulaReplacements()

Version Information

  • Windows 10
  • Hosted with Forge
  • No modules enabled
  • Foundry version: v10.290
  • SWB version: 0.7.2
  • Players have all permissions

Steps to reproduce

Create the following macro (global, chat, no triggers set)

/r 1d6cs>=5 # Disadvantage

This runs successfully for GM users, but causes an error for players.

Error Message

Screenshot of error

Error Msg: There was an error in your chat message syntax.

foundry.js:747 TypeError: data.items[item][k].replace is not a function
[Detected 1 package: system:worldbuilding]
    at SimpleActor._applyItemsFormulaReplacements (actor.js:185)
    at SimpleActor.getRollData (actor.js:54)
    at ChatLog._processDiceCommand (foundry.js:74149)
    at ChatLog.processMessage (foundry.js:74120)
    at Macro._executeChat (foundry.js:19969)
    at Macro.execute (foundry.js:19955)
    at Hotbar._onClickMacro (foundry.js:68047)
    at HTMLLIElement.dispatch (jquery.min.js:2)
    at HTMLLIElement.y.handle (jquery.min.js:2)
onError    @    foundry.js:747
    call_wrapped    @    libWrapper-wrapper.js:507
    Hooks.onError#lib-wrapper    @    listeners.js:137
    Hooks.onError#0    @    libWrapper-wrapper.js:187
(anonymous)    @    foundry.js:19970
Promise.catch (async)
_executeChat    @    foundry.js:19969
execute    @    foundry.js:19955
_onClickMacro    @    foundry.js:68047
dispatch    @    jquery.min.js:2
y.handle    @    jquery.min.js:2
When using the chat window, nothing happens.
Error:
actor.js:185 Uncaught (in promise) TypeError: data.items[item][k].replace is not a function
[Detected 1 package: system:worldbuilding]
    at SimpleActor._applyItemsFormulaReplacements (actor.js:185)
    at SimpleActor.getRollData (actor.js:54)
    at ChatMessage.getRollData (foundry.js:18006)
    at ChatMessage.getHTML (foundry.js:18048)
    at ChatLog.postOne (foundry.js:73934)
    at ChatMessage._onCreate (foundry.js:18174)
    at ClientDatabaseBackend.callback (foundry.js:12575)
    at foundry.js:12525
    at Array.map (<anonymous>)
    at ClientDatabaseBackend._handleCreateDocuments (foundry.js:12525)
    at ClientDatabaseBackend._createDocuments (foundry.js:12433)
    at async Function.createDocuments (commons.js:6103)
    at async Function.create (commons.js:6226)

Support the concept of attribute groups which allow defined attributes to be organized into hierarchical groupings.

Each attribute group can support certain metadata like an id, a title, a default attribute type, and possibly a display format.

I think what I'm envisioning here is that you would be able to organize your attributes into "groups" or "sections" or "categories" (whatever we want to call it) that would be displayed as different sections of the sheet (probably alphabetically by title, alternatively you could allow each category to have an explicit sort order) so you would be able to have an attribute structure like:

Abilities
  Strength
  Dexterity
  Intelligence
Resources
  Health
  Stamina
Defenses
  Armor
  Block
Resistances
  Physical
  Elemental
  Psychic

Report that negative values for attributes do not work

Hey mate, i'm using your simple worldbuilding system. I'm trying to create a sword with a negative attribute. The player has an attribute with the same name. I've tried changing the attribute from string, to number in all possible variations but i don't seem to get it to work.

Do you have any idea of why that might be the case?

Resource value exceeds min and max

In GitLab by @petejones.wrexham on Nov 5, 2020, 06:04

With the new Resource data Type there are three fields created:
Min, Value, Max

It doesn't matter what number you put in Value it can fall below Min and exceed maxscreenshot.18

Creation or deletion of an attribute when an attribute has focus does not work

In GitLab by @SolarBear on Apr 25, 2020, 10:06

How to reproduce

  1. Create or select an Actor.
  2. Select the Attributes section.
  3. Create a new Attribute.
  4. Edit one of the sheet's text values (attrubute key, value or label; hp; actor name; etc.).
  5. Keeping the focus inside that control (ie don't click outside the control), click on the '+' button to add a new attribute or a trash can icon to delete one.

Expected behavior

This should add a new attribute or delete the selected one, respectively.

Observed behavior

The action does not get registered. Clicking a second time does work because the control loses the focus, then.

The "Add Attribute Group" button on the character sheet does not seem to be working properly in the v10 release

https://discord.com/channels/170995199584108546/956306859491471420/1016348551929929831

I'm new to foundry, but it seems like the Add attribute group button on simple world building character sheet is broken (version 10, build 284)? I can't seem to organize the attributes into groups like I was able to in the last version 9 software. Seems to work fine while creating items. Also, when I accidentally create an attribute key with a space, it seems to glitch out the character sheet and I have trouble accessing and modifying it. Maybe these two issues are related.

Modules are disabled, windows 10 pro 64 bit, foundry vtt software (no browser). Create a new world in simple world building, create new actor, populate the basic character sheet with attributes. Errantly type in an attribute key with a space and press enter for error message. Try creating attribute group. After this, the character sheet bugs out and sometimes doesn't update my entry, or fails to load altogether.

image

Item Button Chat Message

Hi.

Can you make possible to click the item icon and spam the description of the item to chat?
image

Tks

Macro and attributes not working

In GitLab by @bagby.savannah.l on Nov 5, 2020, 13:32

I am attempting to make a macro to roll attributes in the fillable character sheet pdf. I have named the fields appropriately (data.body for the body score) using pdfescape. In macro creation, I chose chat and then put “/roll 2d6 + @Body”, I’ve also tried @data.body and @attributes.body but none worked and it said that the attribute @Body was not available to roll, however when I click Inspect Data data.body is there.

V10: Create Actor/Item causes Deprecation Warning for Base*.metadata.types

commons.js:6704 BaseActor.metadata.types is deprecated since v10 in favor of BaseActor.TYPES.
get @ commons.js:6704
createDialog @ helper.js:526
createDialog @ actor.js:21
_onCreateDocument @ foundry.js:60184
(anonymous) @ foundry.js:60129
dispatch @ jquery.min.js:2
y.handle @ jquery.min.js:2

commons.js:8120 BaseItem.metadata.types is deprecated since v10 in favor of BaseItem.TYPES.
get @ commons.js:8120
createDialog @ helper.js:526
createDialog @ item.js:21
_onCreateDocument @ foundry.js:60184
(anonymous) @ foundry.js:60129
dispatch @ jquery.min.js:2
y.handle @ jquery.min.js:2

Add Macro as Data Type

In GitLab by @brunocalado on Dec 7, 2020, 18:46

Hi.

If you create a new data type called macro and let the user add a macro to it that execute on item click there will be great benefits.

You could create itens with all automation you want.

Example: You could create moves for Apocalypse World that on click will read the attribute and tell the result.

I did something similiar to a kult macro (link).

image

V10: New Actor/Item sheet opening pops deprecation warning about FormDataExtended#toObject

commons.js:1256 Error: You are using FormDataExtended#toObject which is deprecated in favor of FormDataExtended#object
Deprecated since Version 10
Backwards-compatible support will be removed in Version 12
at Object.logCompatibilityWarning (commons.js:1245:19)
at FormDataExtended.toObject (foundry.js:58344:19)
at callback (helper.js:556:29)
at button.callback (foundry.js:55857:51)
at Dialog.submit (foundry.js:55744:35)
at Dialog._onClickButton (foundry.js:55673:10)
at HTMLButtonElement.dispatch (jquery.min.js:2:43064)
at y.handle (jquery.min.js:2:41048)
logCompatibilityWarning @ commons.js:1256
toObject @ foundry.js:58344
callback @ helper.js:556
button.callback @ foundry.js:55857
submit @ foundry.js:55744
_onClickButton @ foundry.js:55673
dispatch @ jquery.min.js:2
y.handle @ jquery.min.js:2

commons.js:1256 Error: You are using FormDataExtended#toObject which is deprecated in favor of FormDataExtended#object
Deprecated since Version 10
Backwards-compatible support will be removed in Version 12
at Object.logCompatibilityWarning (commons.js:1245:19)
at FormDataExtended.toObject (foundry.js:58344:19)
at callback (helper.js:556:29)
at button.callback (foundry.js:55857:51)
at Dialog.submit (foundry.js:55744:35)
at Dialog._onClickButton (foundry.js:55673:10)
at HTMLButtonElement.dispatch (jquery.min.js:2:43064)
at y.handle (jquery.min.js:2:41048)
logCompatibilityWarning @ commons.js:1256
toObject @ foundry.js:58344
callback @ helper.js:556
button.callback @ foundry.js:55857
submit @ foundry.js:55744
_onClickButton @ foundry.js:55673
dispatch @ jquery.min.js:2
y.handle @ jquery.min.js:2

Project license?

In GitLab by @lexi on May 3, 2021, 03:36

the LICENSE file says MIT but the code says GPLv3 so I just wanted to check

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.