N.A.S.T.Y. Text Pop Over Events

Nelderson

Coding *****
Veteran
Joined
Mar 17, 2012
Messages
165
Reaction score
168
First Language
English
Primarily Uses
RMMV
This script is amazing for atmospheric immersion. Is it possible to affect the z axis priority? I'm running some maps that consist of pictures and in some places the text doesn't show up as the z priority is lower than that of the overlay pictures.

Edit: I'm able to change the z priority of the text but it affects the parent sprite that it's attached to. How can I go about only affecting the z of the text itself?

Thanks
There is no z axis in MV.  Images are loaded in the oder given that the child is added....

How did you get the parent sprite higher?
 

Overclocked

Overclocked
Member
Joined
Feb 8, 2013
Messages
18
Reaction score
1
First Language
English
I added this.z = 8; to the last lines inside of these two functions

var Nasty_sprCharacterTxtPop_update_alias = Sprite_Character.prototype.update;Sprite_Character.prototype.update = function() {

    Nasty_sprCharacterTxtPop_update_alias.call(this);

    if (this.text_timer > 0 && this.char.textpop_flag === false){

      this.text_timer -=1;

      if (this.text_timer <= 0){

        this.removeChild(this.namepop_sprite);

        this.tmer_rat = undefined; //Reset ratio, just to avoid issues

      }

      else if (this.text_timer < 60){

        this.namepop_sprite.contentsOpacity-= 4;

        this.namepop_sprite.opacity -= 4;

      }

    }

    if (this.char.textpop_flag === true){

      this.namepop = this.char.namepop;

      this.removeChild(this.namepop_sprite);

      this.start_namepop();

      this.char.textpop_flag = false; //Release from update

    }

this.z = 8;

};
and
Sprite_Character.prototype.start_namepop = function(){    if (this.namepop === "") return;

    var b_width = (this.namepop.length * (this.char.namepop_size/2) + 24)+this.char.namepop_width;

    var b_height = (this.char.namepop_size + 28) + this.char.namepop_height;

    var x = (0 - b_width/2) + this.char.namepop_ox;

    var y = (0 - b_height - 48) - this.char.namepop_oy;

    this.namepop_sprite = new Window_CharacterPop(x,y,b_width,b_height,this.char);

    this.namepop_sprite.opacity = this.char.windowOpacity; //Nel Add

    //###Change Font, Font Size, Color, and Time based off Character values##

    this.namepop_sprite.contents.textColor = this.char.namepop_color;

    this.namepop_sprite.contents.outlineColor = this.char.namepop_outlineColor;

    this.namepop_sprite.contents.outlineWidth = this.char.namepop_outlineWidth;

    this.namepop_sprite.contents.fontSize = this.char.namepop_size;

    this.namepop_sprite.contents.fontFace  = this.char.namepop_font;

    this.namepop_sprite.contents.fontItalic = this.char.namepop_ital;

    this.namepop_sprite.drawTextEx(this.namepop, 0, 0);//, b_width, b_height, 'center');

    this.text_timer = this.char.namepop_time;

    this.namepop_time = this.char.namepop_time;

    this.addChild(this.namepop_sprite);

this.z = 8;

};
to get all characters on map to display above pictures.
 
Last edited by a moderator:

Nelderson

Coding *****
Veteran
Joined
Mar 17, 2012
Messages
165
Reaction score
168
First Language
English
Primarily Uses
RMMV
Huh....looking through the code, they did indeed give a Z axis...but only to sprites and not windows.  So the problem is that there is no window Z axis to take advantage of.  

I have an idea for a workaround though.....what if you used blank events to pop up the windows, and since their sprite is blank you can utilize the z axis to keep it above the images?  How many times are you planning to run textpop in your game as this may require a more intricate solution?
 

Overclocked

Overclocked
Member
Joined
Feb 8, 2013
Messages
18
Reaction score
1
First Language
English
Thank you for taking a look. I'll stick with what you said about the blank sprites as it is the best solution at the moment. It might even work out alright since I can create events on top of others using an event spawning script from EST.

I was planning on running the textpop primarily for "conversations" between events that you can listen in on when you get close enough. I do plan to use it liberally in-game though because it is a really nice plugin for bringing populated environments to life.

Anyway, I'm still rather new to Javascript and scripting in general but I feel like I'm learning fast. If I end up finding out how to achieve this "in script" I'll let you know.

Thanks again.
 

Yuudai

Burritoman!
Veteran
Joined
Dec 16, 2014
Messages
42
Reaction score
18
First Language
German, English
Primarily Uses
Hey great work on this plugin I love it!

using it to show names above towns caves ect on my worldmap

is there any way to make this plugin compatible with Sanshiros Analog Movement?

because right now whenever I use it the character just stops moving when I touch the event its like a wall  ;_;
 

