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

Quick question.  I've been editing the core scripts and have been doing pretty well, however, I'm trying to achieve something for a non-battle, adventure game.  Basically I want to take out the horizontal category selection for items to only show the help window and item list (showing just key items) straight from the main menu.  I know that this is what bring up the specified item list while IN the item menu.

@category_window.item_window = @item_windowIt's in Scene_Item but I've been racking my brain trying to figure out how to bypass this to just have it bring up the help window and key items list right off the main command menu (from Scene_Menu).  Any help would be appreciated!
Do a search - this has been asked and provided at least 3 times, two of them from me.


http://forums.rpgmakerweb.com/index.php?/topic/17887-change-the-inventory/


http://forums.rpgmakerweb.com/index.php?/topic/17184-menu-items-tab-request/
Guess I can't trust Google then. lol

Thanks for the links.  Checking them out now.
forum search is better than google search. Especially if you narrow it down to the Ace scripts forums.
Seems that even doing that might have been off since getting the right keywords would be harder to do.  Regardless, got it working (thanks a ton Shaz!) and further customizing the various scenes and windows.
I've got a prob with force action not complying due to yan fly battle engine, the error is as follows

Script ‘YFbattlengine’ line 688: NoMethodError occurred.

undefined method ‘forced_action_remove’ for switch: module

i tried to find yan fly battle engine in amoungst rgss3 scripts and went to yanfly channel, but it's 'out of commision'

thanks again for any help 🙂
You need yanfly's "ace core engine". Yanfly's battle engine doesn't support forced actions properly without it.
If you need more help with this, please start a new thread and provide a link to the script.
thanks for the help 🙂
[RGSS3]

I'm trying to make a custom formula for skills that adjusts damage based on a variable.

When the weather is cloudy variable = 0. When sunny variable = 1. When rainy variable = 2.

def weather_variance(a, #attack power goes up if it's sunny, and down if rainy if $game_variables[24] = 0 return a.mat * 4 - b.mdf * 2 else if $game_variables[24] = 1 return 15 + a.mat * 4 - b.mdf * 2 else return 15 - a.mat * 4 - b.mdf * 2 end endI'm sure the problem is when I call on the formula, the variable is 'set' to 0 instead of check 'if' it's 0.

How should I write this so that it checks the variable?
It should be $game_variables[24] == 0
Ay. Thanks.
I'm back with another question to which there is probably not a good answer!


Is there a way to tell if any key is being pressed? I don't particularly care which key is being pressed. It's just a "wait for any input whatsoever" type of situation. I know I could Input.trigger?🙂C) or Input.trigger?🙂B ), etc, etc, but I'm just wondering if there's an easy way to check for any.
There isn't a pre-defined way but you can always add your own methods. Here's an ugly hack (RGSS3's Input methods are still supporting button numbers (including “invalid” ones like 24) which means this is also compatible with RGSS1 and 2):

def Input.any_press? #2.upto(29).any? {|i| press? i}  [*2..29].any? {|i| press? i} # Ruby 1.8.1 :/endNah, that's really ugly. What about this?

def Input.any_press? constants.any? {|i| press? i}endBut I recommend the following one (RGSS3 only) because the former one could stop working if you define other constants under Input.

class Input BUTTONS = [ :LEFT, :UP, :RIGHT, 😀OWN, :A, :B, :C, :X, :Y, :Z, :L, :R, :SHIFT, :CTRL, :ALT, :F5, :F6, :F7, :F8, :F9 ] def self.any_press? BUTTONS.any? {|i| press? i} endendEdit: I had to make the first ugly method uglier. Thanks, Ruby 1.8.1!
Input is a module, not a class, but it otherwise seems to do the job. Pretty much what I thought I'd have to do, only nicer. I should really learn the obj/block syntax that's used with a lot of methods like any. Time to pour over some documentation.
btw, there are scripts for full keyboard trigger I believe... if you want to have scripts run when a certain button is pressed
Is there a chat room or something I can use to get assistance for one of my more pressing bugs?  Its not something easily explained, and I'd prefer not to type out a manifest to have people understand it.

In a nutshell, I'm attempting to create events in one map, and plant them into another.  I have a global variable that is pushing events into the event array of the active map, and I'm not sure what issues are being caused.  It quite simply doesn't switch pages on the new events.  I've tried a bunch of things to solve this issue.

I feel like i'm missing something.  I set the events up, I push them with changed mapid, id, x, and y coordinates, and they don't like the interpreter for the new map.

# Solved #

The scope level of my map id change wasn't correct.  I was telling a returned map id to equal the new id, rather than forcing the original map_id to be changed.  This has been since resolved and all issues with drag and drop events have been solved.

http://forums.rpgmakerweb.com/index.php?/topic/19278-vx-12142013-map-virtualizationindev-extras/?p=184979
How do I refer to an enemy's def (defense) inside the Game_Enemy class? If I type def the script colours it as if I'm creating a method name.


Do I just have to use self.def whenever I want to use this? Or do I have to do enemy.def?
yeah I think it's self.def if you're already inside the Game_Enemy class
param(3) should work.

Original thread: https://forums.rpgmakerweb.com/threads/ruby-rgssx-questions-that-dont-deserve-their-own-thread.150/