• 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

Thing Lives?

ShadowChemosh

Well-known member
Is their a way besides using hero.childlives[] to test to see if a thing is actually live on a hero?

The issue is that hero.childlives[] requires a hardcoded Thing ID. I have a dozen Racial Custom Specials that will have the same exact script where I need to know if I am in a Live state or not and I didn't want to have to type in the Thing ID into each unique script. Hopefully that makes sense. :)

Is their a different test where I could use a variable for the Thing ID at least?

Thanks
 
Can you use a Custom tag that you forward to the hero?

A script can't run unless the pick running the script is live, so how could a script wonder if it is live?

If this script is looking for something else, can you use foreach or findchild?
 
Probably best to explain it fully. :)

I have a dozen "Racial Custom Specials" but once you pick one of them I would like the other custom Things to become invalid. So in example we have Spawn1, Spawn2, Spawn3 but only picking ONE of these Spawns is valid.

So I did create a new tag Custom.rcPTrace for my planetouched race. Then I forwarded the tag to the hero using a eval script.

Then I gave each spawn (ie Racial Custom Special) a "Expr-reqs" with "hero.tagis[Custom.rcPTrace] <> 1". The issue became that as soon as I added any spawn thing to the hero it marked itself as invalid as it found the custom tag on the hero. :(

So then I created the following "Pre-reqs" script as I found that Pre-reqs scripts actually do run as soon as the selection window displays all the choices:
Code:
@valid = 1
~ If we are NOT live than any tag found means we are invalid
If (hero.childlives[rcPtDaemon] = 0) Then
   If (hero.tagis[Custom.rcPTrace] = 1) Then  
      @valid = 0
   endif
endif
~ If we are LIVE then only invalid when more than one tag found
If (hero.childlives[rcPtDaemon] = 1) Then
   If (hero.tagcount[Custom.rcPTrace] > 1) Then  
      @valid = 0
   endif
endif
Where rcPtDaemon is the ID of the very Thing the script is running on. So this script fires off as soon as the selection window happens. So the Thing is not LIVE as far as childlives sees it but the script does run.

The above does work but I was hoping to use a more generic script where I didn't have to hard code the Thing ID is all.

So with all that in mind how would you go about making sure that only one of the Spawns got selected? Maybe their is just an easier way that I am overlooking.

Thanks
 
@ispick = 1 once a thing is added to the hero and = 0 before it is added. So, you can incorporate that into the exprreq when testing for the Custom tag:

Code:
hero.tagcount[Custom.rcPTrace] <= @ispick
 
Back
Top