Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
if (field[fChosen].chosen.tagis[Helper.NatPrimary] <> 0) then
For some reason (probably cause I'm dumb), I'm having a hard time determining if the Helper.NatPrimary tag exists on something. Here's the code I'm trying and failing with:
Code:foreach bootstrap in field[fChosen].chosen where "component.BaseNatWep & thingid.wBite" if (tagis[Helper.NatPrimary] <> 0) then [I]blah blah blah[/I] endif nexteach
Am I taking the completely wrong approach or is my if statement just not right?
I'm surprised that code didn't give you any error messages.
(If it did give you error messages, then right-clicking them, copying them, and pasting them into your post when you said it wasn't working would have sped up figuring out what was wrong).
foreach bootstrap in field[fChosen].chosen where "component.BaseNatWep & thingid.wBite"
if (field[fChosen].chosen.tagis[Helper.NatPrimary] <> 0) then
perform hero.child[wBite].assign[Helper.NatPrimary]
endif
nexteach
The reason that it can't pick it up is because the hero that the natural attack is one, that is has the Helper.NatPrimary tag, isn't live yet. The tag is assigned to an attack when the hero becomes live, but is not assigned when it is not live. This is because these tags are being assigned dynamically. Now, if the actual weapon, wBite for example, had the Helper.NatPrimary tag added to it in the Editor, it would always be assigned (statically) which means it would always be available. However, not every creature has that as its primary attack. Anything that is assigned to the Race itself, in the Editor, is available. Anything that is assigned to a Thing that is on the Race is not. That's why I can access the rSTR, rDEX, etc. fields, they are statically assigned. So is wBite, it is assigned to the Race. The Helper.NatPrimary is assigned to the wBite, but only when the creature is live.
That is why I attempted to do the "foreach actor in portfolio" because I thought all the actors (heroes) in a portfolio were live. Turns out, only the active hero is live. The other heroes are only live long enough to produce their output, but seem to go non-live when they are not active (which strangely doesn't change their output to the screen). So, unless there is a way to make all things live outside of the current hero you are working with, none of the relevant tags and fields that are set up for the things on a Race will be available until it is live. That's what I meant when I said that was as far as I was willing to go.
Now you could do the custom tags, but you would have to statically custom tag each race just to get the results you want. Editing each race to do that would be a monumental task, just to add a lot of custom tags to each one that worked with your Alternate Form, Change Shape, Wild Shape, etc.
Sorry, didn't even look at the first line.
foreach and field[fChosen].chosen are two different ways of finding things - only use one or the other - you can't just merge them.
I don't think this will work without the foreach because the thing being chosen is a race. So, the goal here is to figure out if something bootstrapped to the chosen object has the Helper.NatPrimary tag associated with it.