Ruby/RGSSx questions that don't deserve their own thread

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
845
First Language
English
Primarily Uses
RMMV
Sure, you can do that with one window. Just make compact and full-size draw methods (or combine the two into one and pass an argument to specify full-size). Then whatever item index is currently active, perform a refresh to re-draw that one full-size while the rest are drawn as compact. The item rect would also need to change between full-size and compact for selection purposes.


Multiple windows could mean a little less re-drawing if you made a window for each character that toggled between compact and full-size, but that might also be a little more complex to pull off.
 

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
679
First Language
Polish
Primarily Uses
Other
Thanks for reply,

I'll try some things... also how to get party member's position? $game_party.members[index] or something like this? How to use that properly in condition for if/case?

Something like: If someone is leader (1st pos) it draws full size, if somebody is on 2nd pos. it also draws full size, and else make compact size.

about another window I thought about putting all of reserve members in second window, so in the first default, there would be 2 actors with full size, and in the other window reserve members with compact size status...

I'm kinda confused now...
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
845
First Language
English
Primarily Uses
RMMV
The following is from 'Window_MenuStatus' :

Code:
  #--------------------------------------------------------------------------  # * Draw Item  #--------------------------------------------------------------------------  def draw_item(index)    actor = $game_party.members[index]    enabled = $game_party.battle_members.include?(actor)    rect = item_rect(index)    draw_item_background(index)    draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)    draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)  end
Now, each selectable window has the @index variable. @index is the currently selected index, so just use that to determine which character should be drawn in full-size. The rest are done using a compact draw method. The same thing can be used whenever you're calculating the item rect (the selection rectangle which highlights the currently selected item).
Code:
  #--------------------------------------------------------------------------  # * Get Rectangle for Drawing Items  #--------------------------------------------------------------------------  def item_rect(index)    rect = Rect.new    rect.width = item_width    rect.height = item_height    rect.x = index % col_max * (item_width + spacing)    rect.y = index / col_max * item_height    rect  end
You'll have to overwrite the above method (taken from 'Window_Selectable') so that the current @index is highlighted correctly. For the Y value, you'll need to calculate the size of the compact view and multiply that by the current index or however you want it done. If you don't change this, the selection rect will be way off.
 

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
679
First Language
Polish
Primarily Uses
Other
It seems that I have problem with this.

I can't setup that properly, only messed up menu. =P

I could easily do that in another custom menu, but the thing is that it wouldn't be displayed when using items etc.

Damn my scripting skills... or lack of them.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,930
Reaction score
13,567
First Language
English
Primarily Uses
RMMV
This is evolving into something that needs its own thread, as it's quite a bit more complicated than you initially anticipated.
 

Rikifive

Bringer of Happiness
Veteran
Joined
Jun 21, 2015
Messages
1,441
Reaction score
679
First Language
Polish
Primarily Uses
Other
This is evolving into something that needs its own thread, as it's quite a bit more complicated than you initially anticipated.
That's right. I noticed that earlier and moved my question into its own thread, which could be find there. =)

Yeah, I should mentioned that here, sorry.
 
Last edited by a moderator:

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,350
Reaction score
14,059
First Language
English
Primarily Uses
RMVXA
Inside the make_item_damage method, how can you access the target of all of that damage, as all I see is user (for the user of the item), and item (for the item used)? So, how does it know who to apply the pdr, mdr and such to? After all, the user would make 0 sense, and the item is usually a skill, so how is it accessing that data from the target?

Specifically,I need to know this as I want to be able to access the states of the target of the item damage inside the make_item_damage method, so I need to know how this in order to be able to do what I want.
 
Last edited by a moderator:

Rukiri

I like to make Action-RPGs
Veteran
Joined
Jan 20, 2014
Messages
842
Reaction score
512
First Language
English
Primarily Uses
Other
Here's the math.

