Hello, I try create a behavior "Weapon".
Now I can't create a Instance of bullet in my plugin.
My actions:
1. Create a bullet on project.
2. Create a "tank" with weapon.
3. Add my behavior "Weapon" to the "tank".
4. On the "space" key down I make a shoot from weapon by bullet from step 1.
But for it I must create a new bullet from my behavior script. I saw in Events sheet, that my "tank" as Sprite can use Spawn function for create new Instance Bullet. From script it looks terrible in my performance:
this.type.objtype.plugin.acts.Spawn.call(
this.type.objtype.instances[0],
this.runtime.types_by_index[2],
this.runtime.getLayerByNumber(this.bullet_layer),
1
);
And of course, it does not work. Causes an error somewhere in eventg.js, as shown by firebug:
evinfo.current_event is null
return evinfo.current_event.actions[evinfo.actindex]; eveng.js (line 1576)
I think it should be way easier and more beautiful, but I have not found anywhere else.
Help me, please.
Raw current variant of plugin you can download from onlinedisk.ru/file/772010