PDA

View Full Version : Ruleset Wizard and Cyberpunk RED ruleset creation tutorial



damned
November 30th, 2020, 12:42
In this tutorial series we are going to use the new Ruleset Wizard by psicodelix to create a basic ruleset. We will begin by building a character sheet and maybe a bit more for the Cyberpunk RED RPG.
In this video we will look at the Ruleset Wizard, setting up Frames and Icons and setting up a Fantasy Grounds Window.
Get the Ruleset Wizard here - https://www.rulesetwizard.com/get-rul... - it is in Early Access, there are no guarantees, but for 50Euro your support will help the dev continue building out this product.
Get Fantasy Grounds here - https://www.fantasygrounds.com/home/h...
Get Cyberpunk RED here - https://www.drivethrurpg.com/product/... or the Jumpstart here - https://www.drivethrurpg.com/product/...

Please share any rulesets you create with the community by sharing them here - https://www.fantasygrounds.com/forums/
If this video was useful to you feel free to help me fund my RPG habit here - https://paypal.me/fgdamned
Watch in HD so you can read the text/code as it goes along.

Playlist https://www.youtube.com/watch?v=LqY2jbwEToU&list=PLsgd1zJLdiKXtdLt1FBYjZrJUtJWCjGmT
Video 1: Getting Started with the Ruleset Wizard and the Character Sheet
Video 2: Adding more elements and some basic coding
Video 3: Adding additional coding and character sheet elements
Video 4: More character sheet coding and character sheet elements
Bonus Video 1: Creating frames for character sheet and chatbox
Video 5: Editing the common section at the top of the character sheet
Bonus Video 2: Creating a desktop wallpaper with some punch
Video 6: Creating an Armor/Defense List

NotRussellCrowe
November 30th, 2020, 13:54
This is great! I was waffling on making a S&W rule set as it's a pretty simple game and should be easy enough to make something that is functional and this video series might just be what I need to convince me to do it.

Well done!

damned
November 30th, 2020, 14:10
Stop waffling. Pick a project (simpler is better) and start doing.
Be like Mike.

NotRussellCrowe
November 30th, 2020, 14:12
But I like waffles. Anna makes very good waffles.

Is that Mike from Osoyoos? He's a great guy.

GunnarGreybeard
November 30th, 2020, 14:14
Glad to see this progressing.

damned
December 1st, 2020, 13:25
Video 2 just posted - https://www.youtube.com/watch?v=dautmuZUfYU

NotRussellCrowe
December 1st, 2020, 13:37
Just got the the part where you paste some code. Does the app have an event list for each object? What I mean is you click on a number field and then browse all events like onValueChanged, onFocus, etc., rather than having to know them all or look them up in a document?

damned
December 1st, 2020, 13:42
Just got the the part where you paste some code. Does the app have an event list for each object? What I mean is you click on a number field and then browse all events like onValueChanged, onFocus, etc., rather than having to know them all or look them up in a document?

No it doesnt.
I would post your queries/requests in the Ruleset Wizard thread so that psicodelix sees them and you never know what might happen from there.
The most common ones I use are:

onDoubleClick - runs when you double click the element
onClickrelease - runs when you release your mouse click and you are still over the element - sometimes you change your mind on clicking something - if you havent let go of the mouse click move the pointer off the element before releasing and it wont fire
onValueChanged - runs when the value in that element changes
onInit - runs when the control is initialised first time that session

NotRussellCrowe
December 1st, 2020, 13:45
Visual Studio has ruined me for coding in any other IDE ;)

But these videos of yours are making it much more approachable and enticing. Maybe one day soon. Once I have my Cthulhu campaign going steady.

damned
December 1st, 2020, 13:49
So comparisons to Visual Studio are never going to go well!
VS has had millions and millions of dollars of dev work over very many years.
Slowly, slowly...
If there is enough support/interest for the Ruleset Wizard it will grow in functionality.

NotRussellCrowe
December 1st, 2020, 13:54
Completely agree. There aren't even any commercial IDEs that can match all the functions and features of VS, at least in my mind anyways. MS has made a great product and it is in a league of its own.

Actually just the drag and drop and WYSIWYG UI editing I think is the biggest draw for me as I hate trying to "draw" by coding in XML. Such a tedius task. Any code integration is just a bonus in my personal opinion but maybe that's because I have a background in coding and others would feel differently.

QuorumOf4
December 1st, 2020, 19:19
@Damned
The Ruleset Wizard tutorials are really useful. Not just as a "how to use RuleWizard", but also for learning Fantasy Grounds in general. The advantage these tutorials have over all the other tutorials I've watched/read is that these RuleWizard Tutorials do a much better job at visualizing the relationship between the code/xml/graphics and the Fantasy Grounds Application. Almost every tutorial I've seen to date is essentially 1) Verbal Explanation of End Result > 2) Code > 3) End Result, where as these are 1) Visualized Output 2) Explanation of Functionality needed to achieve it 3) Code 4) End Result. It might not seem like a big difference, but visualizing the process in advance of writing the code is a big difference for visual learners.

Something you may want to consider adding at the end of each tutorial is a side by side comparison of the xml output inside the .pak file to the end result in fantasy grounds. Reviewing the output in the XML format and pointing to what it did in fantasy grounds can really drive concepts home for visual learners. The other thing you might consider (if your editing your videos before posting them) is showing the end result in fantasy grounds before building it inside RuleWizard.

damned
December 1st, 2020, 21:51
Welcome QuorumOf4

Thanks for the feedback. Im a hack at this FG stuff and at making videos too. I like that idea of showing the end result at the start. The next two videos are already loaded up so it will have to be Video 5 where I try that.
Video #4 is a bit heavy going. Video 5 will be less daunting.

greybeardgunner70
December 1st, 2020, 22:37
I purchased the Wizard and looking forward to playing around with it. I have two questions:
1. I have always wished for a larger character portrait window on the CS. Is it possible, since we are basically creating the CS from scratch, to create a portrait window that is 3-5x larger than the current one (allowing full body portraits, for example)? Or are the current portrait sizes hard wired at a deeper level in the software?
2. Is it possible to include an image on the CS? For example, the HarnMaster CS has a handy armor/hit location image on the CS that I would like to implement. Not necessary, but a nice to have. See image below.
41578

damned
December 1st, 2020, 23:07
Ive not really looked at that before but -
The section that portrait lives in is common to every tab on the Charsheet so you would lose that larger portrait space on all tabs unless you moved it to another part of teh charsheet. There is Lua code in there to handle resizing of the image as well so that would require investigation. It is not something that the RW can do for you without you understanding the code.

For the body location image that should be quite straight forward.
Either add it as a frame or an icon and send to back. Place other elements over the top if needed.

ShotGun Jolly
December 2nd, 2020, 00:58
Is this really something?

I have that "it sounds almost to good to be true" vibe to it. I will how ever check out the free demo version.. see it in action.

damned
December 2nd, 2020, 01:02
Is this really something?

I have that "it sounds almost to good to be true" vibe to it. I will how ever check out the free demo version.. see it in action.

Watch the videos.
It wont/cant do everything for you but it can make the xml editing much easier and with some examples you can see how easy/hard it is to add some underlying automation.
And its being actively developed so supporting the creator will help him to continue improving it.
A new build just dropped and I know that right now he is looking at ways to make coding rolls from the GUI possible.

ShotGun Jolly
December 2nd, 2020, 01:10
Watch the videos.
It wont/cant do everything for you but it can make the xml editing much easier and with some examples you can see how easy/hard it is to add some underlying automation.
And its being actively developed so supporting the creator will help him to continue improving it.
A new build just dropped and I know that right now he is looking at ways to make coding rolls from the GUI possible.

I really want too, but its 50 Pounds, so roughly 100 Dollars Cad for a alpha program..

Thats a hard dent in the wallet though.. Where I am not working anymore due to stupid pandemics worldwide... But if I spend that money on it, I need it to work and work well.. so.. I will keep watching the videos and see.. Hmmm, groceries for a week or a XML front end coding machine.. hmmm.. The XML Machine!

