nathanlink169

Veteran
Veteran
Joined
Aug 15, 2013
Messages
76
Reaction score
33
First Language
English
Primarily Uses
RMMV
Hi all.

I'm trying to highlight an area with a semi-transparent colour to represent an NPC's vision cone. Is there a way to say "draw this colour at this location"?
 

Ace of Spades

Veteran
Veteran
Joined
Jan 19, 2017
Messages
162
Reaction score
241
First Language
English
Primarily Uses
Not sure if you're just needing the visual part of the vision cone showing, but if that's the case why not just use the show picture command in editor? You can set the coordinates to variables, set the opacity, and it'll give you more creative control on how it should look (for example if you want a gradient in the vision cone)
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
531
Reaction score
279
First Language
thai
Primarily Uses
RMMV
this plugin process the visual sensor
but… if you want to write your own code
you need to dig in by yourself
because I’m not do it yet…
 

nathanlink169

Veteran
Veteran
Joined
Aug 15, 2013
Messages
76
Reaction score
33
First Language
English
Primarily Uses
RMMV
Not sure if you're just needing the visual part of the vision cone showing, but if that's the case why not just use the show picture command in editor? You can set the coordinates to variables, set the opacity, and it'll give you more creative control on how it should look (for example if you want a gradient in the vision cone)
Thank you for the suggestion! I did consider this at first, but I ran into a few theoretical issues. I'm using a pixel-based movement in my game, rather than tile-based, so ensuring that the image is pixel-perfect to the math that's happening will be a slight pain. Another issue is that if the vision gets blocked by the terrain, I want to be able to reflect that. I'm not certain that's possible with an image. Lastly, I think this is a good learning opportunity.

this plugin process the visual sensor
but… if you want to write your own code
you need to dig in by yourself
because I’m not do it yet…
Thanks for the resource! I'll take a look at how they're doing the drawing. I definitely want to write my own code for this, primarily to learn. I've done vision cones in other languages and they're not terribly difficult to do, I'm just unfamiliar with the RPG Maker library exactly.
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
531
Reaction score
279
First Language
thai
Primarily Uses
RMMV
and this is japanese version where the dev still actively improving it

by myself the English plugin is in alien language haha...
he use something beyond my knowledge
I only understand something more base rpg maker mv editing...
and my mathematic skill is poor...haha...
the japanese one use bitmap function that I guess is the one
had no time to experiment on it yet
 

nathanlink169

Veteran
Veteran
Joined
Aug 15, 2013
Messages
76
Reaction score
33
First Language
English
Primarily Uses
RMMV
I was able to figure out the answer to my question. MV uses PIXI.js as its graphics manager. The following code will draw a box on screen:

JavaScript:
// Call this code on initialization
this._sprite = new PIXI.Graphics();
SceneManager._scene.addChild(this._sprite);

// Call this code any time you want to change what is displayed
this._sprite.clear();
this._sprite.beginFill(0xFF0000, 0.5);
this._sprite.drawRect(50, 200, 100, 75);
this._sprite.endFill();
 

Latest Threads

Latest Posts

Latest Profile Posts

I keep thinking up of new changes or improvements... Edit: Forgot to add the image Gimpwork.JPG
Hello, my nickname is Rigomor, but I am also known as Mopsikus. I work on RPG Maker games, and are currently working on a game called Peony of War.
If the world treats you like an enemy... Then the world must be your enemy...
What started as 1 RPG in development on the Nintendo DS, turned into 4 RPGs in development (1 on VX and 3 on VX Ace). Wish me luck.

Forum statistics

Threads
117,293
Messages
1,106,252
Members
153,480
Latest member
Varlen
Top