• 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

Stupid usrChosen1 question

Jaunt

Member
Hey guys, I'm basically just a monkey cutting out working code and substituting in my own desired targets, ransom note style, so don't laugh too hard.

Basically what I'm trying to do is make a racial ability where you pick 1 melee weapon, and then all your attacks with matching weapons use the better of Str or Dex to hit. Here's what I've got:
Code:
doneif (field[usrChosen1].ischosen = 0)

foreach pick in hero from BaseWep

if (eachpick.field[thingname].text = lowercase(field[usrChosen1].chosen.field[thingname].text)) then 
perform eachpick.assign[MelAttOpt.aDEX]

endif

nexteach
When you try to run all that, nothing happens.

Don't ask me why I did or didn't do something; I don't know, I'm just copying other things I've found in the editor or from the forum. Thanks in advance for any help whatsoever!
 
Last edited:
Take a look at this line:

if (eachpick.field[thingname].text = lowercase(field[usrChosen1].chosen.field[thingname].text)) then

Roughly translated to real-people-talk, that's:

"If the name of the hero's weapon is the same as the all-lowercase version of the name of the weapon we selected for this ability..."

That should give you an idea of what's wrong here.
 
Couple things ... you two posted exactly 12 hours apart and that makes me chuckle. The other is you're going to want to do a tag search instead of a string search. String comparisons are costly in terms of processing power.

I'll let you do a little searching, but I think the best thing would be to use the pulltags command and make a variable to use for your search.
 
To expand on what AndrewD2 has said - what if the user picks "dagger" as their chosen weapon - there are weapons like the butterfly knife that count as daggers for many purposes, but just checking names won't catch that - you need to check tags as AndrewD2 is suggesting in order to catch that sort of thing.

Also, don't forget to test with weapons like the adamantine dagger and assassin's dagger, from the magic, custom or masterwork weapons list at the top of the weapons tab.
 
Back
Top