I am building a plugin that handles NPC vision and player detection for MZ and while I was able to get some basic things working like tying visions to NPC looking direction and following the player when spotted, I am trying to debug where the vision shows on screen and the actual hit box vertices (that are generated from a collision detection lib)
I want to draw graphics to the screen to accuratly reflect where the vertices are detected so I can figure out the off set algorithm but I can't seem to figure out how to use pixi to draw graphics properly on the sceen. The problem is, the minute I tie a graphic to a spirte it jacks up the exact location... I need precise debugging display to fix the off set calculations. Any ideas how to draw directly to the scene accuratly would be a huge help for me
Here is the debugCode i've been futzing with that gets called is the NPC sprites update method
forums.rpgmakerweb.com
I want to draw graphics to the screen to accuratly reflect where the vertices are detected so I can figure out the off set algorithm but I can't seem to figure out how to use pixi to draw graphics properly on the sceen. The problem is, the minute I tie a graphic to a spirte it jacks up the exact location... I need precise debugging display to fix the off set calculations. Any ideas how to draw directly to the scene accuratly would be a huge help for me
Here is the debugCode i've been futzing with that gets called is the NPC sprites update method
drawDebug() {
if(this.IR_Vision_debug) {
SceneManager._scene._spriteset.removeChild(this.IR_Vision_debug);
}
let gr = new PIXI.Graphics();
gr.beginFill(0xFF0000);
gr.width = 2000;
gr.height = 2000;
gr.lineStyle(10, 0xFF0000, 1);
gr.moveTo(this.shape.AABB[0], this.shape.AABB[1]);
gr.lineTo(this.shape.AABB[3], this.shape.AABB[4]);
gr.endFill();
let debugBitmap = Graphics.app.renderer.generateTexture(gr);
debugBitmap._width = 2000;
debugBitmap._height = 2000;
gr.destroy();
this.IR_Vision_debug = new PIXI.Sprite(debugBitmap);
debugBitmap.addLoadListener = function(listner) {
listner(this.IR_Vision_debug);
};
SceneManager._scene._spriteset.addChild(this.IR_Vision_debug);
}
MZ - Character Vision to detect player
I didn't find a flexible enough line of sight / vision plugin for RMMV so I'm working on a system for a game that has Character version accessible via script for RMMZ since there doesn't really appear to be visions scripts that can be affected by lighting, obstacles, stealth behavior etc. I may...
forums.rpgmakerweb.com