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

The list of actors is in Window_Target. You'll see Scene_Item and Scene_Skill both instantiate this window, and after the item/skill have been selected, they make this window appear so the player can choose the target. Then they do some more processing to apply the item/skill effects to that target.


If you just scan through Scene_Skill and Scene_Item and see where they make reference to this window, you MAY be able to do the same with your event system. However, you WILL have to instantiate the window and put it into a variable, and this will need to be done via script. Maybe you could make @target_window an accessible property of Scene_Map.
Thanks a lot for the reply, Shaz. My scripting knowledge is still very basic, but I'm learning slowly by diving in and tinkering with things. What you are suggesting seems a bit out of the scope of my abilities right now unfortunately. Would I be better off making a request thread about this?
Absolutely! Make it clear that it's to interface with your evented skill tree system. State how you want to call the script, what you want to pass into the call, and what you want it to do:


- should it allow selection of ANY actor?


- should it allow selection of the entire party?


- should it allow selection of only dead or alive actors?


- should it allow selection of enemies? Are the enemies on the map or in the regular battle screen?


- will the targets change depending on the skill? Will it just use whatever is listed in the database (one/many, ally/enemy)


- should it set any variables, or just update wherever 'target' is stored?


lots of other questions, so include as much detail as you can.
Hi, I am a teacher and I make a math game for my class.

At one point the player hast to enter a decimal number. The player gives the answer through the nameinput command, which i changed a little.

Now he can choose only between numbers, the windows are smaller and at the bottom.

My Question,... How can i show the mathquestion in a message box above the nameinputboxes at the same time?
You would have to further modify the script. I wouldn't bother about a message box - I'd just make the name input box larger, the name input entry lower down, and have it display the text higher up. To do this though, if you don't want ALL your name input boxes to be like this, I'd copy the script and give it a new name so you've still got the original version and can use the modified version via a script call even.
But why name input when there is a number input already?
number input would probably not let you enter a decimal number. It would require modification too.
ah, I see... because the name input has a period
You would have to further modify the script. I wouldn't bother about a message box - I'd just make the name input box larger, the name input entry lower down, and have it display the text higher up. To do this though, if you don't want ALL your name input boxes to be like this, I'd copy the script and give it a new name so you've still got the original version and can use the modified version via a script call even.
Ok, I will try it that way. But where do i put the text to display it in the name inputbox?

The text consists of ingamevariables so i can't load it like this in the Text character table, because of an undefined method error nil:nilclass.

#-------------------------------------------------------------------------- # * Text Character Table #-------------------------------------------------------------------------- ENGLISH = [ '1','2','3','4','5','.', '6','7','8','9','0','OK', '','','','','','', $game_variables[1]] TABLE = [ENGLISH]Do I put the text here after the last index?

#--------------------------------------------------------------------------# * Text Character Acquisition#--------------------------------------------------------------------------def characterif @index < 17return TABLE[@mode][@index]elsereturn ""endendAnd how would I refresh the box without losing the text?

Code:
  #--------------------------------------------------------------------------  # * Refresh  #--------------------------------------------------------------------------  def refresh    self.contents.clear    for i in 0..17      rect = item_rect(i)      rect.x += 2      rect.width -= 4      self.contents.draw_text(rect, TABLE[@mode][i], 1)    end  end
Little question to throw in here, please don't skip over the guys above me who are still looking for help.

This one should be pretty simple. I'm trying to teach myself how to do more things with scripts. Using RMXP, so that's outdated RGSS1. Right now I'm making a little window that I can call and dispose of when needed. That part has been good so far with some handy tutorials, but I need a bit of help with syntax.

In the line where you actually put what to draw in the window, I have something basic like this:

self.contents.draw_text(0, 0, cx, 32, "Text Here!")I'm wondering what the proper syntax would be to display a variable in the window (the numerical value of the variable, if that makes a difference). Would I set the code up like above, and just replace the quoted text with something, or is displaying things besides raw text handled differently? Thanks for the help!

