nathanlink169

Veteran
Veteran
Joined
Aug 15, 2013
Messages
74
Reaction score
32
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
238
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
278
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
74
Reaction score
32
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
278
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
74
Reaction score
32
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'm back from an 11 year hiatus. Lol
I sometime envy the people that haven't played Skyrim yet. I feel like I could trade the whole world to be able to make my first pilgrimage to High Hrothgar all over again
Come join us while we play Pocket Mirror by Astral Shift! :LZSjoy: Starting at 2PM ET today!
Tried changing profile icon but...It just felt weird, you know? Who would even want to talk to me if I didn't have this fat yellow rodent thing....Or whatever it is as a mascot....No one, that's who! I am nothing without it. NOTHING!!..
I am having such a good hair day but because it's thunderstorms all day I don't go out and as such nobody will see my hair >.< It's not often my hair cooperates!

Forum statistics

Threads
112,344
Messages
1,067,574
Members
145,981
Latest member
GanMvV
Top