greybeardgunner70
December 2nd, 2020, 01:45
How did you determine the size of your frames (fieldlight, fielddark, numberbox, etc). Does it matter? I'm referring to the originals you made in GIMP, I know the wizard will allow you to change size and shape.

damned
December 2nd, 2020, 05:02
I really want too, but its 50 Pounds, so roughly 100 Dollars Cad for a alpha program..

Thats a hard dent in the wallet though.. Where I am not working anymore due to stupid pandemics worldwide... But if I spend that money on it, I need it to work and work well.. so.. I will keep watching the videos and see.. Hmmm, groceries for a week or a XML front end coding machine.. hmmm.. The XML Machine!

No choice there. If its a choice between eating and coding you better eat!

damned
December 2nd, 2020, 05:26
How did you determine the size of your frames (fieldlight, fielddark, numberbox, etc). Does it matter? I'm referring to the originals you made in GIMP, I know the wizard will allow you to change size and shape.

Hi Gunnar - while driving to a job today i was thinking about that very topic. Should I make a video on the graphics themselves because they are obviously an important part of the whole thing. Im very much leaning towards doing one but its not really about the Ruleset Wizard so tossing it up still..

Anyway - to answer your question -

If you look at the original graphics for fieldlight and fielddark they dont really give much away. You have to look at where they are used and how. In CoreRPG and 5E both of them are used as frames to hold other elements and they are used to frame specific content like a number or a string.

So we have a couple of clues.
They are always going to be displayed as a square/rectangle.
They are displayed in both small (as small as 25x25px) and much larger elements - eg behind/around a list of Stats.
They have at least 2 versions - a darker one and a lighter one.

So pulling back out a bit and looking at the whole character sheet and then at the whole rulebook artwork I look for easy elements to reproduce that will give me a similar look and feel - I dont need identical, or even close, I just need the feel - and I start working with those.

When designing any of these graphics its important to remember the 9 slices thing.

Top Left is fixed
Top tiles horizontally
Top Right is fixed

Left tiles vertically
Middle tiles vertically and horizontally
Right tiles vertically

Bottom Left is fixed
Bottom tiles horizontally
Bottom Right is fixed

This means that gradients and decorative elements need to stay within their slices and if the slice tiles make sure the element tiles nicely too.

These rules apply regardless of the size of the element.

So elements like fielddark and fieldlight that are used with small sizes should be quite simple.
Elements like ChatWindow and Character Sheet and Combat Tracker can have more decorations.

I think that most people should stick with relatively simple frames - if you are graphic designer then get funkier - but only after you really understand how it should work.

I hope that helps?

greybeardgunner70
December 2nd, 2020, 05:54
Thanks for the clarification and extra detail. So what I gathered from that (and my experimentation so far), is that for a frame to work in a label, it needs to be roughly the same size as the label will be, X pixels by Y pixels. So you kinda need to know what those are going to be beforehand, or come back and add the frames later. Perhaps I am over simplifying.

Here is what I have after a few hours work today. Needs to be prettied up, of course, but I will get to that after I am sure I have all the functionality of the sheet worked out and have a better understanding of where I want/need things.
41597

I downloaded the font from the FG Wiki (dnd4LolthSC) and installed it per the instructions from the RW website. However, I couldn't get it to work. Wouldn't show up on the CS. Have you played with that feature (custom fonts) yet?

damned
December 2nd, 2020, 06:25
Hi Gunnar,

Dont expect to get things right the first time you do them - I dont. Sometimes it takes me dozens of goes.
When you create these elements there is something I forgot about in the video - you can just plonk a whole bunch of labels (example) on the sheet and then select them all and use the align all buttons to speed up the aligning.
I personally would spend some time working out the exact/best sizes for each column/field.
Anyway thats not answering your Question.
I think the answer is Display >> Frame Offset - try some values like 4,3,4,1 (left, top, right, bottom) and see how that looks.
Expect to play around with the numbers and layout a few times before you decide on something you really like.

Awesome to see you diving in!

damned
December 2nd, 2020, 06:26
Oh - fonts. I use plenty of custom fonts in my extensions but i havent yet tried the fonts tool in RW - sorry.

And one more thing - the Frame Offsets change from 0.3.9 to 3.10.0 and i havent had a chance to test yet...

damned
December 2nd, 2020, 14:35
Video 3: Adding additional coding and character sheet elements https://youtu.be/-xqt6Hl7NnE
is now live

Video 5 will come next and then back to Video 4.
Video 5 talks about the graphics and is not so much about the Ruleset Wizard but is important nonetheless.

greybeardgunner70
December 5th, 2020, 12:45
Is it possible to add in the Harn die roll success levels you developed for Morecore?

damned
December 5th, 2020, 14:11
Is it possible to add in the Harn die roll success levels you developed for Morecore?

Short answer. Yes
Middle answer. Not yet
Long answer. You are going to have to dive deeper into the code. For now you will need to wait until I post an example with onLanded

damned
December 5th, 2020, 14:15
There are 5 Ruleset Wizard and Cyberpunk RED specific videos posted and 2 bonus videos that deal with graphics and then with using some code to go further than the RW IDE can go staying within its interface.
There will be another graphics bonus video next and then another character sheet video.

damned
December 6th, 2020, 22:00
Playlist https://www.youtube.com/watch?v=LqY2jbwEToU&list=PLsgd1zJLdiKXtdLt1FBYjZrJUtJWCjGmT
Video 1: Getting Started with the Ruleset Wizard and the Character Sheet
Video 2: Adding more elements and some basic coding
Video 3: Adding additional coding and character sheet elements
Video 4: More character sheet coding and character sheet elements
Bonus Video 1: Creating frames for character sheet and chatbox
Video 5: Editing the common section at the top of the character sheet
Bonus Video 2: Creating a desktop wallpaper with some punch
Video 6: Creating an Armor/Defense List

blacklensman
December 7th, 2020, 17:43
This tool is amazing and the tutorials are very well done. Anyone wanting to crank up new extensions or rulesets should really be using this tool. I've been at it about a week and I'm cranking out a new ruleset for a custom in-house game.

One weird question though How do you delete elements? I created a charsheet_main but can't seem to find a way to delete an element I don't need or want anymore.

greybeardgunner70
December 7th, 2020, 19:13
I have completed a custom "overviewframe" for the top of my charsheet_main. However, once I put in a name for the character, I can't go back and edit it. I added a slot for "occupation" which I can edit with no issues. Is there a setting in the "charsheet" or "charsheet_main" I am overlooking?

damned
December 7th, 2020, 22:11
This tool is amazing and the tutorials are very well done. Anyone wanting to crank up new extensions or rulesets should really be using this tool. I've been at it about a week and I'm cranking out a new ruleset for a custom in-house game.

One weird question though How do you delete elements? I created a charsheet_main but can't seem to find a way to delete an element I don't need or want anymore.

There seems a bug in this also but - right click on teh element in the left hand view of the RW IDE
But because if bug which I have still to report - rename it first to something like charsheet_main111 and then delete it because sometimes it seems to come back... or it has for me when I try to create a new charsheet_main

Please post a screenshot or two!

blacklensman
December 7th, 2020, 23:55
I have completed a custom "overviewframe" for the top of my charsheet_main. However, once I put in a name for the character, I can't go back and edit it. I added a slot for "occupation" which I can edit with no issues. Is there a setting in the "charsheet" or "charsheet_main" I am overlooking?

I just did this today. I created an overview frame with a graphic I created. In the 'char sheet' window and select the 'Name' element. make sure you have the Advanced Template set to string_labeled, the Name is set and is unique, and you have set Merge property to join. I created Name, Species, Profession and Gender. All seemed to work for me.

blacklensman
December 7th, 2020, 23:59
41767

Basically I have Race, Professions as string labels as well as String Fields. I have moved these to the overview field now. I would just like to remove them from the char sheet_main.

damned
December 8th, 2020, 00:07
rename the fields (just in case) and then delete them by right clicking on them.

blacklensman
December 9th, 2020, 01:29
rename the fields (just in case) and then delete them by right clicking on them.

Ok. So there should be a right click window on the elements in the editor? I don't see a right-click menu at all there. right-click seems to work in any other app. Might be Vbox issue. I'll see if I can figure it out. Thanks!