DavidFoxfire

Veteran
Veteran
Joined
Feb 28, 2014
Messages
224
Reaction score
44
Primarily Uses
What I'd like to see is whatever or not you can change the Text Pop, or even remove it, by a Script Command.

I'm asking this because I'd like to see "!" and "?" over some character's head.  RPG Covention used for Quest Givers, of course.
 

Nelderson

Coding *****
Veteran
Joined
Mar 17, 2012
Messages
165
Reaction score
168
First Language
English
Primarily Uses
RMMV
What I'd like to see is whatever or not you can change the Text Pop, or even remove it, by a Script Command.

I'm asking this because I'd like to see "!" and "?" over some character's head.  RPG Covention used for Quest Givers, of course.
To change the text just use a new plugin command or script call....something like:

this.NastyTextPop({text: 'Some sort of text here...',})As for reseting options/removing text you can set the text to "" or use the ResetTextOptions plugin command....which I just noticed is not in my documentation  <_<
 

yongilcool

Veteran
Veteran
Joined
Nov 7, 2014
Messages
60
Reaction score
10
First Language
English
I am using this script very usefully  thank you! :)

if it's not too much of trouble,  is there any chance you could enable the gradient colored text?  I was wishing to use it for the damage text popup.
 
Last edited by a moderator:

Krimer

Veteran
Veteran
Joined
May 10, 2013
Messages
147
Reaction score
108
First Language
Ukrainian
Thanks for plugin!

But as i can see it has some problems with custom fonts

Im trying to change default font and got this



It seems to cut off end of text.

I called it by plugin command not the script call.

With default fonts its working fine.

I was testing with this font - link
 

Nelderson

Coding *****
Veteran
Joined
Mar 17, 2012
Messages
165
Reaction score
168
First Language
English
Primarily Uses
RMMV
I am using this script very usefully  thank you! :)

if it's not too much of trouble,  is there any chance you could enable the gradient colored text?  I was wishing to use it for the damage text popup.
I'm not sure what you mean by this?  Do you want the color codes used everywhere else in the engine?  A better question:  What else in MV uses this gradient colored text you want?

Thanks for plugin!

But as i can see it has some problems with custom fonts

Im trying to change default font and got this



It seems to cut off end of text.

I called it by plugin command not the script call.

With default fonts its working fine.

I was testing with this font - link
Two Ways to solve the problem:

1.  If you are using the font for a few things simply add blank spaces on the end of the text.  The width is based off the string length, so just make it bigger.  (And as a side note it'll work for putting blank spaces in front of the text too.)

2.  If you are going to use this a lot, I would suggest messing with line 573:

var b_width = (this.namepop.length * (this.char.namepop_size/2) + 24)+this.char.namepop_width;Fiddle with the +24 number and make it bigger.  When I calibrated the script I used the default font.  But some fonts are different sizes just based off the way the are made.  And as good as I am....I'm not that good  :D
 

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
259
Reaction score
117
First Language
English
Primarily Uses
RMMZ
Hey Nelderson,

Great script but I'm having a bit of an issue with them not showing properly. I see approximately 50% of the text (the top of it) as the rest seem to get cut off. Now.... looking through the thread, I assume it might be a z.axis issue (as you said Windows don't have a Z axis); and I'm using OrangeLighting which adds that blanket layer of darkness for lights and stuff. :p

So I'm thinking that might be the issue. I'll attach a screenshot here in a second, but I was just wondering if it's possible to fix this -without- using Events to pop up the messages on? Seems silly to do:
<> copy event1 from Map 1 to hereX hereY
<> Do popupmessage
<> delete that event

Every time (and yes I do plan on having a lot of messages pop up lol. It's already embedded into many of my systems (the alignment Events, popups say when you gain/lose a Path Rank (Path of Humanity.... Redemption(good) / Damnation(bad)... vampire RPG ya know :p  ) among many other things. So I would really love you for the rest of my life ((Platonically)) for some help on this <3   Okay now for the screenshot, and enough blabbering:


TestingArea.png
 
Last edited by a moderator:

Nelderson

Coding *****
Veteran
Joined
Mar 17, 2012
Messages
165
Reaction score
168
First Language
English
Primarily Uses
RMMV
Hey Nelderson,

Great script but I'm having a bit of an issue with them not showing properly. I see approximately 50% of the text (the top of it) as the rest seem to get cut off. Now.... looking through the thread, I assume it might be a z.axis issue (as you said Windows don't have a Z axis); and I'm using OrangeLighting which adds that blanket layer of darkness for lights and stuff. :p

So I'm thinking that might be the issue. I'll attach a screenshot here in a second, but I was just wondering if it's possible to fix this -without- using Events to pop up the messages on? Seems silly to do:
<> copy event1 from Map 1 to hereX hereY
<> Do popupmessage
<> delete that event

