• 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

Pulling tags from a selection and pushing them to a bootstrap.

Redcap's Corner

Well-known member
I'm trying to pull tags from one of the bootstraps of a thing selected by the user and add them to the equivalent pick bootstrapped to my hero. I've been using the following code:

Code:
foreach bootstrap in field[usrChosen1].chosen where "thingid.wClaw"
  perform eachthing.pulltags[wMain.?]
  perform eachthing.pulltags[Value.?]
  nexteach
foreach pick in hero from BaseNatWep where "thingid.wClaw"
  perform eachpick.pushtags[wMain.?]
  perform eachpick.pushtags[Value.?]
  nexteach

It isn't working, and I'm pretty sure the reason is that the class ability responsible doesn't have the wMain or Value tags as options. Is there a way to pull and push in a single statement, using the class ability as a conduit? I'm 99% sure this would work if wClaw had the code:

Code:
foreach bootstrap in hero.child[cEnsEnsp].field[usrChosen1].chosen where "thingid.wClaw"
  perform eachthing.pulltags[wMain.?]
  perform eachthing.pulltags[Value.?]
  nexteach

I could setup replacement things for all natural weapons with the above code, but that seems rife with potential for errors. The only other thing I can think to do is setup a hidden bootstrapped dummy natural weapon that just sucks up these tags and spits them onto the appropriate things, but that seems really clumsy.

Any ideas?
 
I don't think the fact that the intermediary is a class special or whatever should have any effect on whether it can pull certain tag groups to itself. Any tag should be able to be on any pick (although a tag might not have its usual effect if they are somewhere unusual).

I would say add some debugs to the eval script. Verify that your foreach thing is finding the correct bootstraps you think it should. Verify the tags are getting to the intermediary ability. Verify the second foreach pick is getting to the correct copy of claw on your hero.
 
All right, I'm revisiting this issue and trying to get to the bottom of it. Here's where I am at the moment.

First/550
Code:
if (field[usrChosen1].chosen.isbootstrap[wClaw] <> 0) then
  foreach bootstrap in field[usrChosen1].chosen where "thingid.wClaw"
    debug "OLD " & eachthing.idstring
    perform eachthing.pulltags[wMain.?]
    perform eachthing.pulltags[Value.?]
    nexteach
  perform hero.assign[Custom.AddClaws]
  endif

This gets me "OLD wClaw" in the debug window, so it's definitely finding the bootstrap. However, when I pull up the debug tag list for the class ability in question, there's no Value or wMain tag to be found. So, can anybody see any problems with the above pulltags expressions?

As for the other end of this problem, my bootstrap has a condition of hero#Custom.AddClaws at First/575, after which I have the following code.

First/580
Code:
if (hero.tagis[Custom.AddClaws] <> 0) then
  foreach pick in hero from BaseNatWep where "IsWeapon.wClaw"
    debug "NEW " & eachpick.idstring
    perform eachpick.pushtags[wMain.?]
    perform eachpick.pushtags[Value.?]
    nexteach
  endif

Here I'm not getting any debug output. This is bizarre because I've used exactly the same foreach statement successfully with a different class ability for the same class. So, I guess it's an issue with the if statement? Anyone see a problem there? Anyway, this problem hardly matters if I can't solve the first problem from earlier in this post, but I'm still not sure what the issue is.
 
What about this is forcing you to run ultra-early, at First/550?

A lot of the tag processing for various things may not be complete that early.
 
Hmm. I don't know. I guess any time I've ever seen something that grants natural weapons, it's done it around First/500. Isn't there some sort of restriction on conditional bootstraps where they have to be added pretty early? When would be safer for pushing and pulling tags?
 
Conditional bootstraps have to be pretty early, but then the tags you need to add should be something that's not connected to when they were bootstrapped (as long as it's after the conditional bootstrap).
 
Yeah, I rearranged things to facilitate that, but I'm still having no luck finding a timing that works. I did manage to get the debug output working for the pushtags section finally, but I still haven't been able to successfully pull or push tags. I've tried Pre-Levels/1000, Levels/1000, Final Phase/1000, and it still doesn't seem to be working. Would the pushtags statements need to be at later priority than the pulltags ones, or would it be sufficient to have them just later in the same script? Currently, I'm doing the following all in one script:

Code:
if (hero.tagis[Custom.AddClaws] <> 0) then
  foreach bootstrap in field[usrChosen1].chosen where "thingid.wClaw"
    debug "OLD " & eachthing.idstring
    perform eachthing.pulltags[wMain.?]
    perform eachthing.pulltags[Value.?]
    nexteach
  foreach pick in hero from BaseNatWep where "IsWeapon.wClaw"
    debug "NEW " & eachpick.idstring
    perform eachpick.pushtags[wMain.?]
    perform eachpick.pushtags[Value.?]
    nexteach
  endif
 
Now that I'm looking again, I see the issue.

Is usrChosen1 selecting a specific claw attack? Or is it selecting an ability that bootstraps some claws?

If it's selecting a specific claw ability on the character, then you want to get the tags from that weapon, not something bootstrapped by a weapon:
Code:
perform field[usrChosen1].chosen.setfocus
  if (state.isfocus <> 0) then
  perform focus.pulltags[wMain.?]
  perform focus.pulltags[Value.?]
  endif

I'm sorry to say that if this is selecting an ability that bootstraps some claws, and the wMain and Value tags are assigned as part of the bootstrap, foreach bootstrap cannot access those tags. I can't see a way to do this if that's the case until the limitation in foreach bootstrap that prevents it from seeing any additional tags or field values is fixed.
 
It's a list of creatures whose corpses can be possessed by the class, so it seems like I'm out of luck again. I don't suppose fixing that foreach bootstrap limitation is high on the list of priorities right now, is it?
 
Back
Top