PDA

View Full Version : MoreCore Coding Tutorials



damned
November 17th, 2018, 04:34
https://www.diehard-gaming.com/htmlimages/morecore.png

Im creating a series of videos on how to create your own custom MoreCore extension for that RPG system that you really wanna run.
These videos are targeted at and based on MoreCore however the concepts will be the same for CoreRPG, DORCore or any other ruleset extension.

In video one we do a little bit of skinning for our new ruleset:
https://www.youtube.com/watch?v=54PSYMXmyvs

In video two we start making some basic changes to the character sheet:
https://www.youtube.com/watch?v=0he0jmdDawE

In video three we start making some actual code changes to the character sheet, adding some extra fields and doing some basic calculations:
https://www.youtube.com/watch?v=RiBkE32tgv8

In video four we setup some Rolls using the new Roll Parameters - watch this even if you dont want to code a whole new ruleset - note that Roll Parameters were improved again after this video was made:
https://www.youtube.com/watch?v=IkWJ7RBcq1g

In video five we dive into some Lua and modify an existing roll to automatically check to hit against the targets AC and another to automatically apply damage:
https://www.youtube.com/watch?v=Qg3U4SPZhCI

My intention here is to build a B/X retro clone called Damned Basic Dungeon and we will go thru the whole process including adding content.

damned
November 17th, 2018, 04:39
Attached is the extension code up to the end of video five so you can easily access the source files if you cannot follow it completely from the videos.
Note that the manager_custom_thac0.lua and manager_custom_dbdamage.lua are contained within MoreCore and not within the extension.

Valyar
November 18th, 2018, 00:35
Very good tutorials. I like how you kept them straight to the point, removing the time sink of typing the code and doing all other extremely interesting things in many coding tutorials, that just waste time and don't contribute with anything.

PS: You record from the server room? :)

damned
November 18th, 2018, 01:12
Very good tutorials. I like how you kept them straight to the point, removing the time sink of typing the code and doing all other extremely interesting things in many coding tutorials, that just waste time and don't contribute with anything.

PS: You record from the server room? :)

They are long enough as they are without me doing all the typing!

Im sorry I cant hear the noise when recording and I cant see whats causing it... :(

damned
November 21st, 2018, 03:39
In video six we dive into some more complex Lua and look at OOB messaging so that players can automatically apply damage to targets:
https://www.youtube.com/watch?v=zTNLJDMLpGk

In video seven we start on the NPC sheet and do some relabeling of current fields, add some new fields and set the NPC to automatically roll HP based on HD if HP is not already set:
https://www.youtube.com/watch?v=LyGEi44QDhU

In video eight we continue work on NPCs and auto-calc the THAC0 value based on HD:
https://www.youtube.com/watch?v=zcttpt5qeqg

Oberoten
November 22nd, 2018, 07:02
In video six we dive into some more complex Lua and look at OOB messaging so that players can automatically apply damage to targets:
https://www.youtube.com/watch?v=zTNLJDMLpGk

In video seven we start on the NPC sheet and do some relabeling of current fields, add some new fields and set the NPC to automatically roll HP based on HD if HP is not already set:
https://www.youtube.com/watch?v=LyGEi44QDhU

In video eight we continue work on NPCs and auto-calc the THAC0 value based on HD:
https://www.youtube.com/watch?v=zcttpt5qeqg



... I could bloody well kiss your feet right now. Was about to start trying to make head or toes out of the OOB messaging :) THANK YOU!

- Obe

damned
November 22nd, 2018, 07:59
... I could bloody well kiss your feet right now. Was about to start trying to make head or toes out of the OOB messaging :) THANK YOU!

- Obe

Huzzah - hope it helps!

Trenloe
November 22nd, 2018, 08:59
hope it helps!
Kissing your feet never helps! ;)

damned
November 22nd, 2018, 11:05
All fetishes aside Video 9 is up now:

MoreCore Extension Tutorial Part 9 - Working with Tables and NPCs Part 3
Create a MoreCore extension to customise MoreCore for the RPG system that you want to play. In this video we pull data from a table and we make some automatic adjustments to new fields on the NPC sheet to support Saving Throws.
https://www.youtube.com/watch?v=GhrySkQTQsE

And the extension with the files to date is attached.

damned
November 27th, 2018, 01:04
Ive uploaded Videos 10 and 11. These took me a long time to work thru so hopefully the videos (and source code should be posted after 12 or 13) will help you do the learns quickly.

MoreCore Extension Tutorial Part 10 - Character Sheet Automation - Part 1
Create a MoreCore extension to customise MoreCore for the RPG system that you want to play. In this video we create a new data class and campaign tool to store Class info and then extend the Character Sheet so that we can store the Charcater Class.
https://www.youtube.com/watch?v=c9RyzgeiQOI

MoreCore Extension Tutorial Part 11 - Character Sheet Automation - Part 2
Create a MoreCore extension to customise MoreCore for the RPG system that you want to play. In this video wesend Level up info for the characters Class and Level to the Chat Window so that the Player knows what changes they need to be making.
https://www.youtube.com/watch?v=PPmDMxCgQRg

damned
November 28th, 2018, 02:08
MoreCore Extension Tutorial Part 12 - Character Sheet Automation - Part 3
Create a MoreCore extension to customise MoreCore for the RPG system that you want to play. In this video we add auto updating fields for Saving Throws and then we use the Rolls Parameters to adjust our Saving Throw Rolls.
https://www.youtube.com/watch?v=YkWALRzhUHY

celestian
November 28th, 2018, 02:22
Great stuff!

damned
November 29th, 2018, 12:19
MoreCore Extension Tutorial Part 13 - Character Sheet Automation - Part 4
Create a MoreCore extension to customise MoreCore for the RPG system that you want to play. In this video we add THAC0 to the Character Sheet and we try a different way to format the Data Array and query it for Data and then we use the Rolls Parameters to adjust our Melee Attack Rolls.
https://www.youtube.com/watch?v=jBCHdxZczXE

Myrdin Potter
February 17th, 2019, 08:36
I am starting to work through these. I want to make an extension for Astonishing Swordsmen and Sorcerers of Hyperboea which is super close to Basic DnD at its core, and this examples and the code really helps.

damned
February 17th, 2019, 11:42
I am starting to work through these. I want to make an extension for Astonishing Swordsmen and Sorcerers of Hyperboea which is super close to Basic DnD at its core, and this examples and the code really helps.

If it is remotely similar to B/X then you should be able to recreate all or most of the major parts of ASSH in a MoreCore extension.
You could of course do it on CoreRPG - much of the content of this series is valid for CoreRPG - but you will find it faster on MoreCore.

GMpatriotes
March 4th, 2019, 04:31
where we can find your last file? im bugged at creating classe.

damned
March 4th, 2019, 04:42
where we can find your last file? im bugged at creating classe.

welcome GMpatriotes

this is the latest file at this time.

GMpatriotes
March 5th, 2019, 01:41
wow thx a lot you saved me lot of time :)

damned
March 5th, 2019, 01:43
Go thru the code as you watch the videos. Learn what it does...

GMpatriotes
March 5th, 2019, 18:48
yeah alrdy done. modifying lot more easy now. thanks for your help

GMpatriotes
March 6th, 2019, 03:24
How we can let other player show the classes. when i want to create the module i cant select it. any idea how we can do this?

damned
March 6th, 2019, 03:41
/export in chat and then close FG and start again.
Go into Library, Module Activation and activate the new Module and set it to Shared.
Players will need to go into Library, Module Activation and activate the new Module.

GMpatriotes
March 6th, 2019, 08:02
yeah i know that, the problem is my custom classes created is not in the export option.

damned
March 7th, 2019, 01:51
screenshot please?

GMpatriotes
March 9th, 2019, 01:14
26619
26620