radians = degrees * Math::pI / 180degree = radians(Math.atan2(hero.y - ai.y, ai.x - hero.x))hero and ai are arguments that can be changed by just calling it in an event. 

Well let me explain what the script should do, the hero or event can one or the other back based on the degree shown in the math example.   

While as simple as this is I've never actually gotten it to work, if anyone can help it'd be appreciated. 
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,930
Reaction score
13,567
First Language
English
Primarily Uses
RMMV
@bgillisp - what class is that method in? If it's in Game_Battler, then self would be the target.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,350
Reaction score
14,059
First Language
English
Primarily Uses
RMVXA
@Shaz: Thanks, that was what I was forgetting.
 

sokita

Crawling back to the surface
Veteran
Joined
Apr 27, 2014
Messages
198
Reaction score
29
First Language
Indonesian
Primarily Uses
Is there a way to check a troop id if it contains certain enemy?

Thanks.
 

KockaAdmiralac

Cube-shaped garbage can
Veteran
Joined
Jun 15, 2015
Messages
569
Reaction score
153
First Language
Serbian
Primarily Uses
N/A
class Game_Interpreter  def contains_enemy?(enemy_id, troop_id)    $data_troops[troop_id].members.each{|m|return true if m.enemy_id == enemy_id}    return false  endendAnd then do a script call to

Code:
contains_enemy?(<your enemy id>, <your troop id>)
 

sokita

Crawling back to the surface
Veteran
Joined
Apr 27, 2014
Messages
198
Reaction score
29
First Language
Indonesian
Primarily Uses
class Game_Interpreter  def contains_enemy?(enemy_id, troop_id)    $data_troops[troop_id].members.each{|m|return true if m.enemy_id == enemy_id}    return false  endendAnd then do a script call to

contains_enemy?(<your enemy id>, <your troop id>)
Ah Thank you very much KockaAdmiralac_FINALLY. Now I can make a better monster generator.
 

WorldWakeSTU

Veteran
Veteran
Joined
Feb 5, 2015
Messages
95
Reaction score
6
Primarily Uses
Looking for code to make "press enter" fade in and out like old console games.
 

Heathurr

Veteran
Veteran
Joined
Aug 10, 2015
Messages
38
Reaction score
2
First Language
English
Is there a variable somewhere that'll let me add a wait time between actions in battle? My PCs and mobs attack so quickly after one another that it looks like they're trading blows. It's really distracting.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,930
Reaction score
13,567
First Language
English
Primarily Uses
RMMV
You must have a script that's making it do that, because the default behaviour is for each one to wait its turn. Post a new thread and include a link to the battle system you're using. (don't paste the script into your post).
 

lithkast

Quirky mini boss
Veteran
Joined
May 12, 2014
Messages
105
Reaction score
49
First Language
english
Primarily Uses
How do I set it up so whenever a character levels up, it stores a value in a variable.  Each character would have their own variable for this.  This is essentially a poor man's talent system.

Character A levels up to level 2.  Gains 1 talent point which is stored in a variable. 

Chareacter A can spend that talent point on stats and abilities.

I just don't know how to add +1 value to a variable on each level up.​​
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Hello I buyed RPG Maker VX Ace a long ago and I want to use it again but in the meantime I changed my pc but I lost the paper with my product key on so I can't use RPG maker again... someone can help me please ? or there is no hopes ?:'( ( I have a bad english I'm sorry )
I was away this days here in the forum but it was for a good cause!
The trailer of the demo of Luke Inn is on youtube and I am so happy!
I need to see the bugs of the game but I am happy that I have new content to show!

The last part of the modern interior will be ready soon. This will be a B-tile. With interior items for the kitchen, bathroom, toilet and storage room.
This frantic shooting ARPG plugin for MZ looks really great. Here is the link to a post from the official Japanese RPG Maker forum.

Forum statistics

Threads
102,941
Messages
996,136
Members
134,399
Latest member
Nyabee
Top