RMMV Adding multiple windows during the battle scene

hohg

Villager
Member
Joined
Nov 10, 2021
Messages
9
Reaction score
3
First Language
English
Primarily Uses
RMMV
Hello, everyone. What I wish to do is make a system for seeing what attack an enemy is going to use on their turn. I know I can just use something like
JavaScript:
var x = $gameTroop._enemies[0]._actions[0]._item._itemId;
and then have a window under the enemy that writes out
JavaScript:
$dataSkills[x].name;

The problem is this; I don't know how to add multiple windows at once for each enemy, have the windows update accordingly and have them disappear upon said enemy's defeat and I'd like help in figuring out how to do this. Thank you in advance!
 

Kenen

Veteran
Veteran
Joined
Apr 3, 2012
Messages
394
Reaction score
361
First Language
English
Primarily Uses
RMMZ
I would personally do this with a sprite that is attached to each individual enemy instead of trying to draw multiple windows.

The default game code also has some existing sprites that you can take a look at, such as the damage popup sprites. You can use that code to get an idea of how to create, setup, update, etc. your sprites.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
4,977
Reaction score
4,592
First Language
English
Primarily Uses
RMMZ
You would probably want to write a plugin that creates a new window class (and handle the refreshing from within that class) and then add your windows to the battle scene the same way the other battle windows are.
 

hohg

Villager
Member
Joined
Nov 10, 2021
Messages
9
Reaction score
3
First Language
English
Primarily Uses
RMMV
Alright, thank you for the replies! I will check out both of these suggestions. Truth be told I figured getting the data on what attack the enemy is gonna use would be the hard part, shows how green I am, haha!
 

ZoeTornado

Villager
Member
Joined
Oct 5, 2021
Messages
7
Reaction score
4
First Language
English
Primarily Uses
RMMZ
if you're just trying to display something in the battle scene without an interactive component (your description seems to indicate this), using a Sprite to display your info will be easier to implement most likely. Being called a Sprite doesnt mean it has to be a png or whatever, its just a drawing (can be text, a window rectangle, etc) that gets generated onto the screen. In this way it will be lighter than making a new Window most likely since inserting Windows into the scene involves adding them to the various methods inside the scene that makes/updates/shows/hides/etc the windows, whereas drawing a sprite you can just insert into the part of the battle process where you want it to display and just draw it (and hide it or whatever when you dont want to show it). You can do this same sort of thing with a Window of course, but because of how the windows all belong to the window layer theres a few things that might be a little trickier iirc. When i added a mew Window.to my Battle Scene i had to put it into like 7 or 8 different methods inside thr battle scene to make sure it came up at the right time and accepted input etc, but if yours in non-interactive and more like a tooltip it may be a little less involved. I think at that point the main advantage of using a Sprite is probably just a speed thing for rendering since window objects seem to be a little slower to me anyway.
 

Latest Threads

Latest Posts

Latest Profile Posts

I'm still undecided weather or not I should add minor swearing to my game. Like I'm going for an all ages demographic... but the idea of a cartoon character saying dammit, hell, or crap in normal conversation is really funny to me.
If we assume an Elf's strong suit is Dexterity (AGI) & Intellect (MAT), I imagine Strength (ATK) & Constitution (DEF) would be among their lowest stats. But I'm having a hard deciding which should be lower, Strength or Constitution?
I'm really sorry to have to do this, but I'm going to have to start blocking those who repeatedly put up sexual content and offer absolutely nothing (that I've seen) related to what this community is supposedly created for.
Don't take it personal. I'm a rape victim with permanent injuries who can never enjoy 'it' ever again, so it's the last thing I want to have put in my face. :(
Check out my side project! It's a survival dungeon crawler! https://voidmoon-studio.itch.io/depths-of-delmora
RushLog wrote on HarlekinLehl's profile.
how do you attach those images to your posts?

Forum statistics

Threads
123,215
Messages
1,154,971
Members
161,596
Latest member
LilCronch
Top