First picture was the export everything was in double. surely a mistake i did.
and second thing the classes(metier) is not in the export.

damned
March 9th, 2019, 02:06
Classes is not in CoreRPG or in MoreCore.
You would need to code the export function to also export Classes in the Extension...

GMpatriotes
March 14th, 2019, 13:29
you know if semeone did a guide to create this?

damned
March 14th, 2019, 13:39
No guide.
have a look at \scripts\manager_export_morecore.lua
you will need to add the additional class\classes and then include your file in the extension.xml with something like:

<script name="ExportManagerMoreCore" file="scripts/manager_export_morecore.lua" />

Trenloe
March 14th, 2019, 13:41
you know if semeone did a guide to create this?
Have a look at the CoreRPG scripts\data_library.lua file - this has a table of the FG data records supported in that ruleset - called aRecords - this includes a "bExport" flag, that indicates if the record can be exported into a module. There are comments at the top of the file that give info on the fields.

Now, have a look at the scripts\data_library_5E.lua file in the 5E ruleset. This has a aRecordOverrides table, that is used (in the onInit() function at the bottom of the file) to override the base aRecords in CoreRPG - using LibraryData.overrideRecordTypeInfo

This should point you in the right direction to be able to add your custom data into the export window, this also has the advantage of allowing you to register sidebar buttons and control them via the icons at the top of the library window. The disadvantage is that you need to create a nice sidebar button! ;)

GMpatriotes
March 16th, 2019, 19:18
Thanks guys. i will try to do this week end.

GMpatriotes
March 16th, 2019, 20:42
26743
26744
26747

still not work but now (metier) is there i did \scripts\manager_export_morecore.lua and add it. but the next step in extension.xml i think my error is there. i surely did miss something

damned
March 17th, 2019, 00:17
Im guessing it shoudl look more like this:

ExportManager.registerExportNode({ name = "pcclass", class = "pcclass", label = "MoreCore Classes"});

GMpatriotes
March 17th, 2019, 06:00
26752

Morecore Abilities, Morecore classes, Morecore organisation and other with Morecore is not working for export. But other we can export.

Hlynrian
March 30th, 2019, 15:00
The attack frame of Damned Basic Dungeon v1.10 does not seem to resize per the video tutorial.

damned
March 31st, 2019, 03:16
The attack frame of Damned Basic Dungeon v1.10 does not seem to resize per the video tutorial.

I cant recall ever resizing the attack frame... can you point me to where you saw this and I can check/clarify?

damned
March 31st, 2019, 03:17
26752

Morecore Abilities, Morecore classes, Morecore organisation and other with Morecore is not working for export. But other we can export.

I have found the issue here and will have a fix in the next build.

daggerfortysix
August 17th, 2019, 12:31
Hi Damned - I am going to run B01 In Search of the Unknown using your MoreCore ruleset. I have everything from the Rules Cyclopedia already done as a .mod. I am putting ALL monster NPCs into the monster list in my Rules Cyclopedia.mod. I have a rollable table for a random monster encounter (pulling rolled monsters from the Rules Cyclopedia.mod) that is set to output to an encounter. When I roll on that table, the encounter box appears without any NPCs auto populated. I get the following error message: Script Error: [string "scripts/manager_table.lua"]:434: attempt to call field 'addLinkToBattle' (a nil value). I have NO other extensions open other than MCDbD. It works perfect without MCDbD so I think the trouble lies within that .mod. Can you point me in the right direction for a fix?

28502

Thank you

damned
August 17th, 2019, 12:48
I have no idea...
You might have to share a subset of your module with me for testing...

daggerfortysix
August 17th, 2019, 12:58
Can I dm you my .mod file to test with? I have made no changes to MCDbD. I won't be able to to that until several hours for now.

damned
August 17th, 2019, 13:23
Yep. You can prolly find my email address around somewhere too if you look...

daggerfortysix
August 18th, 2019, 15:45
Thanks Damned - Whatever you did worked perfectly!