damned
December 9th, 2020, 09:55
Sorry I wasnt in front of the RW when I replied.
The explorer tree on the left has a right click -> delete option.
Elements in the main window can be deleted by selecting them and pressing Delete.

blacklensman
December 9th, 2020, 15:16
Sorry I wasnt in front of the RW when I replied.
The explorer tree on the left has a right click -> delete option.
Elements in the main window can be deleted by selecting them and pressing Delete.

For anyone running the Windows under Virtualbox the Windows Delete key on the Mac keyboard is the fn+Delete keys. This will delete items out of the work area. Thanks!

damned
December 13th, 2020, 21:01
This is up to 12 + 3 bonus videos.

blacklensman
December 16th, 2020, 03:55
Quick question... I've implemented the new dice roll handler and am using it. I'm looking for how to get the Target from the dice Handler. I'm trying to do
if rTarget then
local nTargetSheet = DB.findNode(rTarget.sCTNode);

but if I try to do a getChild on this element it gives me a nil. Is this how I should be getting access to the Target's values?

Basically the process for my ruleset would be:
1) roll damage
2) subtract armor absorption from that value
3) apply it to the character.

thanks!

damned
December 16th, 2020, 04:17
Use
Debug.chat("text: ", variable/code);
and use it liberally

If you watch (I think) video 13 you will see an example of running a function after the dice have rolled.
Its the one where I set the Initiative.
Ofc Initiative doesnt need/use targets but you will see that the functions get passed the following: rSource, rTarget, rRoll

function InitHandler(rSource, rTarget, rRoll)
-- Name the function and accept 3 parameters

So do something like:

Debug.chat("rSource: ", rSource);
Debug.chat("rTarget: ", rTarget);
Debug.chat("rRoll: ", rRoll);

And then you will clearly see what has been passed to the function

damned
December 16th, 2020, 04:18
And when are we going to see some screen shots?

blacklensman
December 16th, 2020, 04:22
I used the rTarget.sCreatureNode and it seemed to solve the issue.

damned
December 16th, 2020, 04:54
So... what is sCreatureNode and what is sCTNode?

sCreatureNode is the charactersheet node
sCTNode is the node in the Combat Tracker

Why use one over the other?

The main one is - NPCs dont have a sCreatureNode - they only exist in the CT
if you are working with fields that exist in both charsheet and ct then make sure you use CTLink to keep them in sync.
Some fields might only exist in the CT - like initiative

damned
December 16th, 2020, 04:55
To your post - sCTNode wont exist if the character is not in the CT

Also - screenshots of your ruleset pretty please.

Senoj
December 16th, 2020, 20:42
Hi Damned,

Love the project. I am only through the first 6 or 7 videos. Is the goal here to have a completed extension published for MoreCore or is it to give us the step by step for doing it ourselves? I will learn much more that way, so will try to do it. The only real thing that has me intimidated are the graphics.

Of the rulesets that you have done, how complex is this one? So far it would seem rather on the simple side.

damned
December 16th, 2020, 22:10
Hi Senoj

The goal is to get as far as I can before I lose the motivation.
It is a ruleset/pak and not a MoreCore extension.

Always start with the simple parts.
Im not sure if anything that we have done up to part 6 uses any sort of opposed rolls - just mapping out the character sheet and doing rolls without comparing them to anything.
As go along we will find ourselves revisiting things that we had previously "done" because they were "done to a point" rather than complete.
Im not envisioning this ruleset to end up being particularly easy.

Learning the rules for a system that you are unfamiliar with, especially when you are learning the rules to codify them - so you have to get it right, can be a substantial exercise in itself.
Its definitely best to build a ruleset for a system you know and like.

The most recent videos are doing more complex things but ultimately its just following a process:
* how does the mechanic work (in detail)
* work out how to present the data on the sheet
* work out the user interaction that will be used - onclick, onclickrelease, ondoubleclick. will everything run from one button/widget or will you build the action with modifiers or checkboxes etc
* break that down into its smallest steps
* convert those steps into Lua (or use the RW where it supports it) one at a time with lots of debug

presence
December 17th, 2020, 18:44
Sorry, this doesn't belong here.

blacklensman
December 18th, 2020, 02:28
Also - screenshots of your ruleset pretty please.

I have the dicerollHandler handling the post die roll for the weapon attack. What I'm trying to get at is pull information from the Target's characters sheet.
Basically:
1) rSource rolls damage
2) the Result is handled by the the dierollHandler
3) in the dierollHandler, Access the rTarget character sheet to get the proper armor fields and then construct a roll json for Armor Absorption
4) perform the Armor Absorption roll and subtract the result from the damage done by the weapon.
5) apply damage

Right now I'm attempting to use the following to get the Target sheet reference and then get the value but it returns nil.
local nTargetSheet = DB.findNode(rTarget.sCTNode);
local nArmor = nTargetSheet.getChild(nArmorString).getValue();

42104
42105

damned
December 18th, 2020, 02:37
Im still prepping the next videos - but they will introduce this topic -

You should have some more stuff to work with in the next 36 hours - hopefully two videos on the topic.

Screenshots are looking good!

greybeardgunner70
December 23rd, 2020, 01:53
Working on NPC sheets now. Still having a similar problem as with CS. When I input the below script for a Number Field box, I get a nil error, even though I have entered a Default Value "0"

function onValueChanged()
local nodeWin = window.getDatabaseNode();
local nInjury = nodeWin.getChild("injury_level").getValue();
local nFatigue = nodeWin.getChild("fatigue_level").getValue();
local nUniversal = math.ceil(nInjury+nFatigue);

nodeWin.getChild("universal_penalty").setValue(nUniversal);

end

You sent a line of script earlier, but I am not sure where to put it or if there is an easier solution.

local sMCInitBonus = DB.getValue(nodeChar,"initbonus",0)

damned
December 23rd, 2020, 07:40
So the line I posted is the easier solution

it would go something like this for you -

local nodeWin = window.getDatabaseNode();
local nInjury = DB.getValue(nodeWin,"injury_level",0);
local nFatigue = DB.getValue(nodeWin,"fatigue_level",0);

damned
December 23rd, 2020, 07:43
So the line I posted is the easier solution

it would go something like this for you -

local nodeWin = window.getDatabaseNode();
local nInjury = DB.getValue(nodeWin,"injury_level",0);
local nFatigue = DB.getValue(nodeWin,"fatigue_level",0);

Another variation if that doesnt work is:

local nodeWin = window.getDatabaseNode();
local nInjury = DB.getValue(nodeWin .. ".injury_level","number",0);
local nFatigue = DB.getValue(nodeWin .. ".fatigue_level","number",0);

Dont ask me why sometimes one works and the other doesnt...

greybeardgunner70
December 23rd, 2020, 14:32
OK, got that. Does that bit of script get inserted as part of the "valuechanged" function or is it separate? In other words, how does it fit in with the script quoted above?

damned
December 23rd, 2020, 21:52
local nInjury = xxxxx
is setting a variable called nInjury and assigning it a value
so my examples would replace the lines that match the
local xxxxx

greybeardgunner70
December 24th, 2020, 15:59
HarnMaster NPC sheet with integrated rolls complete! Now on to the Combat Tracker...
42245

damned
December 24th, 2020, 22:37
Well done Gunner

Valyar
December 25th, 2020, 19:25
damned, do you plan to release this ruleset officially and if yes (I sorry to ask that) in what timeframe? I am soon going to wrap up the current campaign and wonder what to start next.

damned
December 25th, 2020, 23:49
damned, do you plan to release this ruleset officially and if yes (I sorry to ask that) in what timeframe? I am soon going to wrap up the current campaign and wonder what to start next.

Valyar one way or another it will get released.

possible scenarios...
* RTalsorian come back to me with some interest in a commercial ruleset
* I release a close to fully functional community ruleset
* I release a functional community character/npc sheet and combat tracker that covers most use cases

will see where I get to before other priorities re-assert themselves

If its option 2 or 3 it will be before the end of January. Its consuming too much of my time for me to maintain it for longer than that!

