View Single Post
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old October 10th, 2013, 06:29 AM
Quote:
Originally Posted by Mathias View Post
The M/P/S options in WoD are handled with trigger buttons.
Mathias,

I was able to deduce that from the ui_styles file, but I'm struggling with the scripting for the actual trigger.

I set up the top row as a table_fixed in a template, and am trying to get the control work for Primary / Secondary swap of dots working. Here is what I've come up with so far:

Code:
    <portal
      id="swapPS"
      style="actSwap"
      tiptext="Click here to swap Primary and Secondary dots.">
      <action
        action="trigger">
        <trigger><![CDATA[
          if (hero.child[cPhysical].field[cmaximum].value = herofield[acPrimAttr].value) then
            if (hero.child[cSocial].field[cmaximum].value = herofield[acSecoAttr].value) then
              hero.child[cSocial].field[cmaximum].value = herofield[acPrimAttr].value
              hero.child[cPhysical].field[cmaximum].value = herofield[acSecoAttr].value
            elseif (hero.child[cMental].field[cmaximum].value = herofield[acSecoAttr].value) then
              hero.child[cPhysical].field[cmaximum].value = herofield[acSecoAttr].value
              hero.child[cMental].field[cmaximum].value = herofield[acPrimAttr].value
              endif

          elseif (hero.child[cSocial].field[cmaximum].value = herofield[acPrimAttr].value) then
            if (hero.child[cPhysical].field[cmaximum].value = herofield[acSecoAttr].value) then        
              hero.child[cPhysical].field[cmaximum].value = herofield[acPrimAttr].value
              hero.child[cSocial].field[cmaximum].value = herofield[acSecoAttr].value
            elseif (hero.child[cMental].field[cmaximum].value = herofield[acSecoAttr].value) then        
              hero.child[cMental].field[cmaximum].value = herofield[acPrimAttr].value
              hero.child[cSocial].field[cmaximum].value = herofield[acSecoAttr].value
              endif

          elseif (hero.child[cMental].field[cmaximum].value = herofield[acPrimAttr].value) then
            if (hero.child[cPhysical].field[cmaximum].value = herofield[acSecoAttr].value) then  
              hero.child[cPhysical].field[cmaximum].value = herofield[acPrimAttr].value    
              hero.child[cMental].field[cmaximum].value = herofield[acSecoAttr].value
            elseif (hero.child[cSocial].field[cmaximum].value = herofield[acSecoAttr].value) then
              hero.child[cSocial].field[cmaximum].value = herofield[acPrimAttr].value
              hero.child[cMental].field[cmaximum].value = herofield[acSecoAttr].value
              endif
            endif 

            
          ]]></trigger>
        </action>
      </portal>
The code doesn't work correctly. It swaps out the dots but nothing on the interface changes, and if you start adding dots to the attributes themselves it switches back to whatever the starting definition for the dots is set to.

RavenX Pronouns: She/Her

Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you.

I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all.
RavenX is offline   #10 Reply With Quote