Open Qix- opened 4 years ago
Following the examples in all of the Readme, example repo and vbucks, I can't get a simple script to run:
const entityLib = this.global.entityLib; const ancientOctus = entityLib.extendUnit(UnitType, 'ancient-octus', [{ drawUnder(parent, rot) { Draw.color(Color.red); Lines.stroke(4); Lines.circle(parent.x, parent.y, 50); Lines.circle(parent.x, parent.y, 100); Lines.circle(parent.x, parent.y, 150); } }]);
It appears this.global.entityLib is not populated early enough? I don't really understand how mindustry's inclusion system works.
this.global.entityLib
I do have a main.js in the root /scripts/ folder that includes this one (which is located at /scripts/units/ancient-octus.js).
main.js
/scripts/
/scripts/units/ancient-octus.js
I really doesn't help that all of the examples are mechs and none of them are units...
@MEEPofFaith I got units working here: https://github.com/Qix-/mds-ancients-units
Following the examples in all of the Readme, example repo and vbucks, I can't get a simple script to run:
It appears
this.global.entityLib
is not populated early enough? I don't really understand how mindustry's inclusion system works.I do have a
main.js
in the root/scripts/
folder that includes this one (which is located at/scripts/units/ancient-octus.js
).