• 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

ABCreator - Rule not triggering

brentil

Member
Game Rule = You can choose a special character to pilot a vehicle but you can only ever pick that special character once. There are multiple special characters to choose from too. The first image below shows the squadron with their units and I've clicked the special character Ben Dixon twice.

I followed the instructions from the How To Guide on "Designing a Rule" as it covers making a General you can only have one of in an army. I've made the ability to add a special character an option and in their eval script I assign the unique tag to that special character.

Code:
var result as number
result = unit.assign[uedfCharac.benDixon]

I then set a rule following the guide to tagcount that tag. The rule is unique and has a Message set.

Code:
if (tagcount[uedfCharac.benDixon] < 2) then
    @valid = 1
endif

Well it didn't work. Loading the Debug Tags I could see each unit with the Ben Dixon name also now had the tag for him. So I added debug scripts to both locations and I'm not seeing the ones in the Rule fire off ever. So I set the rule to @valid = 0 so it should have triggered but it never did then either.

What am I doing wrong?
 

Attachments

  • Capture2.PNG
    Capture2.PNG
    81.3 KB · Views: 7
Hi, try to check if your tag is global or an accrued tag;

Also try to see if the rule is "ignored", it's basic, yes, but it happened to me so... Also, try to see if your rule is in the ruleset & context that is currently in use. Could be one of the reasons that the rule isn't triggered.
You may also want to check the scope of your rule, and that it's set on the correct scope ( As I understood, for the roster- as there is only one character per roster).
Hope it helps !
 
I just looked, the rule is set to Roster level and the Ignore value is not checked.

The issue with Global tags is according to the logic I can't assign them from an Option as when I try to do that it tells me I can't. Since this is my first rule I was doing it like the how to guided me to. So if I'm supposed to use them I'm not sure as the documentation doesn't talk about doing so.

Images attached.
  1. Image of the rule I created. It shows 3 different debug entries of methods I tried before realizing the rule wasn't working. None of them fire off.
  2. Image shows my Eval script on my option, the debug item there shows in the debug window when it's enabled.
  3. This image shows AB loaded with the tags of the specific unit showing that my Ben Dixon tag is being assigned to the unit when enabled. However you can see the debug window is empty and it doesn't show in accrued. Maybe my understanding of how this works based off the How To guide is off?
 

Attachments

  • 01_Rule.JPG
    01_Rule.JPG
    63.3 KB · Views: 4
  • 02_Option_Eval.JPG
    02_Option_Eval.JPG
    22.8 KB · Views: 3
  • 03_Debug.JPG
    03_Debug.JPG
    146.2 KB · Views: 3
I would try to set the tag as global, but do not try to assign the tag bu an eval script, but rather by adding an auto tag, in the option. (Rememeber to refresh your .dat file after modifying the .def file , you won't see your modifications otherwise - I had some hard times with this too...)
 
This may be a solution:

I had a set of rules that worked fine then I made a change to the def file and they all stopped, all the rules were for the same situation as yourself, i.e. limiting an option to one per roster.

The change made was removing the default ruleset from the def file so there were no actual rulesets chosen by the user

I've gone in and added a base ruleset to the def file and after that all the rules worked (I use accrued tags rather than global tags)

Have you got any rulesets enabled? (The rule does not need ot be linked to the ruleset it seems you need at least one ruleset operating)
 
I would try to set the tag as global, but do not try to assign the tag bu an eval script, but rather by adding an auto tag, in the option. (Rememeber to refresh your .dat file after modifying the .def file , you won't see your modifications otherwise - I had some hard times with this too...)

I'd like to try to get it workign this way as it's supposed to be possible but if not then I'll try the one you mention.

This may be a solution:

I had a set of rules that worked fine then I made a change to the def file and they all stopped, all the rules were for the same situation as yourself, i.e. limiting an option to one per roster.

The change made was removing the default ruleset from the def file so there were no actual rulesets chosen by the user

I've gone in and added a base ruleset to the def file and after that all the rules worked (I use accrued tags rather than global tags)

Have you got any rulesets enabled? (The rule does not need ot be linked to the ruleset it seems you need at least one ruleset operating)

I just looked and the default ruleset was still there. Just in case I made another ruleset and saved it but that didn't work. I also tried assigning my rule to the ruleset and that didn't work.

I even made another rule that was blank except for setting @valid = 0 and nothing from it. I must be missing some fundamental thing not in the documentation on how to actually activate or get rules to fire off.
 
So I've been using the WH40K rules as a learning tool. I opened their Warlord rule and it looks very much like my rule. So I put in a debug statement in their rule and when I reload the files it actually triggers the debug info.

Why oh why will my rule not trigger. :(
 
I finally figured it out thanks to your comment about rulesets Harkan_again.

I was re-reading the rulesets How To guide and was reading the section that describes Type = base,core,user. From you mentioning that without a ruleset rules would not trigger I made a guess that if a ruleset for the scope type didn't exist no rules of that scope would ever fire. I looked and the default ruleset and my ruleset were "user" scope rulesets. So I changed my ruleset to be a "core" rule and as soon as I did that and saved it my debug values started being populated in the debug window.

Thanks for the help etthui & Harkan_again!
 
Back
Top