Valyar
December 26th, 2020, 07:59
Valyar one way or another it will get released.

possible scenarios...
* RTalsorian come back to me with some interest in a commercial ruleset
* I release a close to fully functional community ruleset
* I release a functional community character/npc sheet and combat tracker that covers most use cases

will see where I get to before other priorities re-assert themselves

If its option 2 or 3 it will be before the end of January. Its consuming too much of my time for me to maintain it for longer than that!
Let's hope it is option 1 :)

Saeval
January 3rd, 2021, 09:04
I've been watching the tutorial videos and I was debating posting on there or here but I chose here since the Youtube videos were more to show off the abilities of the program you're using to build the ruleset. Something I wanted to let you know about the rules is that when you roll a natural 10 or a natural 1 that next die roll only explodes once, if you roll an additional 1 or 10 it stops there and you don't accumulate more so I was wondering if that might be factored in later or not.
Also after character creation you can buy into more than one Role, so your main Role is the last one you increased (as you're actively working on that skillset) but you could have multiple Role skills for your character and I was wondering if there might be a better place to add that to the character sheet to keep track of that. Maybe keeping what's on the main sheet at the top as your current "Role" but adding a place for all of your Role skill ranks to be all in one place?
Something else I thought of is there are weapon qualities that can change your to-hit numbers rolled with certain weapons and Techs can invent modifications for weapons that do any number of things. So having a place to put numbered modifiers for weapons attacks and damage rolls would be extremely useful as well.

damned
January 3rd, 2021, 12:53
Hi Saeval - thanks for the info

I swear I had read the dice rolling so many times... nonetheless you are correct. At this stage Im just using a built in FGU dice roller which also doesnt handle fails either so I will need to work on the actual dice later on.

Someone else also pointed out that you can change Roles. The official character sheet has no support for this and that is what I initially started with. I will add support for additional roles at some point.

Yep. The current ranged attacks is a first pass only. Most likely the deeper into the system I get the more complex this are will become! Would every field need to be able to have a modifier to it? Eg could there be a skill that gives you +1/+1/+2/+2/+3/+3 on Sniper Rifle ranges meaning you cant apply a single modifiier? What would you suggest?

Appreciate the extra info.

Saeval
January 3rd, 2021, 13:56
With the scopes available in the game giving bonuses only after certain ranges it might be nice to add something where you have the rollable values for the DV’s. Even if it’s something as simple as a flat bonus using the scroll wheel and adding whatever attachment descriptions in the inventory.

The Excellent Weapon quality gives a static +1 at all ranges so it might be nice to have a general modifier box for ease and simplicity on top of the range specific bonuses but it could also just be done with a +1 for each range. It seems like all bonuses stack unlike lots of other games (my group plays a lot of pathfinder) so unless it specifically says it doesn’t stack we might need a single modifier box for all ranges and then the ability to modify each range attack roll specifically for scopes and whatever else comes along in the future.

I haven’t finished watching the video series so I haven’t seen how far along you’ve gotten but do you have the ability to do Autofire weapon rolls yet?
The short version is they have they’re own range DV table and the damage is a few dice multiplied by how much you beat the DV up to a maximum.

For example an assault rifle auto fire has a DV of 20 we’ll say at a certain range so you roll a 24, then you roll 2d6 for damage and multiply the result by 4 before taking armor into account since you got 4 above the DV. Assault rifles have a maximum multiplier of x5 so if you rolled a 26+ it wouldn’t matter it would cap at 2d6x5.

I realize this is pretty different from most other systems and I’m not sure the most efficient way to handle it while also considering ease of use, space on the character sheet, and the ability to modify the values since a Tech role can literally invent whatever they and the GM can agree on as a special item. So even though all auto fire damage is 2d6 right now there’s nothing in the rules that stops them from inventing a heavy machine gun that does 2d6+2 with a certain max multiplier as an example or a cool sight that gives a bonus within the first few range increments.

syddraf
January 5th, 2021, 04:36
This Is great! I am really tempted to follow along and make a red ruleset myself cause i'd love to have one to play with my group. But beyond that, is their a good place to get a primer on the coding options in fantasy grounds? I have near zero experience coding (I can read a sql script and tell what it is supposed to do but would be hosed trying to figure out how to make it do it on my own.) your videos are excellent and you explain how to manipulate the software very well. will be picking up the ruleset wizard next time i get cash for sure. I am a huge fan of off the beaten path RPG systems and this would enable me to bring some of them to the virtual table top.

Valyar
January 6th, 2021, 12:06
Any news from the publisher? :)
(hope intensifies)

Saeval
January 6th, 2021, 12:11
Any news from the publisher? :)
(hope intensifies)

Nothing official obviously but I’ve been tagging RTalsorian Games on Twitter about a collaboration with Fantasy Grounds and they’ve started liking that tweet. No response yet but I will not give up!

damned
January 6th, 2021, 12:29
Any news from the publisher? :)
(hope intensifies)

nyet

Valyar
January 16th, 2021, 08:50
I have just seen screenshots of Cyberpunk Ruleset for FG in the Facebook group to my huge surprise & frustration. I have never been more disappointed, I hope we won't have another game butchered.

https://nerdeyeindustries.com/forums/topics/9-Cyberpunk-Red

badula
January 16th, 2021, 13:29
I have just seen screenshots of Cyberpunk Ruleset for FG in the Facebook group to my huge surprise & frustration. I have never been more disappointed, I hope we won't have another game butchered.

https://nerdeyeindustries.com/forums/topics/9-Cyberpunk-Red

What do you mean by butchered? Seems pretty legit to me! Actually i would like to have it like that RIGHT NOW!

Saeval
January 16th, 2021, 13:32
What is Nerd Eye Industries?
The picture of the character sheet looks decent but with definite room for improvement but isn’t what’s being worked on by Damned. I’ve watched his videos on YouTube and he’s taking a different approach to laying out things it seems.

Valyar
January 16th, 2021, 15:16
It is legit. That is my concern. ;)

Saeval
January 16th, 2021, 16:22
I’m confused, you’re concerned that there is a legitimate ruleset being worked on and it might be poorly made? You might want to elaborate on what your frustration is about. Are you sure that’s an official ruleset being worked on and not someone’s side project?

Valyar
January 16th, 2021, 16:43
I’m confused, you’re concerned that there is a legitimate ruleset being worked on and it might be poorly made? You might want to elaborate on what your frustration is about. Are you sure that’s an official ruleset being worked on and not someone’s side project?
I am fairly certain that this might be official work due to the FB posts and the link to the forums of Nerd Eye Industries. My problem with that can be summarized in this forum post in Conan 2d20's section: https://www.fantasygrounds.com/forums/showthread.php?61998-What-is-the-state-of-Conan-2d20-ruleset-amp-module-development

In short - I don't have much confidence that this will address the high expectation for this roleplaying game considering how Conan 2d20 is taken care of. I will give the benefit of the doubt of course, but for now I am not really excited. :( Combined with the fact that I really want to use FG instead Foundry for this I am taken back even further.

Saeval
January 16th, 2021, 17:17
Ok, I have a better understanding of the situation so far. I had no idea what Nerdeye Games was or how they factored into the situation.

So it seems pretty likely they’re working on an official ruleset which would also explain a few other things I noticed.

I read through the forum you posted and it seems like they were having a hard time keeping up with developing the ruleset further and released a subpar product in the eyes of the consumers and you’re worried the same thing could happen with Cyberpunk RED.

From what they’ve said about having just 3-4 of them total working on rulesets and all of them have day jobs it is a little disconcerting that they would pick up another ruleset to work on. I will give them the benefit of the doubt and hope they can manage their time between rulesets wisely and that the real life setbacks of 2020 won’t interfere too harshly now that they claim to be past them.

Fingers crossed this goes well because I’ve been a fan of Cyberpunk since the early 90’s and I would be extremely disappointed if this gets botched. I’m not a fan of Roll20 at all but the 2 games I want to run after my current campaign wraps are Legend of the 5 Rings (5th edition) or Cyberpunk RED. So far there’s no easy way to do either of those on FG since I have zero coding experience so I may have to bite the bullet and go back to Roll20 for my next game.

