Ahoy, great scripters, game makers and wanderers!
Today I tried to make a popup window which would appear above some specific events.
It would appear only when the event is triggered. All of these specific events are triggered by the action button method and all of them can appear anywhere on the map on any map.
The specific events are called @gather_events, they use notetags to distinguish themselves from the other events.
These events are "gathering events" made by this script:
http://www.caspergaming.com/Scripts/Ace/CSCA_Gathering.txt
What I am trying to do is to modify the popup window of that script, so that it pops up above the event itself rather than at a static point on my screen.
But I have no idea how could I do that, unfortunately. :(
Getting a popup above the player is not an issue, but unfortunately, for some reason it bugs out if using Tsukihime's Unlimited Resolution and pops up at some rather weird places sometimes.
I tried to mimic some hover alerts scripts, thought I could get the placement's definition or at least get close to it by looking through some of them, but it seems that I miss something.
So, can anybody please help me with this or point me to the right direction? *-*
Thankies!
Assigning a popup window to an event's position...
● ARCHIVED · READ-ONLY
-
-
You could try doing something with event.screen_x and event.screen_y - I THINK that gives you the bottom center coordinate of the event's sprite (you'd have to check Sprite_Character for that), so then you can do whatever math you want to offset your window (top left) x and y positions to center it over the event, or however you want it.
-
I tried to do it with that event.screen_x/y, but the problem is, I have no idea how could I define the actual events, so it always returns a nomethod error like that.
Anyway, I gave up on making it work above the events and went back to making it above the player, which seemed a lot easier.
Turns out, I was just dumb and forgot how to do that properly. The window appeared at weird places relative to the player's position because I kept the original definition of the window in that script, which initializes the window in a fixed place by default. Doing it like that requires an x and y position defined when creating the window in the scene class itself for the window on the game map, and that is what messed up the positions.
I removed the default initialization of the window and defined everything at the 'super(x,y,w,h)' line instead. This eliminated the need of defining x,y at the scene itself and apparently solved my issue.
Now I got a perfectly functional, dynamic sized window which always appears above the player when gathering. Yay!
Thanks for the help regardless! :) -
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.