• 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

Validation problems..where to start?

Bluefool

Well-known member
OK, trying to get some validation written in, and I seem to be missing something, and searching the docs (online search) didn't seem to come up with the answer...

If I write a tagis[template] expression, how *eaxctly* do I define [tempalte]? I've tried copying rules form other data sets, and copying the tag set on the unit, but I can not seem to get tagcount, tagis, etc to recognize what template I am refering to. Can someone point me to a doc section on this?

And, please don't point me to the script basics, I've read them, as well as all hyperlinks to anything involving scripts, if its in there I didn't understand it.
 
the format is the name of the tag group, a dot then the name of the tag. If you have a tag group called kitCheck and a tag within it called rifles then the reference would be kitCheck.rifles

What error are you getting - is the rule not triggering or are you gettng an error about incorrect reference to a tag?
 
if you look in the pdf document for the ABC then it starts on page 107, section called manipulating tags
 
The rule just isn't firing. I can force an invalid using an example from the sample data file, but even ripping off the syntax from another data file, I can't seem to get it to provide an invalid result on the expression. I'm fairly certain it will get resloved with my nose in the book in the right place for a bit.

Perfect, thanks for the page refrence! I printed out the PDF, and its getting dog eared fast...yet another tab about to go into it.....

OH, and a random thanks for the folks on the board; I've got my data file I would say at 60%, so its coming along.
 
if u can post more detail with some examples you'll prob find some-one on here will b able to assist with it :)
 
Sample

OK, going through the manual, it seems I'm doing this right, so I suspect I'm missing something stupid.

What I'm trying to do is, units with the tag [uct.arbb] are supposed to be 0-2.

if (tagcount[uct.arbb] > 2) then

@valid=0

else

@valid=1
endif

Is the rule I'm trying to use. But, after compiling, and switching to that game system, I can dump as many of that unit onto the roster as I want.

Also tried this:

if (tagcount[uct.arbb] <= 2) then
@valid = 1
endif

Still lets me dump them in endlessly.
 
Have you set that tag group to be global? The Validation won't pick it up
otherwise.

Richard



--- Bluefool <jeff_kraemer@msn.com> wrote:

> OK, going through the manual, it seems I'm doing this right, so I suspect I'm
> missing something stupid.
>
> What I'm trying to do is, units with the tag [uct.arbb] are supposed to be 0-2.
>
> if (tagcount[uct.arbb] > 2) then
>
> @valid=0
>
> else
>
> @valid=1
> endif
>
> Is the rule I'm trying to use. But, after compiling, and switching to that
> game system, I can dump as many of that unit onto the roster as I want.
 
Wahoo!

See? Once again proving that rather than get frustrated, you should ask.

That was exactly it, it now works.

You can have my first born, or unending gratitude, your choice ;).
 
have u tried it with an accumulated tag or set the rule to be roster based - it is just there are a lot of warnings about overheads with global tags.

the other thing to try maybe a merge rule - those a re really really useful as it can be applied to other units etc which you may want to limit, i.e. one rule can cover all of them
 
Rob has mentioned in the past that global tags are best avoided unless you've got no other choice, accumulated tags are preferred.

They're your datafiles though, so do what you like :-)
Thats the great thing about writing your own data files for AB!

Russell.
 
My mistake. At work, so don't have my files or the documentation so was going
from memory... Accumulated was the word I was after, not global. Sorry about
the confusion :(
 
There is a chapter dedicated to everything about how to use tags. From the main page of the Kit documentation, scroll down to the section entitled "Authoring Technologies" and the first link therein will be "Tags and Tag Expressions". Check there for everything you could ever want to know about manipulating tags.

There are numerous sections on writing validation rules. Most importantly, see the "Applying the Concepts" link from the main page of the Kit docs. There are critical details about writing validation rules and scripts in this chapter. You'll find many additional tidbits on rules in the chapter tied to the "Tips and Tricks" link.

Hope this helps,
Rob



At 09:25 PM 1/24/2006, you wrote:

OK, trying to get some validation written in, and I seem to be missing something, and searching the docs (online search) didn't seem to come up with the answer...

If I write a tagis[template] expression, how *eaxctly* do I define [tempalte]? I've tried copying rules form other data sets, and copying the tag set on the unit, but I can not seem to get tagcount, tagis, etc to recognize what template I am refering to. Can someone point me to a doc section on this?

And, please don't point me to the script basics, I've read them, as well as all hyperlinks to anything involving scripts, if its in there I didn't understand it.
 
Make sure to leverage the debugging aids that are built into AB. They will greatly speed up data file writing by letting you quickly determine where things are failing. For example, in the situation below, you are writing a rule with "roster" scope, so you could view all the tags for the roster and see that the tags you are testing for are not showing up in the debug list. This will confirm that the problem is NOT with the rule script and actually in getting the tags to show up at the "roster" level. If the tags DID appear, then you would know the problem was in the rule script or the scope selection for the rule.

The debugging aids are invaluable, as they quickly narrow down the problem space when things aren't working. Put them to use and make your life easier. :-)

Another thing that is often a point of confusion for new authors is the issue of "scope" for a given rule. Choosing the right scope is critical to getting the results you want. Fortunately, there is a topic dedicated specifically to this issue within the Tips & Tricks chapter of the docs. I strongly recommend you read that topic.

Oh, and definitely do NOT use global tags unless you have no other choice (Russell sure does quote me pretty darn accurately, doesn't he?). Mark the tag group as "accrued" instead of global and you'll get the same results without the baggage of global tags. Global tags should only be used in special situations. There's a write-up on what those situations are within the documentation (in case you're wondering).

-Rob

At 11:32 AM 1/26/2006, you wrote:

OK, going through the manual, it seems I'm doing this right, so I suspect I'm missing something stupid.

What I'm trying to do is, units with the tag [uct.arbb] are supposed to be 0-2.

if (tagcount[uct.arbb] > 2) then

@valid=0

else

@valid=1
endif

Is the rule I'm trying to use. But, after compiling, and switching to that game system, I can dump as many of that unit onto the roster as I want.
 
Back
Top