PhoeNox
December 7th, 2020, 21:51
Hello everyone,
I'm just getting into scripting my own extension and need some help with a (hopefully) fairly simple question.
The goal is to provide a "character template", so that when you create a new character and open the character sheet for the first time, it already has some meaningful values at some places.
However, I cannot find an event or handler that gets executed on exactly this trigger.
I found that by extending the charsheet windowclass and hooking into onInit(), I can run code the first time a charsheet is created in a session. However, that code would also be executed when opening the character in the next session.
<?xml version="1.0" encoding="iso-8859-1"?>
<root>
<windowclass name="charsheet" merge="join">
<script>
function onInit()
super.onInit();
Debug.console("This works");
end
</script>
</windowclass>
</root>
So my question is: What event/handler/hook/trigger can I use to run code exactly when a character is created?
Or am I going about this all wrong and should do it in a completely different way?
Cheers
PhoeNox
I'm just getting into scripting my own extension and need some help with a (hopefully) fairly simple question.
The goal is to provide a "character template", so that when you create a new character and open the character sheet for the first time, it already has some meaningful values at some places.
However, I cannot find an event or handler that gets executed on exactly this trigger.
I found that by extending the charsheet windowclass and hooking into onInit(), I can run code the first time a charsheet is created in a session. However, that code would also be executed when opening the character in the next session.
<?xml version="1.0" encoding="iso-8859-1"?>
<root>
<windowclass name="charsheet" merge="join">
<script>
function onInit()
super.onInit();
Debug.console("This works");
end
</script>
</windowclass>
</root>
So my question is: What event/handler/hook/trigger can I use to run code exactly when a character is created?
Or am I going about this all wrong and should do it in a completely different way?
Cheers
PhoeNox