Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Redcap's Corner
Senior Member
 
Join Date: Jul 2010
Posts: 149

Old December 1st, 2014, 05:09 PM
I have two class special abilities: cEnsEnsp and cEnsSpForm. cEnsEnsp has an array with a checkbox (field: usrIsCheck). cEnsSpForm has a normal activation checkbox (field: abilActive). Everytime a user selects one of these abilities, I want it to deselect the other. In other words, if hero.child[cEnsEnsp].field[usrIsCheck].value = 1 then hero.child[cEnsSpForm].field[abilActive].value = 0, and vice versa.

I'm using the following code for cEnsEnsp:

Code:
doneif (field[usrIsCheck].value = 0)
hero.child[cEnsSpForm].field[abilActive].value = 0
trustme
And I'm using the following code for cEnsSpForm:

Code:
doneif (field[abilActive].value = 0)
hero.child[cEnsEnsp].field[usrIsCheck].value = 0
trustme
And I'm getting the following error: "Only derived fields can generally be modified via scripts". Am I using "trustme" incorrectly? How can I get this to work?

Mind you, I don't want selecting one ability to disable the other, merely deselect it. It's possible to use neither of these abilities, but it's not possible to use both of them simultaneously, so I can't just use a single checkbox that toggles the two abilities. But if each one disables the other, then the user has to deselect one before he or she can select the other, and I want to reduce the number of clicks the user has to make.
Redcap's Corner is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old December 1st, 2014, 05:29 PM
In that case, I'd recommend just writing an eval rule that complains if the user turns on both, and write your scripts such that if one is turned on, the other one will not apply its effects - one of them says:

doneif (hero.child[the other one].field[whichever].value <> 0)

If you do want to do it this way, ask yourself - at the time in the execution of the script that it tries to alter the user-controlled field, is this a trusted script?

Also, be very careful of timing - if the user checks the other one, are your timings set up such that the fact that the other is still on won't disable this new one? That kind of weirdness is one of the reasons we don't usually do this sort of thing.
Mathias is online now   #2 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 07:38 AM.


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