Something meta about my macro that I can't fix.
{
(set: $player to (dm:
"phys", 3,
"level", 1,
"skill", (dm:
"melee", (dm:
"attr","phys",
"level", 1
)
)
))
(set:$roll to (macro: num-type _level, [
(if: _level is 0)[(output-data:1)]
(if: _level is 1 or 2)[(output-data:(random: 1,4))]
]))
(set: $skillCheck to (macro: string-type _skillName,[
(set: _skillpower to $player's ($player's skill's (string:_skillName)'s attr) + $player's skill's (string:_skillName)'s level + ($roll: $player's level))
(output-data:_skillpower)
]))
($skillCheck: "melee")
}
This tells me there isn't a temp variable named _skillpower in this place.
If I replace _skillpower with brand new variable instantiated inside the marco $skillpower and not anywhare else the variable populates with data that I can print after I run this macro so (set: _skillpower to ($player's ($player's skill's (string:_skillName)'s attr) + $player's skill's (string:_skillName)'s level + ($roll: $player's level)))
is definitely working as intended.
(set: $skillCheck to (macro: string-type _skillName,[
(set: $skillpower to ($player's ($player's skill's (string:_skillName)'s attr) + $player's skill's (string:_skillName)'s level + ($roll: $player's level)))
(output-data: (num:$skillpower))
]))
This gives me the error: "The (num:) macro's 1st value is the number 23, but should be a string." so its producing a number in this location that should be output-able, yet if I remove the (num:) macro...
(set: $skillCheck to (macro: string-type _skillName,[
(set: $skillpower to ($player's ($player's skill's (string:_skillName)'s attr) + $player's skill's (string:_skillName)'s level + ($roll: $player's level)))
(output-data: $skillpower)
]))
I get the error: "The $skillCheck macro didn't output any data or hooks using (output:) or (output-data:)" and printing $skillpower produces the number 20. So maybe it wants a string since its a string type...
(set: $skillCheck to (macro: string-type _skillName,[
(set: $skillpower to ($player's ($player's skill's (string:_skillName)'s attr) + $player's skill's (string:_skillName)'s level + ($roll: $player's level)))
(output-data: (string:$skillpower))
]))
same error.
but If I just randomly set _skillpower to some number inside the macro it works. So its setting the variable properly but there is something meta about it, that it doesn't like and I can't figure out what it is or how to fix it.
Update:
(set: $skillCheck to (macro: string-type _skillName,[
(output:)[(string:$player's ($player's skill's (string:_skillName)'s attr) + $player's skill's (string:_skillName)'s level + ($roll: $player's level))]
]))
This "works" but I'm not able to use the output as data in calculations, so... its not super helpful helpful. :(
further testing:
(set: $skillCheck to (macro: string-type _skillName,[
(set: $temp1 to $player's ($player's skill's (string:_skillName)'s attr))
(set: $temp2 to $player's skill's (string:_skillName)'s level)
(set: $temp3 to ($roll: $player's level))
(set: _output to $temp1 + $temp2 + $temp3)
(output-data: _output)
]))
($skillCheck: "melee")
(print: $temp1)
(print: $temp2)
(print: $temp3)
(datatype:$temp1)
(datatype:$temp2)
(datatype:$temp3)
(print: ($temp1 + $temp2 + $temp3))
outputs:
The $skillCheck macro didn't output any data or hooks using (output:) or (output-data:). 3 2 1 [the num datatype] [the num datatype] [the num datatype] 6