damned
August 18th, 2019, 16:06
The error was...

\Fantasy Grounds\extensions\MCDbD\common\record_npc.xml


Line 270: NPCManager.getThac0(rActor)
Line 276: NPCManager.setNPCSave(rActor, nHD);

\Fantasy Grounds\extensions\MCDbD\extension.xml


Line 52: <script name="NPCManager" file="common/scripts/npc_more.lua" />

All references to NPCManager should be NPCManager2

I suspect Ive made this error in a few other extensions too...

daggerfortysix
August 18th, 2019, 17:45
Interesting, it is those tiny little guys that are tough to catch. Thanks again!

ShakyLuigi
April 3rd, 2020, 22:54
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:


<?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>

damned
April 4th, 2020, 00:35
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?

ShakyLuigi
April 4th, 2020, 08:36
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.

damned
April 4th, 2020, 08:58
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!

ShakyLuigi
April 5th, 2020, 18:36
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?

damned
April 6th, 2020, 08:23
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.

ShakyLuigi
April 11th, 2020, 13:31
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). 33441

The text shows as "AdvBasic Skills". And I don't understand why.

This is my code for the frame and text:


<!--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>

The same with the "Athl" which should read "Athletics.
Again my code beneath.


<!-- Athletics -->
<string_useredit name="athletics">
<anchored to="art" position="below" offset="0,10" />
<default>Athletics</default>
<tooltip textres="label_editable" />
</string_useredit>

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!

damned
April 11th, 2020, 14:15
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!

damned
April 11th, 2020, 14:30
For the Attack frame - to modify it in the Extension do this:


<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>

Include the whole script section and set your new parameters.

ShakyLuigi
April 11th, 2020, 16:34
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)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.


<<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>

So I used "below" because I thought that this would create a prettier code.

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.

damned
April 11th, 2020, 17:00
I would say - look at the width of Name and Art
The others are inheriting width from there.

Amatiste
April 13th, 2020, 00:53
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?

damned
April 13th, 2020, 02:11
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?

GunbunnyFuFu
April 13th, 2020, 02:31
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

damned
April 13th, 2020, 03:01
Gunbunny

in your extension do something like this:
file \campaign\record_char.xml


<?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>

Amatiste
April 13th, 2020, 03:27
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.
33575
33576

Amatiste
April 13th, 2020, 03:34
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
33579
33580

damned
April 13th, 2020, 06:22
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.
33575
33576

I cant tell for sure - I cant remember when my birthday was...
I believe the file as it exists now in the ruleset (pak) is working and so is the most up to date version.

damned
April 13th, 2020, 06:23
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
33579
33580

I cant see these two attachments - they dont exist on the server.

GunbunnyFuFu
April 13th, 2020, 13:41
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

damned
April 13th, 2020, 14:35
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

Create the file exactly as i posted and inlcude it in extension.xml

GunbunnyFuFu
April 13th, 2020, 14:56
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

damned
April 13th, 2020, 15:10
You might have to copy the whole file from MoreCore and just remove the two sections each for MoreData and Abilities

ShakyLuigi
April 17th, 2020, 10:35
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?

damned
April 17th, 2020, 15:25
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



<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" />


This will delete the frame, delete the heading, delete the list and delete the scrollbar.
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.

Amatiste
April 18th, 2020, 22:44
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.

damned
April 19th, 2020, 01:53
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.

Hola Amatiste

I think that Top Secret would be easily achieved in MoreCore. Holler if you need help.

Amatiste
April 19th, 2020, 02:47
Hola Amatiste

I think that Top Secret would be easily achieved in MoreCore. Holler if you need help.

Will do:) thanks

LordEntrails
April 22nd, 2020, 05:30
Top Secret? Ooh, ah... haven't played that since puberty!

ShakyLuigi
April 22nd, 2020, 20:23
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:


<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:



psrace = {
Interface.getString("Reiklander"),
Interface.getString("Dwarf"),
Interface.getString("Elf"),
Interface.getString("Hafling"),
};

THEN I've added some strings in my string file.


<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>

And now I get the following error:


[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)

I belive the strings are correct as it can find the "ps_default_groupabilty" string and add Reiklander as the default choice.
And now I don't know where to keep on troubleshooting.

EDIT: Just got another error:


[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)

damned
April 23rd, 2020, 01:38
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.

ShakyLuigi
April 23rd, 2020, 11:29
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.

Amatiste
May 5th, 2020, 23:32
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?

damned
May 6th, 2020, 01:18
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?

Its best to replicate the file/folder structure - obviously only include the things you are changing.

BigBadBazz
July 8th, 2020, 09:53
Attached is the extension code up to the end of video five so you can easily access the source files if you cannot follow it completely from the videos.
Note that the manager_custom_thac0.lua and manager_custom_dbdamage.lua are contained within MoreCore and not within the extension.

This may be a basic question but how do I take the ext file and produce the xml and lua files?

damned
July 8th, 2020, 13:44
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.

damned
July 8th, 2020, 13:45
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?

Amatiste I have had a little side fling and made a Top Secret extension.
I will post it very soon and would welcome any feedback.

BigBadBazz
July 8th, 2020, 13:54
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.

perfect

Now the journey begins

BigBadBazz
July 15th, 2020, 14:52
I have followed the first tutorial and displayed my background but get the watermark With a big ID in a circle

How do I remove this

thanks

Barry

damned
July 15th, 2020, 23:23
It is a decal and can be changed or turned off in Options.

Varsuuk
July 17th, 2020, 04:01
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?

I KNEW it would pay off to go through the 9 pages and look for someone asking this ;). I too got up to #5 and the adding of the new roll. I see it is already IN MoreCore so I created a similar one. I am just doing it to work through the examples more than YET as a new roll since haven't planned these yet.

I do not want to add it to MoreCore since I will be updating MoreCore whenever you do and not sure how long will need it to be "live" - thankfully, not being an autoupdate, I can safely just STAY on the old one but figure, rather learn how to do it if can.

I'll wait until finish reading this stuff in case you give tips later. But it would be cool to know how to do in your own thing so we don't risk mucking MC or just getting confused what's where until are "done" and can add it in for reals.

FYI - was asked to do a Char Sheet for White Box. But as part of that, figure learn your thang ;)

Varsuuk
July 17th, 2020, 08:20
I ended up copying the files mentioned in your write up on custom rolls in tutorial 5.

I took out everything that I did not have to modify on the xml and put a merge=“join” on em. There was one I believe (can’t check now) I did a replace.

The lua I copied and assume simply ly reregistering it with same key dumped old one for this (it worked so assume not calling the original. I should check hat make sure didn’t scroll by fast as it printed twice. Pretty sure it was only once).

So far so good, it only had minor changes like accounting for nat 20 vs 20 total (and same for 1) I didn’t go through existing rolls to see if any worked since this was meant for learning mainly.

frostbyte000jm
August 4th, 2020, 17:47
Do you have a repository (or perhaps a git) where you keep the code for these instructional videos?

One of my players wants to learn and I suggested her to start by going through the vids to get a feel for XML and Lua with FG.

damned
August 5th, 2020, 00:07
Hi Jim Im sorry I dont. If you tell me what video I may have the code I can share with you.

damned
August 5th, 2020, 00:08
There are several posts particularly in the first few pages that have code up to a point included in them also.

frostbyte000jm
August 5th, 2020, 02:48
Do you have the final output of that series? She will just have to visually ignore what hasn't been done yet.

Side note: I am thinking of every time I make a change do a video on how I did it. My changes are usually small, but may help someone. The reason I ask is because I build mostly using More Core. So I just wanted to see if you're cool with that.

damned
August 5th, 2020, 03:12
I would be very happy to see you do that.
I think this is the latest build.

lamorric
January 14th, 2021, 22:35
In combat, how does one hide the GM's rolls (as defined on the NPC in the CT Rolls area) from the players in the chat?

