JediMindTrix Posted December 25, 2015 Posted December 25, 2015 I have two small blocks of weidu that cause inexplicable (to me) "cannot convert x or %x% to integer". LPF ADD_CRE_EFFECT //protection from spell INT_VAR opcode = 206 timing = 1 probability1 = 100 resource = ABAZDG02 END LPF ADD_CRE_EFFECT INT_VAR //Play 3D Effect opcode = 215 target = 0 parameter1 = 0 parameter2 = 1 timing = 9 sourceslot = AMYAG_B END I have plenty of nearly identical, completely functional weidu command blocks but these two consistently return the error no matter what I've tried. Removing them eliminates installation errors. Any ideas? Am I missing something obvious? EDIT: I am, STR_VAR - for the first block, anyway. Still clueless on the second.
Jarno Mikkola Posted December 25, 2015 Posted December 25, 2015 Try: LPF ADD_CRE_EFFECT //protection from spell INT_VAR opcode = 206 timing = 1 probability1 = 100 STR_VAR resource = ABAZDG02 ENDThe how the AMYAG_B needs to be set is the string variable in the second, aka: LPF ADD_CRE_EFFECT //Play 3D Effect INT_VAR opcode = 215 target = 0 parameter1 = 0 parameter2 = 1 timing = 9 STR_VAR resource = AMYAG_B ENDThe sourceslot variable you try to use, is actually used to set the effects source, with can be 0 = none, 1 = a spell or 2 = an item. If you don't set the variable like in my above example, it defaults to the 0 which is none, so it's not attached to an item or a spell.
subtledoctor Posted December 25, 2015 Posted December 25, 2015 To explain Jarno's correctins, INT_VAR precedes values that take integers; STR_VAR precedes values that takes strings. (I think.) To correct a bit more, I think after STR_VAR, ABAZDG02 and AMYAG_B should be in quotes or tildes ("..." or ~...~)
JediMindTrix Posted December 25, 2015 Author Posted December 25, 2015 Thanks everyone! To explain Jarno's correctins, INT_VAR precedes values that take integers; STR_VAR precedes values that takes strings. (I think.)To correct a bit more, I think after STR_VAR, ABAZDG02 and AMYAG_B should be in quotes or tildes ("..." or ~...~) There are a lot of instances in my .tpa's where resources are named with tilde's or quotations, and produce no errors. I suppose that doesn't mean nothing is breaking but I assumed WeidU would've said something?
Jarno Mikkola Posted December 25, 2015 Posted December 25, 2015 There are a lot of instances in my .tpa's where resources are named with tilde's or quotations, and produce no errors. I suppose that doesn't mean nothing is breaking but I assumed WeidU would've said something?I have seen both, it doesn't hurt to add them, but they shouldn't be strictly necessary. You do need the tildes etc if you have a negative value to insert to the variable.
Mike1072 Posted December 25, 2015 Posted December 25, 2015 They aren't needed for strings except when the strings contain special characters that would confuse WeiDU's parser. However, I quote all my string values (usually with tildes), for consistency and because it's a habit I learned from other programming languages. It makes it easier to tell strings apart from variables when using code highlighting, too.
Jarno Mikkola Posted December 25, 2015 Posted December 25, 2015 for consistency ... It makes it easier to tell strings apart from variables when using code highlighting, too. Hmm, I wonder how consistent you are with that. AKA can we see you code the above as: LPF ADD_CRE_EFFECT //protection from spell INT_VAR ~opcode~ = 206 ~timing~ = 1 ~probability1~ = 100 STR_VAR ~resource~ = ~ABAZDG02~ END Ha...
JediMindTrix Posted December 25, 2015 Author Posted December 25, 2015 Thanks guys (and merry christmas!)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.