PS: If there are any collections of common script commands and syntax out there that you know of, please feel free to link them too. I did a few quick searches in the past, but most of what I find is geared towards RGSS3, being the new shiny version out there.
PS: If there are any collections of common script commands and syntax out there that you know of, please feel free to link them too. I did a few quick searches in the past, but most of what I find is geared towards RGSS3, being the new shiny version out there.
If XP has the same basic help system that ACE has, there's  a lot of good stuff in there. Look under the 'reference' material section under the contents. Hopefully it will give a listing of game classes and their methods, so you can find the one you need and see exactly what syntax the method expects.
Yeah, as far as I'm concerned, the help file does provide a good help in terms of basic needs when it comes to scripting...
Yeah, XP doesn't have any of the nice text formatting and escape codes built in. You COULD add them yourself - the structure would be fairly similar to Ace. But if you just want to put a variable in your text, it'd be formatted like this:

Code:
self.contents.draw_text(0, 0, cx, 32, "Text Here!" + $game_variables[x].to_s)
Unfortunately the RMXP help file, while having a lot of RGSS info in there, doesn't get into the specifics that I'm really looking for. It's almost like it's in another language altogether at some parts, but that's most likely a result of me knowing next to nothing about scripting, haha.

Anyway, thanks for the help everyone. And Shaz, while I didn't really understand the first part of your post, the code you posted did the trick.

What would be awesome is a list of the checks you can do for "if" cases really. I've discovered some handy things like:

if self.is_a?(Game_Actor)
Code:
if self.skill_learn?(x)
...and things like that. Other conditionals like if certain states are applied, or if a certain element is included in a skill/weapon attack would be awesome. Does anyone know of any collections like that? If nothing like that is out there, I guess I'll just have to pop into this topic every so often to get some more syntax help, haha.
I'm not aware of a collection like that. Doesn't mean there isn't one though.


I learned a whole heap by looking through Game_Interpreter. Everything you can do in events is handled in that class, so you can scour through it to find the script equivalents of all the event commands, and from there, develop some more of your own. The only other thing you can do is look at all the different scripts and see what methods are available to call for each class.
Oh! Thanks a bunch for the tip; I'm finding a ton of useful stuff in those Interpreters.

I've been working out different skill ideas that I have, like a passive skill that increases damage reduction when guarding, one that has a %chance to restore MP to someone when they take damage, and things like that. I've figured those out after much trial and error, but the most recent one is still a bit lost on me.

I'm doing up another passive skill that restores 10% HP when defending. I found the instance in Scene_Battle 4 where defending is handled, but implementing this skill has been giving me trouble.

Here's what I have so far:

if @active_battler.skill_learn?(10)  @active_battler.hp += @active_battler.maxhp / 10endIt works wonderfully, but it does not give the damage popup unfortunately. I tried adding this line right after the HP restoring line:

@active_battler.damage_pop = truebut that just causes the game to hang for a moment and still not give me the number popup. I thought I saw that syntax for damage_pop used somewhere else in the scripts, but something's not working right here. Any advice?
Probably open up a new thread for the pop-up problem because it will be more fitting to discuss that on it's own thread. 🙂
I was working with yanfly's skill cost manager. Was wondering if there was a way to make a skill require more than one item. I have


<custom cost requirement>


$game_party.item_number($data_items[21])>= 1


</custom cost requirement>


I also wanted to add


$game_party.item_number($data_items[20])= 1


Is that possible?
that deserves it's own thread... but to answer, yes


you can always do


<custom cost requirement>


$game_party.item_number($data_items[21])>= 1 and $game_party.item_number($data_items[20])= 1


</custom cost requirement>


or if that doesn't fit


<custom cost requirement>


x=$game_party.item_number($data_items[21])


y=$game_party.item_number($data_items[20])


x>=1 and y>=1


</custom cost requirement>
Thanks. I figured it was a small question, so I wasn't sure.

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