PDA

View Full Version : FGU: Extension not working?



Weltenbrand
September 26th, 2020, 11:23
I'am writing an extension for a ruleset I'am developping.
I want to join (or replace) the script for a window control.

Code in the ruleset:


<root>
<windowclass name = "window_talente">
[...]
<sheetdata>
[...]
<windowlist name = "liste">
<anchored>
[...]
</anchored>
<class>liste_normaletalente</class>
<sortby>
<control>name</control>
</sortby>
<script file = "campaign/character/talente/scripts/script1.lua"/>
<allowdelete/>
</windowlist>
</sheetdata>
</windowclass>
</root>

I want to join or replace the script of the window list in the extension:


<root>
<windowclass name = "window_talente" merge = "join">
<sheetdata>
<windowlist name = "liste">
<script file = "campaign/character/talente/scripts/script2.lua" merge="join"/>
</windowlist>
</sheetdata>
</windowclass>
</root>

This seems to do nothing. "window_talente" behaves like so ruleset verion.
For a test I tried to delete the window_talente with:

<windowclass name = "window_talente" merge = "delete"/>
Which should produce a class not found error in my understanding, but the original window is loaded.
This makes me guess that the extension is not loaded correctly even if no error/warning is shown.

extension.xml:

<root version="3.2">
<properties>
<name>Addon: Talentlisten</name>
<description>Talentlisten für das DSA4 Rulseset von der DZ</description>
<ruleset>
<name>DasSchwarzeAuge4DZ</name>
</ruleset>
</properties>
<version>0.1</version>
<base>
<incluefile source="campaign/character/talente/window_talente.xml"/>
</base>
</root>


Any idea what I'am doing wrong?

Moon Wizard
September 26th, 2020, 18:36
* Have you loaded the extension on the launch screen for your test campaign?
* Are there any errors in the console?

When I'm not sure if a script is loading, I will usually add a global script with a Debug.console() statement in the onInit function in order to verify loading.

Regards,
JPG

Weltenbrand
September 26th, 2020, 20:13
I get no errors in the console and get the extension loaded message.

This code gets executed:


<script name="Test">
function onInit()
Debug.console("Extension loaded")
end
</script>

Moon Wizard
September 27th, 2020, 06:16
In window classes, the merge attribute is meant to be usedor specifying at the windowclass level, and at each control level; not within the controls. The one you have on the script tag for the windowclass merge will just be added to the existing control (which means that it gets layered, I believe). So, the underlying script functions will still be there, but can be overriden by your script.

Regards,
JPG

Weltenbrand
September 27th, 2020, 06:30
Layering the script would be great. But this does not happen.
Only the original script is executed für the windowlist.
Basically nothing happens if I try to merge windowclasses or windocontrols.

Best Regards

Moon Wizard
September 27th, 2020, 06:51
Without an example extension that I can use to step through and test, I don't know what is happening or not happening.

I'm not familiar with DSA nor can I speak German; is there a way to make a sample for CoreRPG that has the same issue?

Regards,
JPG

Weltenbrand
September 27th, 2020, 07:14
It is not specific to DSA.

In my understanding these files should draw a box over the charsheet.
But nothing happends.

Trenloe
September 27th, 2020, 10:17
It is not specific to DSA.

In my understanding these files should draw a box over the charsheet.
But nothing happends.
Two typos:

1) extension.xml: <incluefile source="campaign/box.xml"/> should be includefile
2) box.xml: <backcoloer>#FFFFFF</backcoloer> should be <backcolor>

Weltenbrand
September 27th, 2020, 10:59
Oh ...
I will look at this when I get home.
If this is the error I am really sorry.

... several days for finding a d -.-'.