Valyar
January 16th, 2021, 17:37
You understand my concerns. I have started putting content into Foundry for Cyberpunk as there is excellent interface mod and 2 systems in progress, but when I saw damned's work I stopped to see the what will turn out from the conversation with the publisher.

Quite disheartening situation, but lets see what will happen. Cyberpunk RED rulebook is visual beauty with very interesting layout elements and approach towards structuring the content. I want to see how this will be converted as reference manual and the product as a whole, it is high bar. If they botch it like in Conan 2d20 this will be disaster.

JoakimEdman
September 18th, 2021, 19:47
Following Damiens instructionvideos for creating a Cyberpunk RED ruleset with the RulesetWizard. It has gone quite nice, even been modifying some parts to get closer to the rules.
Have been stuck with a problem and have been trying to understand how to use Lua to program Skill dice.

Cyberpunk RED all skill rolls are 1d10+skill+bonus/penaltys.
On a 10(first dice roll) it explodes +1d10 (but only explode once)
On a 1(first dice roll) it explodes low -1d10(but only once)

Trying to get how things work I found the following.
1d10e explodes on 10, you can se all the extra dice in green and the calculated sum is corect.
1d10l (L) explodes on 1, you can se all the extra dice in red and the calculated sum is corect.
In MoreCore you can use the “/witcher 1d10”. You only se the first die and have 3 sums making it realy wanky.

None of these 3 dice version can be stopped after exploding once.
And sadly I have not found a way to marry the explode (e) and explode low (l).

Found the Lua part for “/witcher”, but to be honest I cant figure it out, even after 1 month (Well worked hard the first 2 weeks 8h/day, but have resign a bit.)

Best version is if I could use both the 1d10e and 1d10l at the same time and some how only explode once, or perhaps some other way.
where can I find the knowledge on how to do it.
Thanks all.
:)

seansps
March 14th, 2022, 23:54
Following Damiens instructionvideos for creating a Cyberpunk RED ruleset with the RulesetWizard. It has gone quite nice, even been modifying some parts to get closer to the rules.
Have been stuck with a problem and have been trying to understand how to use Lua to program Skill dice.

Cyberpunk RED all skill rolls are 1d10+skill+bonus/penaltys.
On a 10(first dice roll) it explodes +1d10 (but only explode once)
On a 1(first dice roll) it explodes low -1d10(but only once)

Trying to get how things work I found the following.
1d10e explodes on 10, you can se all the extra dice in green and the calculated sum is corect.
1d10l (L) explodes on 1, you can se all the extra dice in red and the calculated sum is corect.
In MoreCore you can use the “/witcher 1d10”. You only se the first die and have 3 sums making it realy wanky.

None of these 3 dice version can be stopped after exploding once.
And sadly I have not found a way to marry the explode (e) and explode low (l).

Found the Lua part for “/witcher”, but to be honest I cant figure it out, even after 1 month (Well worked hard the first 2 weeks 8h/day, but have resign a bit.)

Best version is if I could use both the 1d10e and 1d10l at the same time and some how only explode once, or perhaps some other way.
where can I find the knowledge on how to do it.
Thanks all.
:)

Hi! Did you ever manage to figure out where you were stuck? I’m reading through the Core Rulebook now, but have been following this thread to see if we ever get a functioning ruleset.

I may take a crack at it myself at some point once I get a solid understanding of the rules. I may be able to help with the Lua scripting (though I find the hardest part with making extensions is the blackbox that is FG’s API.)

JoakimEdman
March 15th, 2022, 17:44
I have not touched it in a long while and am trying to get back to work after being burnt out so not as much time sadly for now.
Might return to it but not in a foreseeable future.
Best Wishes Joakim

seansps
March 15th, 2022, 17:50
I have not touched it in a long while and am trying to get back to work after being burnt out so not as much time sadly for now.
Might return to it but not in a foreseeable future.
Best Wishes Joakim

No problem! The issue was in scripting the “exploding” function of the dice, right? If I get around to it, I can start there, see if I can figure it out.

Nightstride
March 16th, 2022, 00:54
Here's generally how I do it:


function onInit()

GameSystem.actions = {
["skillroll"] = {sIcon = "action_effect", sTargeting = "none", bUseModStack = true },
};

-- Register the result handler - called after the dice have stopped rolling
ActionsManager.registerResultHandler("skillroll", onSkillRoll);
ActionsManager.registerResultHandler("critRoll", onCritRoll);

end

function performSkillRoll(draginfo, charsheet, skillName, skillBase)

-- Initialise a blank rRoll record
local rRoll = {};

-- Add the 4 minimum parameters needed:
-- the action type.
rRoll.sType = "skillroll";
-- the dice to roll.not
rRoll.aDice = { "d10" };
-- A modifier to apply to the roll.
rRoll.nMod = skillBase;

-- The description to show in the chat window
rRoll.sDesc = "[Skill] ".. skillName .. "(" .. skillBase .. ") + 1d10";

ActionsManager.performAction(draginfo, rActor, rRoll);
end

function onSkillRoll(rSource, rTarget, rRoll)
local rActor = ActorManager.resolveActor(charsheet);
local isCrit, modifiedRoll = isCritRoll(rRoll);

if isCrit then
modifiedRoll.sPrevRoll = Json.stringify(rRoll);
ActionsManager.performAction(draginfo, rSource, modifiedRoll);
else
-- Create the base message based off the source and the final rRoll record (includes dice results).
local rMessage = ActionsManager.createActionMessage(rSource, modifiedRoll);

-- Display the message in chat.
Comm.deliverChatMessage(rMessage);
return;
end

end

function onCritRoll(rSource, rTarget, rRoll)
local combinedRoll = Json.parse(rRoll.sPrevRoll);
combinedRoll.aDice = {combinedRoll.aDice[1], rRoll.aDice[1]};
combinedRoll.sDesc = combinedRoll.sDesc .. rRoll.sDesc;

-- Create the base message based off the source and the final rRoll record (includes dice results).
local rMessage = ActionsManager.createActionMessage(rSource, combinedRoll);

-- Display the message in chat.
Comm.deliverChatMessage(rMessage);
end

function isCritRoll(rRoll)
local isCrit = true;
local outRoll = rRoll;

if outRoll.aDice[2] ~= nil then
outRoll.aDice = {outRoll.aDice[1]};
outRoll.sDesc = outRoll.sDesc .. " [Extra Dice Ignored]"
end

if outRoll.aDice[1].result == 1 then
outRoll = createCritRoll("-d10", " - 1d10 [Critical Failure] ", outRoll.bSecret);
elseif outRoll.aDice[1].result == 10 then
outRoll = createCritRoll("d10", " + 1d10 [Critical Success] ", outRoll.bSecret);
else
isCrit = false;
end

return isCrit, outRoll;
end

This relies on the existence of a script called Json.lua (You can get the script from the MoreCore ruleset in the script folder, last I checked, the devs are okay with it being used in other rulesets). Just be sure to name it properly.

When you want to roll the relevant check, call function performSkillRoll(draginfo, charsheet, skillName, skillBase) and fill out the relevant variables

draginfo - this is the draginfo if it exists
charsheet - this is the root databaseNode of the character sheet
skillName - this is just text
skillBase - this is the number to add to the roll

seansps
March 16th, 2022, 03:53
Thanks! I’ll refer to this when I start adding the scripting.

JoakimEdman
March 16th, 2022, 17:55
Thnx guys.
Will try to resume it when life is less busy and i am back at status quo.
Plz keep me posted.
Best Wishes.
Joakim

JoakimEdman
March 16th, 2022, 18:13
In CPR skills use exploding dice, but they only explode once.
On a natural "1" (Critical failure) you deduct 1d10 from the result. (dice roll with a red background)
On a natural "10" (Critical success) you ad 1d10 to the result. (dice roll with a green background)
I could use the dice rolled grafix for the first dice roll bu could not figure out how the regular explosion dice function.
Could use a RNG without grafix but that was off-putting.
Will return to this project in the future but i will be a wile before that.
Best Wishes Joakim

seansps
March 16th, 2022, 18:22
In CPR skills use exploding dice, but they only explode once.
On a natural "1" (Critical failure) you deduct 1d10 from the result. (dice roll with a red background)
On a natural "10" (Critical success) you ad 1d10 to the result. (dice roll with a green background)
I could use the dice rolled grafix for the first dice roll bu could not figure out how the regular explosion dice function.
Could use a RNG without grafix but that was off-putting.
Will return to this project in the future but i will be a wile before that.
Best Wishes Joakim

Sounds good! I’m still following the tutorials to put together the skeleton of the character sheet. (I’m on part 2 now.) Once I get through this I’ll start wiring up the dice rolls and try to get the explosion logic working.

seansps
March 17th, 2022, 01:52
I’m making decent progress and learning fast, working through the videos posted so far- shouldn’t be long before I have a working first tab of the char sheet.

Question though before I get too deep— are there copyright concerns with sharing a compete CPR ruleset with the community here once done? Is there a reason no one else has (yet)? Just curious- I’d obviously like to share it if I can, once it’s working.

damned
March 17th, 2022, 02:06
The Character Sheet is part of the equation - you then have NPCs, Combat Tracker and Party Sheet but one step at a time!

No copyright issues with sharing a fully working ruleset here. Do not use artwork from the book - create your own assets (borrow mine). Logo is a 50/50 thing. You can use a logo but you must state it is an unofficial or community ruleset - and if the publisher complains about logo you remove it immediately.

How come no one has published one? Its a big job.

seansps
March 17th, 2022, 02:10
The Character Sheet is part of the equation - you then have NPCs, Combat Tracker and Party Sheet but one step at a time!

No copyright issues with sharing a fully working ruleset here. Do not use artwork from the book - create your own assets (borrow mine). Logo is a 50/50 thing. You can use a logo but you must state it is an unofficial or community ruleset - and if the publisher complains about logo you remove it immediately.

How come no one has published one? Its a big job.

Got it! Makes sense. And yeah- I wrote some TODO notes for all the things that I think need doing. But I’ll give it a shot!

damned
March 17th, 2022, 02:27
It is worth a shot and also - you dont have to have a fully working model before you start to share.
You can use the Forge to share your system - just be clear that it is a beta WiP and roughly what to expect from it.

Be aware - others are working on the same system - but dont let that stop you. You never know how far along they will get, if they will complete, if they will share, if you like their implementation. Its a good exercise to work on regardless!

seansps
March 17th, 2022, 02:28
It is worth a shot and also - you dont have to have a fully working model before you start to share.
You can use the Forge to share your system - just be clear that it is a beta WiP and roughly what to expect from it.

Be aware - others are working on the same system - but dont let that stop you. You never know how far along they will get, if they will complete, if they will share, if you like their implementation. Its a good exercise to work on regardless!

Makes sense, and I agree! Thanks Damned, I shall definitely put out a beta if I think it’s a usable state.

seansps
March 18th, 2022, 02:02
Hey @damned,

Wanted to get your insight here, and anyone else who wants to weight in.

Here's a screenshot of my current progress. (I haven't watched all your tutorials yet, but I will!)

52038

Here you can see I am going a slightly different route than you took in your tutorial:

