Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
When a boolean state is being used (e.g. show/hide, enable/disable), a value of zero always means "no" and non-zero value means "yes". Therefore, setting the visibility to zero means to *not* show it. If you want to force something to be always visible, you need to use a non-zero value (generally one). In the case of portals, they are always visible unless you specify otherwise, so you can simply comment out the entire if/then block to ensure the portal is always visible. As it stands, you are explicitly hiding the portal all the time. :-(
|
#21 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
Quote:
|
|
#22 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
Quote:
|
|
#23 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
Quote:
It's a racial bonus, and I thought that should be adding to the Bonus field instead of the Final value. It works, and displays properly, but I'm not sure how it'll impact things down the road.. Thanks. I really appreciate the help. P) |
|
#24 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
I'm getting frustrated.
Everything I see says that the below code should show the menu on the Adaptable Edge. It doesn't however and I don't know what I'm missing... Code:
<thing id="reQuick" name="Quickness" compset="Reaction" isunique="yes" description="Description goes here"> <fieldval field="reaAbbrev" value="Qui"/> <tag group="explicit" tag="1"/> <tag group="DashTacCon" tag="Combat"/> <tag group="RAbil" tag="Adaptable"/> <eval index="1" phase="Traits" priority="6000"> <![CDATA[ ~Quickness uses the better of the character's Perception or Agility var mod1 as number var mod2 as number mod1 = hero.child[attrPer].field[trtMod].value mod2 = hero.child[attrAgi].field[trtMod].value field[reaBonus].value = maximum(mod1,mod2) ~field[reaBonus].value = maximum(#traitbonus[attrPer],#traitbonus[attrAgi]) ]]></eval> </thing> <thing id="abAdapt" name="Adaptable" compset="RaceAbil" isunique="yes" description="Description goes here"> <fieldval field="usrCandid1" value="RAbil.Adaptable"/> <tag group="Hide" tag="Ability"/> <tag group="Hide" tag="RaceAbil"/> <tag group="ChooseSrc1" tag="Hero"/> <!-- Bootstrap Choose either Sta, Qui, Wil for a +2 bonus --> </thing> <template id="raPick" name="Racial Ability Pick" compset="RaceAbil" marginhorz="3" marginvert="2"> <portal id="name" style="lblNormal" showinvalid="yes"> <label field="name"> </label> </portal> <portal id="menu1" style="menuSmall"> <menu_things field="usrChosen1" component="none" maxvisible="10" usepicksfield="usrSource1" candidatefield="usrCandid1"> </menu_things> </portal> <portal id="info" style="actInfo"> <action action="info"> </action> <mouseinfo/> </portal> <portal id="delete" style="actDelete" tiptext="Click to delete this item"> <action action="delete"> </action> </portal> <position><![CDATA[ ~set up our height based on our tallest portal height = portal[info].height ~if this is a "sizing" calculation, we're done doneif (issizing <> 0) ~determine whether our menus are visible ~Note: Remember that a non-empty tagexpr field indicates menu selection is used. ~if (field[usrCandid1].isempty <> 0) then portal[menu1].visible = 1 ~ endif ~position our tallest portal at the top portal[info].top = 0 ~center the other portals vertically perform portal[name].centervert perform portal[delete].centervert perform portal[menu1].centervert ~position the delete portal on the far right perform portal[delete].alignedge[right,0] ~position the info portal to the left of the delete button ~perform portal[info].alignrel[rtol,delete,10] ~position the menus to the left of the info in the available space perform portal[menu1].alignrel[rtol,info,10] portal[menu1].width = (portal[info].left - portal[menu1].left - 20) / 2 ~position the name on the left and use availble space, with a gap for menus portal[name].left = 0 portal[name].width = minimum(portal[name].width,portal[menu1].left - portal[name].left) portal[name].width = 50 ~if the ability is auto-added, change its font to indicate that fact if (candelete = 0) then perform portal[name].setstyle[lblAuto] endif ]]></position> </template> |
#25 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
Quote:
In your Position script, the following two lines control the positioning of the menu: Code:
perform portal[menu1].alignrel[rtol,info,10] portal[menu1].width = (portal[info].left - portal[menu1].left - 20) / 2 Take things in *small* steps. First, get everything showing in crude fashion in your tables. Then start tweaking the sizing and positioning of individual portals. It will take a little bit longer this way, but you'll get the hang of things quickly and it will avoid frustrations like this situation. Once you start getting proficient, you can then begin cutting corners, but you'll be able to spot issues like this more readily when they occur, so it won't be frustrating. :-) |
|
#26 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
Thanks Rob!
You know... that helped.. and also me realizing that I had ~two~ templates in the tab and was using the wrong one... That'll teach me. On the plus side, I can now select the Reaction used by the ability and have it properly bonused. I'm going to be entering the list of edges and flaws, but probably not going for any mechanics with them just yet. My biggest hurdle ahead is the skill selection process. I'll get as far as I can before then though... I really do appreciate all the help with this so far. |
#27 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
I've made some progress, but ran into a glitch. I'm trying to change all the resAbility references to resEdge to account for the trait.
When I think I've got them all found and the code compiles and reloads, this pops up: Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_' - - - Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_' - - - Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_' - - - Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_' - - - Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_' - - - Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_' - - - Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_' - - - Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_' - - - Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_' - - - Attempt to use an 'additem' script within a table with no valid 'addthing' for portal '_tableadd_' The Abilities tab shows ???? on the selection area for Edges. What am I missing? Thanks! |
#28 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
Well, it helps to use the right pick resource... had resAbility (which I'd deleted) instead of resEdge...
on another note, I'm trying to do a chooser to pull all skills with a value >= 2 into the list. I tried: <fieldval field="usrCandid1" value="component.Skill & fieldval:trtFinal >= 2"/> but I get the following error. Any suggestions? |
#29 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
The '&' character has special meaning within XML, just like it does in HTML. When you use a "CDATA" block for a script, it tells XML to treat everything as raw text. However, within an attribute value, the character always has special meaning. That's why the error says that the character '&' is a problem.
You need to use the special code for the '&' character, which is "&". The '&' is followed by the letters "amp" and then finished with a semi-colon. All five characters are required. This results in the following XML element: Code:
<fieldval field="usrCandid1" value="component.Skill & fieldval:trtFinal >= 2"/> http://hlkitwiki.wolflair.com/index.php5/XML_Files |
#30 |
|
|