Thanks Damned - Whatever you did worked perfectly!
Printable View
Thanks Damned - Whatever you did worked perfectly!
The error was...
\Fantasy Grounds\extensions\MCDbD\common\record_npc.xml
\Fantasy Grounds\extensions\MCDbD\extension.xmlCode:
Line 270: NPCManager.getThac0(rActor)
Line 276: NPCManager.setNPCSave(rActor, nHD);
All references to NPCManager should be NPCManager2Code:Line 52: <script name="NPCManager" file="common/scripts/npc_more.lua" />
I suspect Ive made this error in a few other extensions too...
Interesting, it is those tiny little guys that are tough to catch. Thanks again!
Hi,
I am trying to emulate what you are doing in the videos. They are a great resource for someone like me, who has never ever done a single line of coding before.
But I am getting stuck at the part where you are changing the size of the Attackframe. I'm just not able to change the size of it. I have gone through your videos and your source files multiple times and I am not able to see what I am doing wrong.
I have even gone into the ruleset and changed the values in the Attackframe directly there, and nothing happened.
But what I find odd is that the changes for the other elements in the extention file functions. Even the new "statsframe" shows up. I can change the size and position of that just fine.
I haven't done everything you've done in the videos, as I've basically jumped to video 10 and tried to change the size of the attackframe. So maybe I am missing a XML file I should have made. Could you just take a minute to point me in the right direction?
This is what I've written in the record_char_more.xml file, and I have underlined part of the code which should change the size of the attackframe:
Code:<?xml version='1.0' encoding='ISO-8859-1'?>
<root>
<!-- New WindowClass "charsheet_more" -->
<windowclass name="charsheet_more" merge="join">
<sheetdata>
<!--Change Health to HP -->
<string_useredit name="pc_label_health" merge="join" >
<default>HP</default>
</string_useredit>
<!--Change Defence to AC-->
<string_useredit name="pc_label_defence" merge="join" >
<default>AC</default>
</string_useredit>
<!-- Change Order to Init -->
<string_useredit name="pc_label_order" merge="join" >
<default>Init</default>
</string_useredit>
<!-- Change Size of Attack Frame -->
<frame_char_switch_attacks name="attackframe" merge="join">
<!--<bounds>15,45,-190,120</bounds>-->
<anchored position="insidetopleft" offset="15,75">
<right anchor="center" offset="70" />
<bottom anchor="top" offset="215" />
</anchored>
</frame_char_switch_attacks>
<!--New Stats Frame -->
<frame_char_switch_notes name="statsframe">
<!--<bounds>15,45,-190,120</bounds>-->
<anchored position="insidetopleft" offset="15,0">
<right anchor="center" offset="70" />
<bottom anchor="top" offset="75" />
</anchored>
</frame_char_switch_notes>
</sheetdata>
</windowclass>
</root>
Many apologies ShakyLuigi
Some things evolve over time and some things have two ways to handle them.
In this case if you have a look right at the top of the file approx Ln 19 you will see that frame size is being set in Lua.
Its doing that to help the page resize nicely when someone adjusts its dimensions on the fly.
What are you building?
Thank you for the quick reply. And no apolgies necessary, can't expect a project like MoreCore to stay unimproved over time.
I found the line you were talking about, and I can see that it does something with the attackframe and combatframe. I will see what fun can be had with this information.
Building is probably a bit ambitious considering my level. I am just trying to adjust the character sheet to handle WRFP 4th until (hopefully) someone more skillfully creates a ruleset for it.
I think WFRPv4 woudl be relatively straight forward to code the core mechanics on top of MoreCore
By that I mean - go for it - I reckon you will be able to get something workable going!
Just wanted to let you know I managed to change the size of the Attackframe. Though I had to change it via the ruleset, not the extension. That was a bit beyond what I understand, but it was a way to move on to the other elements I want to change/add.
If I were to need some more help, is this thread a good place to ask you for it, or are there other channels which are more preferable? Or maybe you are a bit busy for this kind of project?
Please ask here. Im very happy to help where I can.
Ill post some code to show you how to make the change in your extension.
Okey, I've been working a bit on this extenstion now. And I'm happy with the progress so far.
But sometimes something weird happens. The text that I want to come up in the character sheet comes up with different text (see picture). Attachment 33441
The text shows as "AdvBasic Skills". And I don't understand why.
This is my code for the frame and text:
The same with the "Athl" which should read "Athletics.Code:<!--Basic Skills Frame -->
<frame_char_switch_notes name="skillsframe">
<!--<bounds>15,45,-190,120</bounds>-->
<anchored to="statsframe" position="below" offset="0,0">
<right anchor="center" offset="170" />
<bottom anchor="top" offset="375" />
</anchored>
</frame_char_switch_notes>
<string_useredit_bold name="basicskills" source="basicskills">
<anchored to="skillsframe" />
<default>Basic Skills</default>
<tooltip textres="label_editable_stats" />
</string_useredit_bold>
Again my code beneath.
I am using copy/paste alot here, so there might be something in the "string_useredit" I don't know about. Heck, I don't even know what "string_useredit'" is!Code:<!-- Athletics -->
<string_useredit name="athletics">
<anchored to="art" position="below" offset="0,10" />
<default>Athletics</default>
<tooltip textres="label_editable" />
</string_useredit>
string_useredit and string_useredit_bold are templates I wrote for MoreCore
They allow these fields to be User Editable.
But they also have a default value.
The very first time they are viewed the default value is applied but it will only do this one time.
If you change the field it will now always have that value.
If you open a new Charsheet it should have teh default values.
This used to catch me out regularly!
For the Attack frame - to modify it in the Extension do this:
Include the whole script section and set your new parameters.Code:<windowclass name="charsheet_more" merge="join">
<script>
function onInit()
self.onSizeChanged = resizeFrames;
end
function resizeFrames(sourceWindow)
local nWidth,_ = getSize();
combatframe.setStaticBounds((nWidth/3*2)-15, 45, (nWidth/3)-15, 170)
attackframe.setStaticBounds(15, 0, (nWidth*2/3)-30, 215)
cas2.setStaticBounds((nWidth/3), 215, (nWidth/3)-15, 240)
end
</script>
Thank you very much for that.
I feel a bit silly now, but I hope this is one typically error that everyone goes through.
I will try the code you gave me, and see if I can make it function.
But I have techincal question here (see picture)Attachment 33472.
As you can see inside the blue field the top "charm" is cut off.
And the bottom "charm animal" is not.
The difference is that I've used anchored position "below" for the charm, and "insidetopleft" for charm animal.
So I used "below" because I thought that this would create a prettier code.Code:<<string_useredit name="charm">
<anchored to="bribery" position="below" offset="0,10" />
<default>Charm</default>
<tooltip textres="label_editable" />
</string_useredit>
<string_useredit name="charmanimal">
<anchored to="charm" position="insidetopleft" offset="0,28" />
<default>Charm Animal</default>
<tooltip textres="label_editable" />
</string_useredit>
Just now I tested with "belowleft" instead, and that worked perfectly.
Why does "below" cut the text of where the anchored text stops?
Just trying to figure out how things work. Thanks.
I would say - look at the width of Name and Art
The others are inheriting width from there.
Damned,
I have been working thru these videos, and it appears in Video 5 you are changing the files directly in the MoreCore directory instead of the extension. At 24.04, you actually changed some code, I looked at the ext code, and couldn't find where you were changing this. And it wasn't in the dbdcombat lua file in the MoreCore script files either. I am loath to actually change the MoreCore, as I assume I could blow some of the files up. Where was this changed? Should I be making a lua script file in the extension folder?
Hi Amatiste
All rolls shoudl really be in the MoreCore ruleset just so that they are available to everyone.
I encourage everyone to make new rolls and donate them to MoreCore.
I cant recall Video 5 but based on its title Im making new rolls and as such I was doing it in the ruleset.
You can create a roll in an extension if you prefer.
What are you working on? Any sneak peeks?
Good day! I'm just looking to hide the MoreData and Abilities tabs...how exactly do I do this? Can't seem to find it.
Thanks,
GBFF
Gunbunny
in your extension do something like this:
file \campaign\record_char.xml
Code:<?xml version="1.0" encoding="iso-8859-1"?>
<root>
<windowclass name="charsheet" merge="join">
<sheetdata>
<subwindow name="more">
<bounds>0,65,-1,-20</bounds>
<class>charsheet_more</class>
</subwindow>
<subwindow name="main">
<bounds>0,65,-1,-20</bounds>
<class>charsheet_main</class>
</subwindow>
<subwindow name="inventory">
<bounds>0,65,-1,-20</bounds>
<class>charsheet_inventory</class>
</subwindow>
<subwindow name="notes">
<bounds>0,65,-1,-20</bounds>
<class>charsheet_notes</class>
</subwindow>
<tabs_charsheet>
<tab>
<icon>tab_more</icon>
<subwindow>more</subwindow>
</tab>
<tab>
<icon>tab_main</icon>
<subwindow>main</subwindow>
</tab>
<tab>
<icon>tab_inventory</icon>
<subwindow>inventory</subwindow>
</tab>
<tab>
<icon>tab_notes</icon>
<subwindow>notes</subwindow>
</tab>
<activate>1</activate>
</tabs_charsheet>
<helper_mc_charsheet />
<close_charsheet />
</sheetdata>
</windowclass>
</root>
Here is the code from the video, and the code from the manager_custom_dbdamage_lua file. I guess my concern is that all the other code you mention in the video is there. This is not. Should I add the code into the file? Since I got the pak from here, I am nervous this could be an up to date file and I could be causing a problem.
Attachment 33575
Attachment 33576
I am only following your videos, trying to figure out how this works to be able to make something of my own :) So this is just Damned Basic Dungeon:)
Also, I cant seem to get the attack rolls correct. For testing, I made a simple rat, using the help file. and its not adding up correctly. First picture is how I have it built. Second is my results. I used the same build for attack and damage as the "PC." Am I doing things incorrectly? Or did I miss a parameter
Attachment 33579
Attachment 33580
Thanks Damned! I couldn't find the file responsible for it....turns out I had no record_char.xml at all in my extension.
GBFF
Done. The only thing of note is that I've got two Notes/Inventory tabs now, but the other tabs (MoreCore & Main) are present just like they should be.
GBFF
You might have to copy the whole file from MoreCore and just remove the two sections each for MoreData and Abilities
The character sheet is progressing fine now.
Finished with all the skills and characteriscs, including the calculations (so much repetion, so thankful for copy/paste and find/replace).
But now I am trying to clean up the the sheet a bit, and I want to remove some of the frames in the "MoreCore" tab. Moves, Powers and Focuses are the first lot that has to to go.
I tried to look at the code you presented in post #58 here, but I couldn't figure out which line or command that actually removed the tabs. I was hoping I could could copy it and use the same method to remove a frame.
So, could you help me with a command/code that would remove, let's say Powers in the Morecore tab? And then I could try to figure out the other frames based on that?
Hey Shaky
So if you are going to remove lots of stuff you might make a copy of the whole record_char_more.xml and include that in your ruleset.
Without any merge tags specified this will replace the standard MoreCore tab.
Then you can simply omit all the things you dont want by deleting the code.
If you are Merging then you would include this in your record_char_more.xml
This will delete the frame, delete the heading, delete the list and delete the scrollbar.Code:<frame_char_switch_rolls name="cas2a" merge="delete" />
<string_useredit_bold name="cas2a_label" source="cas2a_label" merge="delete" />
<list_text name="cliroller2a" merge="delete" />
<scrollbar_rolls name="scroll_2a" merge="delete" />
Do that for each thing you want to remove.
Sometimes you will delete something that something else is anchoring to.... so then you will need to update those anchors.
You will also need to set new dimensions for your remaining items.
Been a bit, but hey Damned. :) Been looking at CoreRPG, but decided to come back here. I am starting a project, after I get things ready for a Phandalin game I'm running. But my project I want to do is the old Top Secret game from back in the 80s. Just starting simple first, character sheet, then expand.
Top Secret? Ooh, ah... haven't played that since puberty!
Okey, now I am kinda stuck at several places. First thing first, a combo box.
So I've added the combo box code from CoreRpg into my extension:
Code:<combobox name="checkselected">
<anchored to="characterinfo" position="insidetopleft" offset="25,0" width="100" height="20" />
<default textres="ps_default_groupability" />
<gmvisibleonly />
<script>
function onInit()
super.onInit();
addItems(DataCommon.psrace);
end
</script>
</combobox>
Then I've added the script and given it the name "DataCommon", and under "psrace" I've added the following:
THEN I've added some strings in my string file.Code:psrace = {
Interface.getString("Reiklander"),
Interface.getString("Dwarf"),
Interface.getString("Elf"),
Interface.getString("Hafling"),
};
And now I get the following error:Code:<root>
<!-- Common -->
<string name="Reiklander">Reiklander</string>
<string name="Dwarf">Dwarf</string>
<string name="Elf">Elf</string>
<string name="Hafling">Hafling</string>
<string name="ps_default_groupability">Reiklander</string>
</root>
I belive the strings are correct as it can find the "ps_default_groupabilty" string and add Reiklander as the default choice.Quote:
[4/22/2020 9:05:01 PM] [<color="red">ERROR</color>] Failed script initialization (DataCommon): [string "scripts/data_common.lua"]:4: attempt to index global 'Interface' (a nil value)
And now I don't know where to keep on troubleshooting.
EDIT: Just got another error:
Quote:
[4/22/2020 9:23:28 PM] [<color="red">ERROR</color>] Script execution error: [string "common/scripts/combobox.lua"]:337: bad argument #1 to 'ipairs' (table expected, got nil)
Hey Shaky
I am unable to make any time to help you on this debugging right now
FYI I will be making a Races tool, similar to Classes, for MoreCore very soon.
No worries. I'm just happy you've helped me so much allready.
I have plenty of other things I need to do with the extension, so maybe I'll get some ideas for troubleshooting through that.
Damned, Quick question. I copied and renamed the file record_char_notes in Morecore/campaign to be able to change things for the Top Secret sheet I am working on, where do you put your own version for the extension? Do you make a campaign folder?
FG uses several different file extensions
.pak is for rulesets
.ext is for extensions
.mod is for modules
.ppk is for portraits
All of them are actually ZIP files. If you install 7zip it will recognise files as such.