• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Problems with image_field.

barrelv

Well-known member
so I'm trying to swap images based on my attribute values. When I compile, I keep getting the following error message:
Hero Lab was forced to stop compilation after the following errors were detected:
Portal 'health' - Reference to incompatible field type/style/behavior on portal type

Here's my code:

traits.str
Code:
    <!-- Health image name -->
    <field
      id="attImage"
      name="Image"
      type="derived">
    <!-- Determine this value based on the current value of the attribute -->
      <calculate phase="Traits" priority="3001" name="Calc attImage"><![CDATA[
        ~Note! Happens immediately after we get the final value of the related stat
        var image as string
        image = field[trtAbbrev].text & "-" & field[trtFinal].value & ".bmp"
        debug "Attribute Value" & image
        @value = image
        ]]></calculate>
      </field>

tab_basics.dat
Code:
    <portal id="health" style="imgNormal">
      <image_field field="attImage" istransparent="yes"/>
    </portal>
 
This is not a method that will work. Image portals in HL need to be for specific images, and can't be set on the fly through scripts.
 
I recommend leaving this sort of "nice-to-have" thing - making it pretty, until last - get it working first.
 
Back
Top