• 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

Help with Script

sincla

Well-known member
I'm getting a syntax error on the output line (@value = ) of the following script, with the message "Error parsing parameter 3 of function". Might anyone know why?

Code:
<calculate phase="Setup" priority="1000" name="Calc Bonus">
	   <after name="Level final"/><![CDATA[

	   var level as number

	   level = hero.tagvalue[Level.?]

	   @value = 1 + round(level / 4, 0, +1)

	   ]]></calculate>
 
Code:
<thing
    id="drgBrthTyp"
    name="Breath Type"
    compset="RaceFeat"
    description="Choose the type of damage your breath weapon causes.">
    <fieldval field="usrSelect" value="Fire"/>
    <arrayval field="usrArray" index="0" value="Acid"/>
    <arrayval field="usrArray" index="1" value="Cold"/>
    <arrayval field="usrArray" index="2" value="Fire"/>
    <arrayval field="usrArray" index="3" value="Lightning"/>
    <arrayval field="usrArray" index="4" value="Poison"/>
    
    </thing>

I'm trying to incorporate the above racial feature from the 4th edition files into my race choices. It is properly bootstrapped to the relevant race. However, no drop down menu based on the array appears in the Race tab to make a selection. The power name does appear in the summary window and the Special tab as the default: "Breath Type: Fire". I've successfully set up thing-based racial feature menu selections using tag expressions for usrCandid1 for other racial abilities. I'm not sure what I'm doing differently between the two methods such that the array menu in this case is not visible, but the thing-based menu in the other case is. Am I making another stupid mistake? Thanks.
 
BUT I still don't understand why for an array-based menu I need to attach the ConfSource.Race tag (I'm working with the 4th edition data files), but for a thing-based menu specificed with a tag expression in usrCandid1 I did NOT need to, even though the table element clearly has a list element specifying that I must have that tag.
 
Do you know anything about d20? When I go to the downloaded d20 data files, all I see for source are .dat files, no .def or structure files. Where are they?
 
Do I need to buy the license for d20 to get the pkg files? I mean, what do I have to do to see the source code in .pkg files.
 
pkg files are like a zip file, you can't access the stuff in them (and they can't be unzipped) I don't believe you can get access to that stuff from the D20 system
 
Damn, it would have been really helpful to me to see how they are structured. But I guess I understand it it's proprietary stuff. But one wonders then how the community creates open source material for d20 if they don't know how the basic files are structured and specified.
 
The wiki says that the intersect reference is the following format:

Code:
intersect[init,curr]

where in a validate script the tags in the group init belong to the initial context, that is the prospective container for a thing, and the curr gives you the tags in the alternate context which is the thing that might be added (as a pick).

But, it seems that this is exactly backwards in many instances in actual code I've seen. For example:

Code:
altthing.intersect[ReqClass,Class]

where the script is comparing the required class to wield the thing to be added (ReqClass) which resides on the altthing, and seeing if that intersects with a Class tag on the hero.

Which is the correct syntax?
 
Still could use an answer on this...anyone know if the wiki has the context parameters in the square brackets exactly backwards?
 
After looking at the code, it looks like you're right - the first parameter is the tag group to look at in the context you've just transitioned to, while the second parameter is the tag group to look at in the overall context for the script.

Thanks for flagging this! I'll update the documentation appropriately.
 
Please do a quick double check of my source. I got the above code snippet from the 4e data files, components.core, the Requires component, which is full of validate scripts like these.
 
Hi Colen,

I'm now getting an incomprehensible "Portal 'level" - Reference to incompatible field type/style/behavior based on portal type" for the following portal element:

Code:
	<portal
      id="level"
      style="lblNormal"
      showinvalid="yes">
      <label>
		  <labeltext><![CDATA[
		    @text = "hello world"
		    ]]></labeltext>
		</label>
	</portal>

Thing is I didn't change anything at all about it to cause the error. The only thing I tried was to change the text output to a simple string to see if even that would work, and it doesn't.
 
Back
Top