View Single Post
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 2,970

Old November 5th, 2020, 09:52 AM
Quote:
Originally Posted by Provos View Post
Ah the script is on the new material I am using and yes I am getting an error.

Syntax error in "eval" script for Thing 'mRedstl' (Eval Script '#2') on line 4 -> Non-existent filed 'chosen' by script
Ah, yes, that makes sense. You'll need to tell the script to look at the parent. Also, the error is because the original script you copied is for something that has a chooser.

Try the following and let me know what you get:

Code:
var crit as number
 
if (container.parent.tagcount[wCritMin.?] > 0) then
  crit =  container.parent.tagmin[wCritMin.?]
endif
 
~now, we'll subtract one from the value we looked up:
 
crit -= 1
 
~and create a tag for that new value:
 
var newcrittag as string
newcrittag = "wCritMin." & crit
 
~Weapons are assumed to have exactly one wCritMin tag,
~so we'll delete anything that already exists,
~and then assign the new tag:
 
perform container.parent.delete[wCritMin.?]
perform container.parent.assignstr[newcrittag]

Last edited by Sendric; November 5th, 2020 at 09:56 AM.
Sendric is offline   #18 Reply With Quote