I have made it so that changing values (such as maximums) lowers current values if needed
I have made it so that current cannot exceed max
I have automated the setting of Max values, such as humanity, making sure that also bringing down current humanity brings down current empathy. (Future TODO item for me here is to also lower current humanity when equipping cyberware. That'll come way later when I do item templates.)
The seriously wounded mod box starts at 0, goes to -2 at < the threshold, and -4 at 0 hp
I have added an initiative / speed box. Init can be double clicked or click-n-drag to roll init. (When I do the combat tracker, I'll make sure it updates there too.)
I have gone with a different tactic for the Armor:

Armor has three static inputs for Head,Shield,Body

Dragging and item to either line or link box "equips" it here, and you can remove it by right clicking and hitting Remove

TODO for me here is, after I make item templates for armor and weapons, only allow armor in the appropriate slots and actually set the SP and Penalty values
I also plan on automating all the penalty values with rolls the character makes (so they don't have to double click them.)



Like I said, a bit different! Trying to automate as much as possible, but this is fun so far. Let me know if you think this is the right direction!

damned
March 18th, 2022, 02:06
By all means go in your own direction.
Already by the time I decided to stop there are things I would have done differently - particularly with skills

Also bear in mind - I have never played the game so your perspective will be different to mine.

All of those changes sound legitimate so keep on going.

seansps
March 18th, 2022, 02:09
By all means go in your own direction.
Already by the time I decided to stop there are things I would have done differently - particularly with skills

Also bear in mind - I have never played the game so your perspective will be different to mine.

All of those changes sound legitimate so keep on going.

Will do, thanks! I haven’t played either actually - just reading the core Rulebook cover to cover now, and working on the ruleset as I go. But- I really want to run this game (in Fantasy Grounds of course!)

Anyway, I haven’t got to skills yet. Looking forward to tackling that next, probably, if not items/equipment first.

seansps
March 19th, 2022, 19:31
So I actually did get some code working that handles Exploding dice on 10 (adding result) and on 1 (subtracting result) using a custom result handler for skill checks. It colors the additional d10 red or green, and only explodes once.

I am going to implement it for all skills and allow for just rolling on an ability as well, and implement it there too. (As well as auto adding penalties due to armor on relevant skills/abilities.). I can provide a code snippet for any trying to do this too, if interested.

Edit: Here's a screenshot of my WIP (still need to do weapons and all here too, but think I am going to implement skills and item templates first to do that properly.)
52073. (Ignore the bugged "Crit failure" for rolls that were normal... fixed that already lol).

damned
March 20th, 2022, 00:24
Well done! Looking good. I would love to see your code.

seansps
March 20th, 2022, 01:09
Well done! Looking good. I would love to see your code.

Thanks! Certainly!

In campaign/scripts/manager_cpred.lua: (You can ignore the `customPerformAction` for now, I am going to use that later to calculate hits based on the range of the target to the actor, and each item will have it's own DV table in the template, is the plan.) The code for `resolveAbility` was heavily borrowed from an old thread, so I am not sure if I need the second result check here. But just in case... for now, it's there.



function onInit()
GameSystem.actions= {
["dice"] = { bUseModStack = "true" },
["table"] = { },
["effect"] = {sIcon = "action_effect", sTargeting = "all" },
["deathsave"] = {sIcon = "action_effect", sTargeting = "none" },
["initiative"] = {sIcon = "action_effect", sTargeting = "none" },
["ability"] = {sIcon = "action_effect", sTargeting = "none" },
};

ActionsManager.registerResultHandler("deathsave", resolveDeathSave);
ActionsManager.registerResultHandler("initiative", resolveInitiative);
ActionsManager.registerResultHandler("ability", resolveAbility);

performAction = ActionsManager.performAction;
ActionsManager.performAction = customPerformAction;
end

function resolveAbility(rSource, rTarget, rRoll)
local nDiceRoll = 0;

Debug.console(rRoll);
Debug.console(rRoll.aDice[0]);

local firstResult = 0;
local secondResult = 0;
local isCrit = false;
local isCritFail = false;
local dicetable = rRoll.aDice;
local reroll = false;
local total = {};

-- TODO Cleanup, remove second result?
if dicetable then
for n = 1, table.maxn(dicetable) do
if dicetable[n].type == "d10" then
if firstResult > 0 and dicetable[n].result > secondResult then
secondResult = dicetable[n].result;
total[2] = dicetable[n];
elseif dicetable[n].result > firstResult then
firstResult = dicetable[n].result;
total[1] = dicetable[n];
end
end
end
end

if firstResult == 10 or secondResult == 10 then
isCrit = true;
local dieRoll = math.random(1,10);
local explode = {};
explode.type = "g10";
explode.result = dieRoll;
table.insert(total, explode);
-- Show the roll a d10
local dice = {};
table.insert(dice, "d10");
Comm.throwDice("explode", dice, 0, "explode");
-- Insert into actual result
table.insert(rRoll.aDice, explode);
elseif firstResult == 1 then
isCritFail = true;
local dieRoll = math.random(1,10);
local explode = {};
explode.type = "r10";
explode.result = dieRoll;
table.insert(total, explode);
-- Show the roll a d10
local dice = {};
table.insert(dice, "d10");
Comm.throwDice("explode", dice, 0, "explode");
-- Insert into actual result
explode.result = dieRoll * -1;
table.insert(rRoll.aDice, explode);
end

-- TODO deduct penalties if needed?

local rMessage = ActionsManager.createActionMessage(rSource, rRoll);
local playerName = ActorManager.getDisplayName(rSource);
rMessage.text = "[".. rRoll.sDesc .. "]";
if isCrit then
rMessage.text = "[".. rRoll.sDesc .. "][CRIT SUCCESS]";
elseif isCritFail then
rMessage.text = "[".. rRoll.sDesc .. "][CRIT FAILURE]";
end

Comm.deliverChatMessage(rMessage);
end


Then in the code for each ability (change the value for `local nStat`and `sDesc` accordingly`... I'm also going to be doing it this way basically for each skill too, on the next tab):


function onInit()
local w = addBitmapWidget("field_rollable");
w.setPosition("bottomleft", 4, -6);
setHoverCursor("hand");
end

function action(draginfo)
local nodeWin = window.getDatabaseNode();
local rActor = ActorManager.resolveActor(nodeWin);
local nStat = nodeWin.getChild("int_current").getValue();

rRoll = {
sType = "ability",
sDesc = "INT",
aDice = {expr = "1d10" },
nMod = nStat,
nTarget = nil
};

ActionsManager.performAction(draginfo, rActor, rRoll);
end

function onDragStart(button, x, y, draginfo)
action(draginfo);
return true;
end

function onDoubleClick(x, y)
action();
return true;
end

damned
March 20th, 2022, 01:24
Nicely done!

seansps
March 20th, 2022, 01:25
Nicely done!

Thanks! I’ll definitely do some refactoring/cleanup once I address all my TODOs lol.

Brotherkelly
March 30th, 2022, 08:17
Thanks! Certainly!

In campaign/scripts/manager_cpred.lua: (You can ignore the `customPerformAction` for now, I am going to use that later to calculate hits based on the range of the target to the actor, and each item will have it's own DV table in the template, is the plan.) The code for `resolveAbility` was heavily borrowed from an old thread, so I am not sure if I need the second result check here. But just in case... for now, it's there.



Hi Seansps, your code for adding the exploding die has helped me tremendously with my issue of only exploding if both dice are max value. Thanks.

I have noticed that most of the time the rolled extra die on the screen does not match the number shown in the chat window. See attached file. Have you found a way to get around this?

I have checked the standard RSW exploding die (with 2d6e) and this appears to be okay.

Any advice would be greatly appreciated.

seansps
March 30th, 2022, 10:35
Hi Seansps, your code for adding the exploding die has helped me tremendously with my issue of only exploding if both dice are max value. Thanks.

I have noticed that most of the time the rolled extra die on the screen does not match the number shown in the chat window. See attached file. Have you found a way to get around this?

I have checked the standard RSW exploding die (with 2d6e) and this appears to be okay.

Any advice would be greatly appreciated.

Hi! Glad to be of help. As for the visual not matching... yes... I have noticed that as well. Unfortunately, right now I am just using the `throwDice` command as a visual to go with the "exploding" dice and have not been able to figure out how to replace the result with what I randomly generated that before. I can keep poking around there and see if there is a way. I could just be using this function wrong or might need to do call `ActionsManager.buildThrow` first with the right values.

Until then, short of having it do another `performAction` and then a separate handler for that, I haven't figured that part out! But, you might be able to use the "1d10e#1" notation, which rolls a d10 and explodes only once on 10. This was fixed with a recent release of FG. And I believe "1d10l#1" does the negative-explode low. This didn't work for me here because I have to be able to do both (and that notation didn't seem to allow for both!)

Brotherkelly
March 30th, 2022, 19:00
Thanks for your thoughts on what to look at. I will see if I can work out how to use the ActionsManager.buildThrow function.

The exploding dice function built in doesn't work for me as I need the roll to explode only if both dice roll a 6.

I am hoping someone will be able to suggest how I can read the value of the rolled dice and add it rather than generate a random number and hope the dice throw shows the same result.

Mephisto
March 31st, 2022, 08:12
The value of the rolled dice is stored per dice in rRoll.aDice. Run a "Debug.chat(rRoll.aDice)" to see how it is set up. There is also a variable "Result" per dice. If I remember correctly, "Result" is what the dice shows and "Value" what is used for calculation. If you have a system where - say - 1 is replaced by an icon, "Result" could be "1" and "Value" something else.

Brotherkelly
March 31st, 2022, 16:47
Thanks. I had considered looking at this part of rRoll.

Will investigate further and see what I can sort out.

seansps
March 31st, 2022, 17:04
Thanks. I had considered looking at this part of rRoll.

Will investigate further and see what I can sort out.

I’ll take a look later this weekend too— but if you figure out how to fix the solution I have, would love to know how!

seansps
April 3rd, 2022, 23:48
Thanks. I had considered looking at this part of rRoll.

Will investigate further and see what I can sort out.

As promised, I have a much better result handler for you now. (See below code.) You can ignore my TODO statement in there (I still have work to do w/r/t combat automation where I'll be editing this further.) Essentially I am turning the resolver into some thing like a recursive function where it repeats the roll on a 10 or 1, and then adds the previous roll to a field in the next roll called "previousRoll" and setting the description so I know in the next calling of the function that it is a crit. Then, if it's a crit, we know not to do it again, and to alter the resulting dice table with the red / green indicators (and make it negative for the crit fails.)

This seems to work quite well for me now with both rolls happening first then the result showing, so I hope it works for you as well! Oh and feel free to format the description however you like.



function resolveAbility(rSource, rTarget, rRoll)
local rollResult = 0;
local dicetable = rRoll.aDice;
local desc = rRoll.sDesc;

-- Skill / Ability rolls start with a single d10
if dicetable and dicetable[1].type == "d10" then
rollResult = dicetable[1].result;
end

if rollResult == 10 and not string.match(desc, "CRITICAL") then
-- Explode once
local rExplodeRoll = {
sType = rRoll.sType,
sDesc = "[" .. desc .. "][CRITICAL SUCCESS]",
aDice = {expr = "1d10" },
nMod = rRoll.nMod,
nTarget = rRoll.nTarget
};
rExplodeRoll.previousRoll = rollResult;
return ActionsManager.performAction(nil, rSource, rExplodeRoll);
elseif rollResult == 1 and not string.match(desc, "CRITICAL") then
local rExplodeRoll = {
sType = rRoll.sType,
sDesc = "[" .. desc .. "][CRITICAL FAILURE]",
aDice = {expr = "1d10" },
nMod = rRoll.nMod,
nTarget = rRoll.nTarget
};
rExplodeRoll.previousRoll = rollResult;
return ActionsManager.performAction(nil, rSource, rExplodeRoll);
end

-- Check if we had a Crit Success or Failure
local isCrit = false;
if string.match(desc, "CRITICAL SUCCESS") then
isCrit = true;
-- Add the current roll to the previous and make it green
rRoll.aDice = {
{type = "d10", result = rRoll.previousRoll},
{type = "g10", result = rRoll.aDice[1].result},
};
elseif string.match(desc, "CRITICAL FAILURE") then
isCrit = true;
-- Subtract the current roll from the previous and make it red
rRoll.aDice = {
{type = "d10", result = rRoll.previousRoll},
{type = "r10", result = rRoll.aDice[1].result * -1},
};
end

local rMessage = ActionsManager.createActionMessage(rSource, rRoll);
local playerName = ActorManager.getDisplayName(rSource);

-- TODO Display HIT or MISS for "attack"

if not isCrit then
rMessage.text = "[".. desc .. "]";
end

if rRoll.sType == "attack" then
rMessage.text = "[ATTACK]".. rMessage.text;
end

Comm.deliverChatMessage(rMessage);
end

Brotherkelly
April 5th, 2022, 07:44
Hi Seansps,

Many thanks for this. I had also been looking at using ActionsManager.performAction routine but couldn't get the parameters right to feed into it. I will go through this in more detail over the next few days and see if it works for my application.

Brotherkelly
April 8th, 2022, 10:41
The code works a treat for a single d6 exploding dice when 2d6 roll max value (12).

I am now going to see how I can get it to roll additional d6's when the exploding d6 rolls a 6. This may take a while.

Example - initial roll us 12, first exploding d6 is a 6, second exploding d6 is also a 6, third exploding d6 is a 4. Giving a total roll of 28..

seansps
April 8th, 2022, 13:40
The code works a treat for a single d6 exploding dice when 2d6 roll max value (12).

I am now going to see how I can get it to roll additional d6's when the exploding d6 rolls a 6. This may take a while.

Example - initial roll us 12, first exploding d6 is a 6, second exploding d6 is also a 6, third exploding d6 is a 4. Giving a total roll of 28..

I see, yours need to keep going! It’s easily done. In rRoll add a field like “isExplode = 1” and do that whenever you need it to explode. Then check that instead of the description like I am doing, and return when doing the perform action. Because you have multiple explosions, you’ll also want to keep track of each die roll in an array instead of what I’m doing (previousDieRoll.) Then, if it is not exploding, you would check that array and add all those die to the current dice table.

Edit: Or really, just keep checking if any dice is a 6, and roll again for those. You’ll have to keep track of the other dice in a var on rRoll, though, so you can display the final message.

Brotherkelly
April 9th, 2022, 21:52
Thanks for the additional advice . I will look at this during the coming week and report back on the outcome.

Brotherkelly
April 21st, 2022, 07:44
Well I have worked out a solution but it is not pretty. The code used is below:

function AttributeCheck(rSource, rTarget, rRoll)

local nRollResult = 0;
local dicetable = rRoll.aDice;
local nFirstResult = 0;
local nSecondResult = 0;
local sDescription = rRoll.sDesc;
local nExplode = tonumber(rRoll.nExplode);
-- Debug.chat("initial",rRoll,nExplode);


if nExplode == 1 then
nFirstResult = dicetable[1].result;
nSecondResult = dicetable[2].result;
nRollResult = nFirstResult + nSecondResult;
else
nRollResult = tonumber(rRoll.previousRoll);
end
-- Debug.chat("Initial Roll Result",dicetable,nRollResult);

if nRollResult == 12 and tonumber(rRoll.nExplode) == 1 then
local rExplodeRoll = {
sType = rRoll.sType,
sDesc = sDescription,
aDice = {expr = "1d6"},
nMod = rRoll.nMod,
nTarget = rRoll.nTarget,
nBonuses = rRoll.nBonuses,
TN = rRoll.TN,
};

rExplodeRoll.previousRoll = nRollResult;
rExplodeRoll.ReRoll = tonumber(rRoll.ReRoll) + 1;
-- Debug.chat("Previous Roll",rRoll,rExplodeRoll);
return ActionsManager.performAction(nil, rSource, rExplodeRoll);
end
-- Debug.chat("Roll Check",nRollResult,rRoll.aDice[1].result);

repeat
if nRollResult > 11 and rRoll.aDice[1].result == 6 and tonumber(rRoll.previousRoll) < 24 then
rRoll.nExplode = 1;
local rExplodeRoll = {
sType = rRoll.sType,
sDesc = sDescription,
aDice = {expr = "1d6"},
nMod = rRoll.nMod,
nTarget = rRoll.nTarget,
nBonuses = rRoll.nBonuses,
TN = rRoll.TN,
};

rExplodeRoll.previousRoll = nRollResult + rRoll.aDice[1].result;
rExplodeRoll.ReRoll = tonumber(rRoll.ReRoll) + 1;
-- Debug.chat("Previous Roll",rRoll,rExplodeRoll);
return ActionsManager.performAction(nil, rSource, rExplodeRoll);
else
rRoll.nExplode = 0;
end
-- Debug.chat("explode check",rRoll,rExplodeRoll);
until rRoll.nExplode == 0;

local isCrit = false;
if nRollResult > 11 then
isCrit = true;
rRoll.aDice = {
{type = "d6", result = rRoll.previousRoll},
{type = "g6", result = rRoll.aDice[1].result},
};
-- Debug.chat("Dice Array",nReRoll,rRoll.aDice);
end

if nRollResult == 2 then
rRoll.aDice = {
{type = "r6", result = rRoll.aDice[1].result},
{type = "r6", result = rRoll.aDice[2].result},
};
end


local rMessage = ActionsManager.createActionMessage(rSource, rRoll);
if nRollResult > 11 then
rMessage.diemodifier = rRoll.nBonuses;
end
-- Debug.chat("Message",rMessage);
local nDiceRoll = ActionsManager.total(rRoll);
local nTotal = nDiceRoll + rRoll.nBonuses;
-- get the Dice Roll + Modifiers total
-- Debug.chat("Roll total",nDiceRoll,nTotal);

local nTargetNumber = tonumber(rRoll.TN);
-- Debug.chat(nTargetNumber);
if isCrit then
sSaveResult = "\n[CRITICAL SUCCESS]";
-- Append a Critical Success Message
-- update the roll result for a Critical Success (result - d6)
sMargin = "\nMargin of Success = " .. tostring(nTotal-nTargetNumber);
elseif nDiceRoll == 2 then
sSaveResult = "\n[FUMBLE]";
sMargin = "\nAutomatic Failure";
elseif nTotal >= nTargetNumber then
sSaveResult = "\n[SUCCESS]";
sMargin = "\nMargin of Success = " .. tostring(nTotal-nTargetNumber);
else
sSaveResult = "\n[FAILURE]";
sMargin = "\nMargin of Failure = " .. tostring(nTargetNumber-nTotal);
end

rMessage.text = rMessage.text .. sSaveResult .. sMargin;
Comm.deliverChatMessage(rMessage);


end


There are some values I have defined in the roll parameters - rRoll.TN, rRoll.nExplode & rRoll.ReRoll.

The code is set to allow a maximum of 3 exploding dice (as per the rules for BT:ATOW) allowing a max dice value of 30. The exploding 6's are added together and displayed as the first dice in the chat window. The final dice roll is displayed as the second dice.

I will continue to see if I can improve the code layout but for now I am working on the rest of the ruleset and character sheet layout.

seansps
April 21st, 2022, 13:55
Awesome! Hey, if it works it works. You can always go back later and refactor code. Glad I was able to help. There may be better ways to implement what we wanted but this style seemed to work for me too!

t3xx3r
May 3rd, 2022, 22:26
In this tutorial series we are going to use the new Ruleset Wizard by psicodelix to create a basic ruleset. We will begin by building a character sheet and maybe a bit more for the Cyberpunk RED RPG.
In this video we will look at the Ruleset Wizard, setting up Frames and Icons and setting up a Fantasy Grounds Window.
Get the Ruleset Wizard here - https://www.rulesetwizard.com/get-rul... - it is in Early Access, there are no guarantees, but for 50Euro your support will help the dev continue building out this product.
Get Fantasy Grounds here - https://www.fantasygrounds.com/home/h...
Get Cyberpunk RED here - https://www.drivethrurpg.com/product/... or the Jumpstart here - https://www.drivethrurpg.com/product/...

Please share any rulesets you create with the community by sharing them here - https://www.fantasygrounds.com/forums/
If this video was useful to you feel free to help me fund my RPG habit here - https://paypal.me/fgdamned
Watch in HD so you can read the text/code as it goes along.

Playlist https://www.youtube.com/watch?v=LqY2jbwEToU&list=PLsgd1zJLdiKXtdLt1FBYjZrJUtJWCjGmT
Video 1: Getting Started with the Ruleset Wizard and the Character Sheet
Video 2: Adding more elements and some basic coding
Video 3: Adding additional coding and character sheet elements
Video 4: More character sheet coding and character sheet elements
Bonus Video 1: Creating frames for character sheet and chatbox
Video 5: Editing the common section at the top of the character sheet
Bonus Video 2: Creating a desktop wallpaper with some punch
Video 6: Creating an Armor/Defense List

Great videos, damned. Appreciate it!