Jump to content


Photo

catch-all for marksmanship ws's in lua


  • Please log in to reply
5 replies to this topic

#1 Gukai

Gukai

    Advanced Member

  • Members
  • PipPipPip
  • 82 posts

Posted 07 June 2017 - 04:54 PM

Hello

I am trying to do rules for marksmanship weaponskills, since almost all have the same modifiers and thus I'll be using the same ws set for them

 

Here is my reference, for archery weaponskills

 

if spell.english == 'flaming arrow' or 'xxx arrow' or   (etc) 

This works for archery because I use a few different sets, but Marksmanship I just want to use 1 set.

 

 

I dont want to list every single ws name like i did for Archery, so i was thinking something like

 

if spell.english:endswith('Shot') then 

This seems easiest because like 7 ws's all end with 'Shot', and it would save me from having to type out a long line of text in listing each one.  I just need to add Detonator, Last Stand, and Trueflight.  How can I add these 3 to the same line of coding?

 

if spell.english:endswith('Shot') or <what would go here???> then 

 

 



#2 Kenshi

Kenshi

    Advanced Member

  • Members
  • PipPipPip
  • 299 posts

Posted 07 June 2017 - 06:32 PM

If you are adding all ws, doesn't will it be better to use spell.skill?



#3 Gukai

Gukai

    Advanced Member

  • Members
  • PipPipPip
  • 82 posts

Posted 07 June 2017 - 06:39 PM

I'd rather not just in case I want to break it up in the future.  For example, there is one ws that is an agi/dex modifier, if im using the relic gun.  I dont have the gun yet but if I do one day then i'll  need rules specific for this so I dont want to lump them up under the spell.skill.  Also, one of them I want excluded because I want to build a set with more range accuracy specifically for it - thankfully it's not one of those with 'shot' in the name, haha.



#4 Kenshi

Kenshi

    Advanced Member

  • Members
  • PipPipPip
  • 299 posts

Posted 07 June 2017 - 10:11 PM

you can also use the ~= (not equal to) operator: spell.name ~= "Some WS" to exclude it



#5 Gukai

Gukai

    Advanced Member

  • Members
  • PipPipPip
  • 82 posts

Posted 08 June 2017 - 07:53 AM

That would go...

 

 

if spell.skill == 'Marksmanship' and spell.name ~= 'Last Stand' then 

 

 

 

right?



#6 Kenshi

Kenshi

    Advanced Member

  • Members
  • PipPipPip
  • 299 posts

Posted 08 June 2017 - 12:54 PM

yea, if the ws is a markmanship one and not last stand






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users