damned
January 14th, 2021, 22:54
MoreCore (I believe) respects the option for Show/Hide GM rolls. But I dont think any rolls work with the tower.
I cant be sure without testing - I always have Show GM Rolls on...

lamorric
January 14th, 2021, 23:12
Hm, seems to be something specific to the /edie and /edies rolls.

Here are some examples.
The first 2 rolls use 2 CT Rolls on an NPC, a /myinit roll and a /edies 2d6+4.
Then next roll is a regular old /die 4d6.
The 4th roll is a /edie 7d6.
The last is a /ckill 4d6 roll.

The the right hand chat box starts the GM's desktop, and the left chat is all that is showing from a "local" player's instance of Fantasy Grounds.

42855

damned
January 14th, 2021, 23:20
edie and edies use a variant roll format.
they are older community rolls that we imported with kind permission from their authors
they dont work under the hood the same way as the majority of other MoreCore rolls.
if you are using FGU then /die has some explode options now and there is also a newer MoreCore exploding dice command called /explode
Can you give those a try?

lamorric
January 14th, 2021, 23:38
/explode works as expected (doesn't show in the player chat window).

Now I just need to figure out how to make it count successes. Nooooo problem. :)

Thx for the quick help.

lamorric
January 14th, 2021, 23:51
Is it a "feature" that on the CT the 'Rolls' and 'Attack' areas won't collapse back down when it's the NPC's turn?

This only seems to happen for the NPC, not the player.

damned
January 15th, 2021, 05:15
/explode works as expected (doesn't show in the player chat window).

Now I just need to figure out how to make it count successes. Nooooo problem. :)

Thx for the quick help.

Off the top of my head I would look at the /rk roll - clone it and modify it to count successes instead of keeping the two best results.
Give it a new name and Icon and send it to me and Ill include in the next build.

damned
January 15th, 2021, 05:15
Is it a "feature" that on the CT the 'Rolls' and 'Attack' areas won't collapse back down when it's the NPC's turn?

This only seems to happen for the NPC, not the player.

Maybe... not sure...

lamorric
January 15th, 2021, 15:32
I would be very happy to see you do that.
I think this is the latest build.

I tried this, and the stats frame that was added is overlaying the attacks frame. Appears the attacks frame size is not happening. Any idea what's happening there?

Here is a screenshot.
42862

damned
January 15th, 2021, 23:05
resize the attacks frame using the script at the top of the record_char_more.xml that looks something like this -


<script>
function onInit()
self.onSizeChanged = resizeFrames;
Debug.chat("onInit!");
end

function resizeFrames(sourceWindow)
local nWidth,nHeight = getSize();
Debug.chat("nWidth,nHeight: ", nWidth,nHeight);
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>

lamorric
January 16th, 2021, 01:15
resize the attacks frame using the script at the top of the record_char_more.xml that looks something like this -


<script>
function onInit()
self.onSizeChanged = resizeFrames;
Debug.chat("onInit!");
end

function resizeFrames(sourceWindow)
local nWidth,nHeight = getSize();
Debug.chat("nWidth,nHeight: ", nWidth,nHeight);
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>


Doh!, I had looked at that, but it didn't click.

Thanks!

Cyberlinxz
March 7th, 2022, 20:59
Question: I am working on a ext to basic fantasy and have it all most done it is based off yours with changes on my end but I can not get the exporter to show classes it does work with out the ext that I have but with the ext load it does not show up. I have tried just using the standard class that comes with morecore but that did not seem to help. Any ideas on how to get it add to the exporter please.

Thanks

ps I am using FG classic and the lastest morecore ruleset

damned
March 7th, 2022, 21:53
Hi Cyberlinxz

Please PM me a link to your ext and module and Ill have a look.
Unfortunately I have stopped supporting FGC (just not enough time) but Ill see if I can see what the issue is for you.

Damian

