Closed DoctorRyner closed 5 years ago
Specify "doesn't work" 😐 .
If heroId
is an int, .toString()
is simply wrong.
Check the generated output.
presetAlternateFormUnit is lambda (int -> string), how should I convert that then?
IdGenerators return int
s and if you write int i = 'h000'
it is quite obvious that i
is an int
.
Single quotes in jass and wurst are just base 256 int
s (with some restrictions) to have more recognizable format.
int.toString()
returns the numerical representation in base 10 e.g. 34123974
, not base 256.
Use int.toRawCode()
or even better commaList
from the ObjectIds
package, the second supporting a variable amount of arguments, returning a comma separated list of ids used for e.g. normal spells, built structures, etc.
..presetNormalFormUnit (_ -> commaList(heroId))
There are also examples on the doc pages https://wurstlang.org/stdlib/unit_objed
Thank you, that works perfect! Im just not used to these low level things, we in Haskell include something like this in a type level :)
You're welcome. You can suggest information to be added to the website if you think something is missing. https://github.com/wurstscript/wurstscript.github.io
It simply doesn't work if I set alternative form that way, maybe we need to create a simple morphing preset like with channel?