Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   Closing the form doesn't trigger evaluation (http://forums.wolflair.com/showthread.php?t=67789)

agermosh May 4th, 2023 01:29 PM

Closing the form doesn't trigger evaluation
 
I implemented the form to parametrize the class skill and it is working ok
with one exception - after done editing and closing the form with "ok"
button evaluation cycle is not started. So, all parameters controlled by
form are changed as expected (I see new values in debug window),
but derivatives, calculated by ability evaluation scripts remain the same.
If I trigger the evaluation by changing any other thing (like reducing the
ability) scripts are working ok.
Any suggestions?

Dami May 4th, 2023 11:01 PM

In most cases after editing, you need to "test now" and you might also need to reload the system in order for your edits to occur.
If you don't see changes unless you modify something (and cause a recalculation) then maybe the timing on your script is wrong.
Can you provide code for what you are doing?

agermosh May 5th, 2023 01:11 PM

It is not about editor changes - it is a form for ability parametrization
in HL itself. Code is bulk. Skeleton looks like this:
Ability:
<thing id="cMoonMagic" name="Moon Magic">
<eval phase="Final" priority="10100"><![CDATA[...
<child entity="gMoons"></child>

Gizmo:
<entity id="gMoons" form="pMoons">

Form:
<template id="Moons" name="Moons" compset="ClSpecial">

<layout id="lMoons">
<portalref portal="MoonsTitle"/>

<panel id="pMoons" name="Moons of Krynn" entity="gMoons">
<layoutref layout="lMoons"/>

Form modifies several value field, script generates name and assign bonuses to the hero.

Mathias May 5th, 2023 01:44 PM

What was the purpose of creating a new form? At first glance, this seems like something that would work with a configurable, and maybe a mechanic to bootstrap it, if this is an all-PC thing.


Please give us more information about what's going on, so we can help answer the question of why it's not working - like your statement that "form modifies several value field" has no details included, but that's my guess as to the most likely location for the problem.

agermosh May 5th, 2023 02:19 PM

2 Attachment(s)
I created an embedded moons tracker for Dragonlance Wizards of High Sorcery class.
You can see attachments to see how it looks like.
So form remembers moons positions in abValue-abValue3 fields and ability script calculates and applies bonuses/penalties.
So, after closing the form I see expected values in abValue-abValue3, but no calculations done.
After I trigger evaluation manually - everything is working as it should.
Question is - why closing the form doesn't trigger re-evaluation?

Mathias May 5th, 2023 02:47 PM

How are you storing the values the user sets for the vaValue fields? What user fields store the values used to calculate the vaValue field values?

abValue, abValue2, etc. are derived - their values are thrown away at the beginning of each new calculation cycle, and re-calculated according to whatever scripts modify them (actually, there's also some time-saving logic to determine whether any of the input values changed, and therefore whether the script needs to be re-run or the last calculation's results can just be used, but the effect is the same for this purpose).

agermosh May 5th, 2023 03:11 PM

I see - thanks..
It looks like there is a difference between full evaluation and fast one.
Full evaluation reset my tracker as you said. Fast one keep abValues intact..

So, it seems I need different place to store values. Any suggestions here?
Probably some usr* fields?

Mathias May 5th, 2023 03:17 PM

Just curious, in the Develop menu, do you have enable data file debugging turned on? I'm really surprised that it didn't give you an error message for trying to build an incrementer out of a derived field, and I know if you don't have the debugging turned on, it suppresses a lot of errors.


I would go by field names within the debugger, not by Ids.

agermosh May 5th, 2023 03:24 PM

Data file debugging is enabled - yes

agermosh May 5th, 2023 03:44 PM

I didn't use incrementer actually, because there only one user field it can be connected to - usrIndex.
I need three, so I used custom buttons instead.


All times are GMT -8. The time now is 10:58 AM.

Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.