Cyberlinxz
March 7th, 2022, 22:13
Thanks for the quick reply but I found the problem it was in the call name for it
Thanks

Acofis
October 28th, 2022, 08:09
Hi all!

I am getting into some dev on a "The Sprawl" extension. I watched through the tutorials and had asked some relatively uneducated questions in another solo thread. I have since read through this thread and reviewed the videos and source files again. I have gotten to a point where I am not sure what I am missing.

What I have done, in order:


Created a new record for the corporation data in record_entity.xml
Created a file with the icon definition for the sidebar button I desire ( and the string name for the title of "Corperation" called graphics_sidebar.xml
Defined the new record and used the LibraryData.overrideRecordTypes(aRecords) method to add it to the sidebar in data_library_tsb.lua
All 3 of the previous files are defined in extension.xml

The source for all of these file is in 54895


The good news is I get a new sidebar entry and it opens my record! The bad news is that no matter what I do I get the default icon and an empty title as seen here -> 54893

I have no log errors and all of the names or elements appear to match so I am not sure why. The button works despite not having a title. The font override in the same graphics_frames.xml has been applied just fine...

Secondarily:

I have not been able to locate how I go about changing the orientation of the text within the parent frame.
As you can see in this 54894 I have a window with a custom graphic frame for the text entry fields. they all use a template field defined in template_entity.xml that uses <basicft> which is a <simpleft> which is a <formattedtextfield>.

I really want the text to be padded by about 20 to account for the thickness and glow of the frame edges. Offset appears to move the frame around rather than the text.

Thank you in advance for any asstance!

damned
October 28th, 2022, 08:13
Something like this for the offset

<frame>
<name>windowlist</name>
<offset>12,10,12,10</offset>
</frame>

damned
October 28th, 2022, 08:17
Something like this

sidebar.xml


<?xml version="1.0" encoding="iso-8859-1"?>

<root>
<!-- Common ruleset-specific record types -->
<icon name="sidebar_icon_recordtype_ancestry" file="graphics/sidebar/sidebar_icon_A.png" />

<string name="library_recordtype_label_ancestry">Ancestries</string>


</root>


note ancestry is the bit you are looking at here
make sure the icon is white

Acofis
October 28th, 2022, 17:18
Something like this for the offset

<frame>
<name>windowlist</name>
<offset>12,10,12,10</offset>
</frame>

Thanks you! This worked!

I have one remaining issue from a visual standpoint which is my fields are copied from the Worldbuilder and boil down to <formattedtextfield> fields that I am overwriting the config of.

My Template:


<template name="ft_column_labeled_entity">
<basicft>
<font>tsb_basic_font_green</font> <!-- (THIS DOES NOT WORK) -->
<frame mergerule="replace" name="tsb_glow_frame" offset="20,20,20,20" />
<anchored>
<top parent="columnanchor" anchor="bottom" relation="relative" offset="7" />
<left offset="105" />
<right offset="-40" />
</anchored>
</basicft>
</template>


Which is modifying basicft from CoreRPG\common\template_common.xml:


<template name="basicft">
<simpleft>
<frame mergerule="replace" name="fielddark" offset="7,5,7,5" hidereadonly="true" />
<stateframe>
<keyedit name="fieldfocus" offset="7,5,7,5" />
<hover name="fieldfocus" offset="7,5,7,5" hidereadonly="true" />
<drophilight name="fieldfocus" offset="7,5,7,5" hidereadonly="true" />
</stateframe>
</simpleft>
</template>


Which is modifying stringft from CoreRPG\common\template_common.xml:


<template name="simpleft">
<formattedtextfield>
<script>
function onInit()
registerMenuItem(Interface.getString("button_import_clean_text"), "radial_magicwand", 8);
end
function onMenuSelection(selection, subselection)
if selection == 8 then
setValue(ImportUtilityManager.cleanUpText(getValue ()));
end
end
</script>
</formattedtextfield>
</template>


I cannot modify the font and cannot find a definition for the <formattedtextfield> to go any further into what the definition for font is inside the tag.

My question is two fold.


Why does the font assignement in my template no appear to effect the fonts within those fields?
Is there a better field to be using here? I really just want a field that can have multiple lines text and/or links I have draggeed in from another window. Any editable field that does that is fine with me I am just not sure what fields exist and what they do by default. I am only using this template because that is how Worldbuilder was defined and I used it as a base for my record.


Edit - I have since figured out that this field is, like many others, governed by the "defaultstringcontrol" font definition, however I am still curious how one might overwrite that in a tag for a one-off font for a specific record.

Acofis
October 28th, 2022, 17:51
Something like this

sidebar.xml


<?xml version="1.0" encoding="iso-8859-1"?>

<root>
<!-- Common ruleset-specific record types -->
<icon name="sidebar_icon_recordtype_ancestry" file="graphics/sidebar/sidebar_icon_A.png" />

<string name="library_recordtype_label_ancestry">Ancestries</string>


</root>


note ancestry is the bit you are looking at here
make sure the icon is white

Thanks for the fast reply!

I am not sure what you mean by make sure the icon is white?

To the rest of your reply... as far as I can tell I have this in place in the same manner described.

I have a sidebar definition:


<!-- The Sprawl Basic -->
<icon name="sidebar_icon_recordtype_entity" file="graphics/sidebar/sidebar_icon_treasureparcel_2.png" />
<icon name="button_entity_down" file="graphics/sidebar/sidebar_dock_entry_down.png" />

<string name="library_recordtype_label_entity">Corporations</string>


I have a lua file that creates a record that is supposed to use this data:


aRecords = {

-- New record types
["tsb_entity"] = {
-- bExport = true,
-- sEditMode = "gm",
sDisplayText = "library_recordtype_label_entity",
aDataMap = { "tsb_entity", "reference.tsb_entity" },
aDisplayIcon = { "sidebar_icon_recordtype_entity", "buton_entity_down"},
fToggleIndex = toggleCharRecordIndex,
sRecordDisplayClass = "tsb_entity",
},
};


function onInit()


LibraryData.overrideRecordTypes(aRecords);
end


I am getting the sidebar entry but everything is default (icon and empty title field). As far as I can tell the text and icon definition names match.

My ext file defines all of the files that are in use and every part of this appears to work other than the icon and text setting. (I also do not get a title on the entity list that pops up when you click the button but I have not looked into why yet but I am hoping it is the same text field I am not getting for the sidebar button)


<base>
<!-- Tabletop settings -->
<includefile source="graphics/graphics_frames.xml" />
<includefile source="graphics/graphics_fonts.xml" />
<includefile source="graphics/graphics_icons.xml" />
<includefile source="graphics/graphics_sidebar.xml" />


<!-- Templates -->
<includefile source="campaign/template_entity.xml" /> -->

<!-- Entity (Corp or Threat) Settings -->
<includefile source="common/record_entity.xml" />


<!-- Strings -->
<includefile source="strings/strings_tsb.xml" />

<!-- Scripts - Sidebar -->
<script name="DesktopManagerTSB" file="scripts/data_library_tsb.lua" />
<!-- <script name="EntityMainTSB" file="campaign/scripts/entity_main_tsb.lua" /> -->

<!-- Scripts - Character Sheet -->
<!-- <script name="CharacterUpdate" file="scripts/manager_dbd.lua" /> -->
</base>




I never use DesktopManagerTSB but I assume the init() is run when this script is included (the record exists so I assume that is how this works).
Both icons exist already in morecore or corerpg and exist in each graphics/sidebar folder structure respectively.
String is explicipy defined so I am not sure how that is not getting to the sidebar unless something in my lua is silently failing.
I have no console errors or warnings about not finding files so I assume the icons, strings, and source files are being included as expected



I am sure there is a straightforward reason this is happening I am just not seeing it and another set of eyes would be great!

Also, is there an good way to make debug statements to test some of this stuff in the FGU console?