PDA

View Full Version : Question about the copy= attribute on <windowclass>



darrenan
February 10th, 2024, 17:09
I see that CoreRPG is using this syntax in a lot of places:


<windowclass name="ability" copy="record_window_text">

My question is how is copy="<windowclass name>" different from merge="join"? When is it appropriate to use one vs. the other?

I can't find any references to copy= in the developer wiki, might be useful to add it here https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996645644/windowclass or here https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644522/Ruleset+-+Layering

Thanks.

mccartysr
February 10th, 2024, 18:48
Marge is used to modify the window class and everywhere it is used. Copy is used to make a copy that you can then make changes to without modifying the original.

superteddy57
February 10th, 2024, 20:46
I see that CoreRPG is using this syntax in a lot of places:


<windowclass name="ability" copy="record_window_text">

My question is how is copy="<windowclass name>" different from merge="join"? When is it appropriate to use one vs. the other?

I can't find any references to copy= in the developer wiki, might be useful to add it here https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996645644/windowclass or here https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644522/Ruleset+-+Layering

Thanks.

the "copy" flag is like using another windowclass like a template. The ability windowclass will be it's own, but be built using record_window_text as a base. There is no documentation as it's still fairly new and still being checked over. Remember that the copied windowclass needs to be declared prior to it being copied.

Moon Wizard
February 11th, 2024, 00:14
The copy="" attribute will copy the specified windowclass at that point in the load process; and then apply any further definitions as modifications to that copy. As @superteddy57 mentions, it is a newer capability that we are just now using in full force in the CoreRPG layer, and more in the next update.

Regards,
JPG

darrenan
February 11th, 2024, 01:12
I think I understand, thanks.

peterb
April 19th, 2024, 11:50
I noted that this feature is also used in the Basic Roleplaying ruleset. For example in ct/ct_host_entry_section.xml the windowclass npc_hitlocations is copied to ct_hilocations. But, this is done after the windowclass is used. Does this means that the windowclass doesn't need to be declared prior to being copied anymore?

Also, for clarification, any functions in the script element are added to the windowclass, or overloaded if the name is the same?

Moon Wizard
April 19th, 2024, 16:44
It does need to be defined before being copied. If an attempt to copy is done before being defined, an error will be thrown during ruleset load.

If you look in base.xml for BRP, record_npc.xml is being included before ct_host_entry_section.xml.

Regards,
JPG

peterb
April 21st, 2024, 14:55
It does need to be defined before being copied. If an attempt to copy is done before being defined, an error will be thrown during ruleset load.

If you look in base.xml for BRP, record_npc.xml is being included before ct_host_entry_section.xml.

Regards,
JPG

Aha. OK, now I see, thanks for the answer.