Kendall-DM
Spy
Is there a way to make a foreach statement target only the container (or pick) it is currently in?
For example, let's say I have a sword that has the flaming quality, and I want a script on that sword that has a script that wants to see if it has the flaming quality and does something with it. As I understand it, if I use a foreach statement, it would apply to all picks with the flaming quality on it, when I only want it to apply to the thing I am currently looking at. Is there another way to see if a pick exists on a specific thing in a script?
This example is NOT what I am doing, it is merely an example. Actually, I realize now it is a bit more complex. What I need to do is look at the parent of the pick I am looking at, and see if that parent has a pick on it (I am essentially trying to get my Shield Bash script to incorporate your Shield Spikes correctly). The problem I'm having is, if it finds anything on the hero with the pick, it applies it to all of those things that run the script, when essentially I want it to only apply it to the one thing that is running the script and HAS that thing on its parent.
What I'm doing.
Shield -> Shield Spikes (shadowed)
`------> Shield Bash (shadowed): Script to forward tags from shield spikes (on this shield only) and append the shield bash with " (Spikes)".
When doing this, it does it to all shields on the hero, when I want it to apply only to the relevant shield. I can't seem to figure out how to internally target only the specific shield parent via a script. I had thought that "foreach pick in container" would work, since the wiki says it looks at the parent of the current thing (which would be the shield), but this is not what it is doing and I'm perplexed what to do from here.
For example, let's say I have a sword that has the flaming quality, and I want a script on that sword that has a script that wants to see if it has the flaming quality and does something with it. As I understand it, if I use a foreach statement, it would apply to all picks with the flaming quality on it, when I only want it to apply to the thing I am currently looking at. Is there another way to see if a pick exists on a specific thing in a script?
This example is NOT what I am doing, it is merely an example. Actually, I realize now it is a bit more complex. What I need to do is look at the parent of the pick I am looking at, and see if that parent has a pick on it (I am essentially trying to get my Shield Bash script to incorporate your Shield Spikes correctly). The problem I'm having is, if it finds anything on the hero with the pick, it applies it to all of those things that run the script, when essentially I want it to only apply it to the one thing that is running the script and HAS that thing on its parent.
What I'm doing.
Shield -> Shield Spikes (shadowed)
`------> Shield Bash (shadowed): Script to forward tags from shield spikes (on this shield only) and append the shield bash with " (Spikes)".
When doing this, it does it to all shields on the hero, when I want it to apply only to the relevant shield. I can't seem to figure out how to internally target only the specific shield parent via a script. I had thought that "foreach pick in container" would work, since the wiki says it looks at the parent of the current thing (which would be the shield), but this is not what it is doing and I'm perplexed what to do from here.
Last edited: