Thank you. I'll try and contact Damned.
Printable View
Does anyone know if there is a way within the calc fields for rolls, or the Health, n1/n2 init fields to make it round up or down or round normal .5 rounding?
It has been a while, and I deleted my XCore campaign so I can't see what I did to make a calculation round. I don't think ROUNDUP or ROUNDDOWN work. I may have had to use the Array.
Being that the arrays are whole number indexed, I think what I would have to do is create an array that has an item for every possible number before the division and then have the array return the rounded result if the index value has been divided by the numbers I need.
And, seems it won't work. It's the Health calc field that I need to divide by 2, and I need to reference a roll.
So getdata|DivByTwo|[Strength|a] does not work.
I had to do the look up on the array from within a roll and then reference that roll to get the result into the health field
I gave up on what I was working on when I realized that if any field has a "0" entry and uses an array, it breaks the character sheet for that skill, stat, etc.
I bought the Ruleset Wizard thinking I would teach myself how to create a ruleset or extension. It feels like trying to create custom scenarios for Neverwinter Nights (1 & 2).
You might also want to talk to lamorric since he has a working (for him) SR 3e ruleset.
https://www.fantasygrounds.com/forum...l=1#post758791
So... I found a huge bug in xcore.
If you have a rule with a name of say, Perception, and if another rule or the same rule has the following in a roll or calc of [Perception|a]
This works fine in itself, but if you have another roll with Perception at the end of it's name it will cause a conflict between the two. Specifically the the roll Perception will interpose itself onto any calc or roll that includes Perception at the end.
The code does a gsub that replaces "Perception|a" with the value of the row a of the Perception roll. Matrix Perception|a and Perception|a are exactly the same when searching for Perception|a.
It searches the string of the roll text or the calc text for Perception|a and replaces it. so Matrix Perception|a gets the Perception|a replaced.
So I edited ManagerRolls.lua to replace how gsub was being used to include [ and ] before and after the original value it was replacing so that Perception|a looks for [Perception|a].
This means that the conflict is removed.
It also means that pretty every references requires [ and ] in them.
I hope I explained this, it's complicated and took me too long to figure out why some rolls worked and some didn't. Or why they worked fine sometimes but not all the time.
Attachment 66689
In order to use these changes you will need to unpack the xcore.pak ruleset file into a folder with the name xcore. Then replace the file in rulesets\XCore\campaign\scripts with the one above.
I also added a couple of items to it.
if you put roundup, rounddown, or round as flags that if places at the beginning of a calc will do that form of rounding on the entire line.
You're a god send for those changes.
Hopefully Damned will answer your call.
Does the Auto Calc line on NPCs no longer support multiplication and division?
Edit: Actually having an issue with Auto Calc altogether. Sometimes simple addition and subtraction work on some stat/skills and on others Auto Calc does not work at all, PC & NPC.
I checked the PC sheet and had the same issue. The first roll I tried it on seems to have broken that roll, as nothing works now. The other rolls will accept +/- but not multiplication and division. Is there another updated you posted here? Maybe I missed one recently and that is what is causing the issue??? It has been a little while since I messed with XCore. I need to buckle down and just learn how to make my own rulesets & extensions, lol. I even bought the Wizard, but haven't really tried anything yet.
I made some changes to the code for how calc fields cause updates to happen.
Not sure why but npc sheets on the combat tracker have their fields in the path 1 dot deeper than the character sheet does.
I also noticed that initiative only looks like fields a to c it doesn't use d or e. I changed it so that it uses the same code as everything else for doing it's calculation.
I also cleaned up code that was copy and paste so that it is now functions that are called from each place that had the copy and paste going on.
If anyone finds any problems with things not working please let me know.
Attachment 66733
The file above contains those changes.
Thanks!
That one skill listing was still broken, but after deleting it, all new rolls work properly now, addition, subtraction, multiplication and division. I've had the broken roll issue happen before. Deleting usually fixed it, but then it messes up the order of the rolls on the sheet.
It would be nice if the rolls lists did not auto filter. The list never stays in the order you enter the rolls, one or two will randomly shift it's location in the list with logic, I can tell, on why it goes there. It's not alphabetical. I can't seem to get the filter button to even make lists fully alphabetical, but usually I don't want that either. It would just be better if we could place the rolls in any order we like. That would probably be too much work to fix that though, lol.
I fixed the sorting for the roll lists on the character sheet.
It was looking at each item in the list and changing it's sort order based on how it was currently being sorted. This could as things are added and removed cause the lists sort order to be out of sync with each item.
I've changed it so that it looks at the first item in the list and changes the sort order for every list item based on its sort value.
The sort order changes in the following order rolls name, rolls level, rolls key id.
The rolls key id ends up being the order they were entered into the list.
Because the sort order is an alpha sort and level is a number this caused 10 to be put before 2, etc.
So, I changed the way it is sorting based on the value of level.
It now takes the value in Level coverts the number to a string and adds 0s to the beginning so that the total length of the string is 8 digits.
So, level 0 is now, 00000000, level 1 is now 00000001, level 15 is now 00000015 and so on.
This should make level work the way it was intended to work.
Attachment 66737
So found some bugs with that I was doing.
It all seems to be working now.
I also added a recalculate button to the npc sheet.
I updated all of the XCore record windows to be compatible with the new menu buttons at the top of the window.
If anyone sees any bugs please let me know.
I'm going to modify the health, n1, n2 and init fields on the npc sheet to work the same way as the char sheet.
There will be a gear and you can double click the init box to roll init.
Attachment 66756
Funny thing, found a bug with initiative on the char sheet.
Attachment 66757
This will fix that.
Robert.
Thank you.
I am going to have another update on the 8th.
I found some more problems, which I introduced when updating the windows and other code.
The will be fixed in the update tomorrow.
I also added a menu item to the combat trackers menu, under initiative.
One makes all actors on the combat tracker roll initiative.
The other is going to when done take a value from the options window and modify the initiative of all actors on the combat tracker by that number.
Put a +5 on it and everyone has their initiative increased by 5. Put a -10 and everyone's initiative is decreased by 10.
I['m thinking of having a small window pop up with the value as a default and a button to confirm or cancel.
I am also thinking of changing the Races and Classes windows.
For races I'm thinking of adding a section for rolls, one for each of the non-item lists on the character and npc sheet.
Drop it on either and it copies the rolls from the race to the character sheets lists.
I was thinking of doing something similar for the advancement section of the class record.
Character advances to a particular level and the rolls are added. That will be a little more complicated, need to figure out how the interface for that would work.
I've still not been able to get in touch with Damned.
Not really sure what the rules are for me updating this without his ok.
Will the update be posted here or through Forge? I disabled the Forge version so updates would not override your version.
Also, would it be possible to add the option for initiative to go backwards? Working on a reaction system where going first is a disadvantage?
Thanks again for the updates on the attribute/skill orders. Works perfectly for what I wanted!
I'm unsure what would have to be done to change the combat tracker from going from highest to lowest to lowest to highest.
I'm still trying to figure out how to get a new entry into the options window.
If I can do that I'll have a look at what it would take to have initiative go up instead of down.
I've added 2 new options.
Combat Tracker: Change Initiative by and Combat Tracker: Reverse Initiative Order
Combat Tracker: Change Initiative by
is used by the Combat Tracker menu item Change All Initiatives. Whatever value is put in this field is added to the current initiative to all characters on the combat tracker.
If you put a negative this will cause the initiative to decrease.
Combat Tracker: Reverse Initiative Order
is used by the combat Tracker's sorting function. If this is set to on it will cause the combat tracker to sort from lowest to highest. If it is off it will do highest to lowest.
It currently does not cause a resort when it's changed. Once I've figured out how to force the combat tracker to resort it will do so.
I added 3 options to the combat tracker menu.
Roll All Initiatives, Roll NPC Initiatives, and Change All Initiatives
Roll All Initiatives will roll initiative for all characters on the combat tracker, npc and pc.
Roll NPC Initiatives rolls initiative for all npcs but does nothing for pcs.
Change All Initiatives modifies the initiative of all characters, npc and pc, by the amount entered in the option Combat Tracker: Change Initiative by.
Attachment 66766
That is awesome! Thank you!
So update for that adds two changes to windows, and cleaned up some code based on what Moon Wizard told me.
The races window has been updated. There are 2 tabs now. The main tab has what was there before. The other tab, abilities, has the same list of rolls lists that is on the character sheet. It also includes all of the stats, health, n1, n2, init, reach, size, speed. Any rolls in the lists are copied to the character's rolls lists of the same order. If the character already has a roll with that name in that list it replaces what is on the character with what is on the race.
The classes window has also been updated. In the Advancement window each advancement now has 2 tabs, the main tab has what is currently on the window, the 2nd tab is Abilities. It has the same lists of rolls that are on the character sheet. The stats, health, n1, n2, init, reach, size, speed are not on it. When added to the character it looks at their characters current level and current experience and then compares what the experience needed on the next higher level is. If the character has enough experience to advance then the level is increased and all rolls on the lists for that level advancement are added to the character. Again if it's already there the roll contents is replaced.
I also updated the option that changes the direction of initiative. It now updates the order displayed as soon as it's changed.
There is some clean up in the code that I need to do.
Some of the files were in locations I wasn't expecting and because of this I have two files doing the same thing.
Attachment 66775
Enjoy,
Robert
In the long term, if Damned doesn't give any sign of life, I think you could consider the option to create a fork of Xcore.
He did left a message that ask if someone would be interested to take over Xcore, before he became inactive.
Of course only if the whole of the community is OK with such thing...maybe.
I'm playing around with Ruleset Wizard, trying to learn how to use it.
I bought it when it came out, and then it sat with me barely touching it.
I'm going to try and recreate XCore in it, as I am finding some stuff in it way easier to do.
There is still a lot I've not looked at in XCore, so doing this would probably allow me to dig into it more.
This will take some time to do, so there will probably not be any updates in the next week or two, unless someone finds a bug that needs immediate fixing.
Just a reminder. While great for quick projects; we have found historically that rulesets created with RSW typically do not fare well long term for supportability, due to the use of custom coding outside of the standard CoreRPG workflows and unwinding of templates.
Regards,
JPG
I did not know that.
Thanks for the info.
Can you also do what you did for the attribute/skill orders on the character sheet to the NPCs?
hmm, thought I had changed the sorting on the NPC sheet as well.
May be I did and I haven't posted the change.
I'll have a look.
There were some changes I made that I've not posted yet.
It seems like the NPCs only does Alphabetical. I would like to make it so they stay the order entered instead.
I have not updated for a couple of day, so you may have implemented that.
Thanks for taking a look though!