Every time (and yes I do plan on having a lot of messages pop up lol. It's already embedded into many of my systems (the alignment Events, popups say when you gain/lose a Path Rank (Path of Humanity.... Redemption(good) / Damnation(bad)... vampire RPG ya know :p  ) among many other things. So I would really love you for the rest of my life ((Platonically)) for some help on this <3   Okay now for the screenshot, and enough blabbering:


View attachment 29881
Looks to be a height issue.  What script call/plugin call you using?
 

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
259
Reaction score
117
First Language
English
Primarily Uses
RMMZ
standard plugin inputs. I didn't mess with the script at all ((only mentioning this because there are some other plugins (even core RMMV plugins I've messed with (like objects.js) that I've edited to work with some things with my game.)

I'm mostly only good with reverse engineering... not creating from scratch :\  

screeny.png
 

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
259
Reaction score
117
First Language
English
Primarily Uses
RMMZ
*Pokes Nelderson to see if he's still alive, while aware that he might be busy* :p
 

Nelderson

Coding *****
Veteran
Joined
Mar 17, 2012
Messages
165
Reaction score
168
First Language
English
Primarily Uses
RMMV
*Pokes Nelderson to see if he's still alive, while aware that he might be busy* :p


Extremely busy....with that said...


Try putting this in a script call.  If I had to put a guess on it'll probably be the font you are using, but not to worry!  If this does work I can show you how to change it so you can use the easier plugin calls and still have the correct size.


First try this:


this.NastyTextPop({
id: -1,
time: 60,
template: 1,
windowOpacity: 0,
height: 200,
text: 'Test Over Yours',
})


If this doesn't allow you to see the text more, then I'll need a demo which you can PM me.  


If it does allow you to see more, then there's a more permanent fix by editing line 574:



var b_height = (this.char.namepop_size + 28) + this.char.namepop_height;




Focus on that 28 number and increase it till it makes sense with the font that you are using.


Good luck, and thanks again for the patience!
 
Last edited by a moderator:

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
259
Reaction score
117
First Language
English
Primarily Uses
RMMZ
@Nelderson using the script call didn't make it show up at all. Also I tried creating a new project with just your plugin, and it seems to work fine (using default font by the way; so that shouldn't have been the issue). I'm thinking it's one of the other scripts that's causing this problem (probably OrangeLighting ?) I'll assemble a demo.
 

Jarinity

Warper
Member
Joined
Feb 9, 2016
Messages
2
Reaction score
1
First Language
English
Primarily Uses
Could you please give me an example of how to use resettextoptions? I use the plugin within another plugin, so not using a script call. I reference events like so:


var event = $gameMap._events[x];


How can I remove the text from this event?


Also I was wondering how I can permanently keep the text on an event, so that time isn't accounted for, it stays there until I take it off.


Thanks! Great script btw :)
 
Last edited by a moderator:

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
259
Reaction score
117
First Language
English
Primarily Uses
RMMZ
*grovels* Nelderson! Your people need you <3 :p
 

Nelderson

Coding *****
Veteran
Joined
Mar 17, 2012
Messages
165
Reaction score
168
First Language
English
Primarily Uses
RMMV
@Nelderson using the script call didn't make it show up at all. Also I tried creating a new project with just your plugin, and it seems to work fine (using default font by the way; so that shouldn't have been the issue). I'm thinking it's one of the other scripts that's causing this problem (probably OrangeLighting ?) I'll assemble a demo.


@lordvalinar So I tried to figure out the incompatibility in the demo and couldn't completely find it.  If you place my script at the bottom of the list it does work fine.  I double checked all my methods and exposed variables and nothing seemed to conflict.  I have a feeling someone overwrote a default method somewhere throwing off the aliasing in my script.  Either way, try throwing my script at the bottom for now, and see if anything else breaks :)


And thanks for being so patient, it's been an extreme week.  (Wifey almost burned down the house leaving the stove on..)

Could you please give me an example of how to use resettextoptions? I use the plugin within another plugin, so not using a script call. I reference events like so:



var event = $gameMap._events[x];


How can I remove the text from this event?


Also I was wondering how I can permanently keep the text on an event, so that time isn't accounted for, it stays there until I take it off.


Thanks! Great script btw :)


@Jaranity You should be able to put:


resettextoptions 5 7 8 9




Where the event ids are 5, 7, 8 and 9.  
 
Last edited by a moderator:

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
259
Reaction score
117
First Language
English
Primarily Uses
RMMZ
@Nelderson WOOT! That works! Thank you so much! And no probs ((although tell her maybe she should get OUT of the kitchen :p ))
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,881
Messages
1,017,227
Members
137,607
Latest member
Maddo
Top