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

Does the script editor have a limit on how many scripts can be in it?

I think, providing there are no conflictions within the scripts, there would be no limit, but I figured I would ask in case anyone has ever heard of such a problem.
I've never heard of a limit.
Practically no limit.

At least on RPG Maker XP where I once made around 9k sections and 1 million lines before I stopped. I didn't actually create it from within the editor so I dunno if there is a different there, but it could easily open, and all the code appeared to be present and accessible.

I assume it that you won't hit any limits for RPG Maker VX nor RPG Maker VX Ace.

Should actually hit some editor limit you can extract that code out of the editor and load it. (Remember to marshal the string so you can load it from encrypted archives)

*hugs*
Should actually hit some editor limit you can extract that code out of the editor and load it. (Remember to marshal the string so you can load it from encrypted archives)
Thats what I was thinking of doing (if a limit was encountered)

probably something along the lines of modifying $RGSS_SCRIPTS...
I have just checked it out. There is a limit on 1000 sections.

It does appear that the editor can manage extra sections when adding them with code though.

As for amount of code. Don't worry.

The editor does become rather sluggish and slow when I created a section with a little over 30 million characters.

*hugs*

 - Zeriab
lol I dont think I will ever hit that limit then.

Currently I have around 180 classes that *could* be given their own script page (its currently being held within 70-ish scripts) with around 100,000 lines of code total. (not including the default engines code)

Thanks for the info ^_^
Is there any way to run scripts in separate threads through RGSS? I'm running into a few performance issues and I can't think of much else I can do to make it faster besides multi-threading it.

According to this, it's possible to use separate Ruby processes instead of threads for paralellism, but I'm not sure RGSS allows access to that either. Has anyone ever looked into this?
You can maybe try fibers but AFAIK, real multithreading on RGSS is not supported
Fibers aren't threads, it just allows you to change what's running on the current thread for the time being. Both the fiber and what called the fiber are not processed at the same time.

Now I have a question of my own, is there any way to manually set the opacity of the cursor in a selectable window? I know ti changes automatically, but I want to be able to make it fully opaque (opacity = 255) once that window is no longer active, by default it stays at whatever opacity it was on at the time of deactivation.
sorry dude. You will have to rewrite the Window script or something if u want to achieve that.

I tried - for a long time. It just isnt possible (at least not for me).

IDK WTH they done when making the Window class, but I personally have tried everything I can think of. Without a real copy of the class to use as reference, I couldnt figure it out.
Ugh, all right then, thank you. I suppose it in't that important, but it would have been nice. I would really like for the programmers to give us more access and freedom with changing the very very base of the game engine. I understand why it's hidden, I just feel that there are many better ways to accomplish these things.

I should be fine without this though. It was really just a way to make the selected option more clear, but I can make my own way of doing so. Perhaps copying the rectangle and getting the cursor in my own bitmap to display it (I'm pretty sure they simply use stretch_blt to get the cursor to the right size), while setting the actual rectangle to be empty. I suppose that could potentially work.

Thanks again, I'll think of something.
no. dont stretch blt it. that wil make the corners come out all funky looking - noticably stretched.

Instead. you should create two bitmaps. one of the cursor bitmap and one the size you want the cursor to be.

simply hold the cursor bitmap in some variable and then blt the cursor bitmap image into your cursor space gradually.

That seems like I havent explained that very well... Let me get back to you

edit:

This may be more helpful to read.

This should be fairly close to what you want to achieve. Then you simply move the cursor around in the update method. Obviously change the Cache. to your preference.

Code:
  def init_method    @bm = Cache.your_choice(filename,hue?)    width   = 118    height  = 24    @cursor = Sprite.new    @cursor.bitmap = Bitmap.new(width,height)    iterate = 10    iterate.times do |i|      rect = Rect.new((width/iterate)*i,height, width/iterate, height)      @cursor.blt(iterate * i, 0, @bm, rect)    end  end
no. dont stretch blt it. that wil make the corners come out all funky looking - noticably stretched.

Instead. you should create two bitmaps. one of the cursor bitmap and one the size you want the cursor to be.

simply hold the cursor bitmap in some variable and then blt the cursor bitmap image into your cursor space gradually.

That seems like I havent explained that very well... Let me get back to you
I believe I understand. Please excuse.any mispellings?/incorrect words, i'm currently on phone.

I believe you mean have one bitmap be the cursor section from the windowskin file (32x32 or whatever). The second bitmap would be the same width/height as the rect's width/height. Then blt the sides on and continuously do the middle until the space is filled (the right side should probably be drawn after the middle is done).

Like that? However, I believe the current system in place uses stretch_blt, because when I had changedy cursor image to something that didn't take up the whole space (it was essentially just a bar on left side), it still worked fine. I'll look into it, though.

Thanks again.
yea, I think the method they used does do something along those lines.

I mean, it obviously uses the rect to set the width somehow - so its probably alot more elaborate than my suggestion.

And yes, that is what I meant. I updated my last post with a little code to illustrate🙂
Where is a good place to learn how to code scripts for RMVX Ace
youtube...
thanks
Where is a good place to learn how to code scripts for RMVX Ace
Start by learning Ruby in general, not Ace scripts. You'll need a moderate foundation in Ruby itself before being able to do much of anything reliably with Ace and its "API." Also, I vehemently disagree with using YouTube, considering a number of people giving tutorials on YouTube know about as much as they need to get themselves into serious trouble; they think they know what they're talking about, but most of the ones I've seen only have a basic grasp of the language.


By the way, when I say "learn Ruby," I don't mean Ruby on Rails -- Rails is a library and web framework, not Ruby itself. Learn the core language, learn its syntax and constructs. Once you have those, learn about Ruby idioms -- do what the Ruby community does, then learn why it's done that way. Once you have that foundation, you can look at the RPG Maker core scripts and understand them far better than you would by simply diving into them.


Alternatively, of course, you can do what I did: jump straight into the core scripts and learn to swim before you drown. Even after doing that, though, I followed my own advice once I got stuck: I started following Ruby itself instead of RPG Maker.
So whre would I learn ruby scripting? is there like a website or something?
https://www.ruby-lang.org/en/ Is a good site from what I have heard.

I agree with Solistra's statement..

I also dived in at 'the deep end' and started modifying Ace scripts. After a while you will become confused and learning proper ruby will be the only way forward.

The youtube videos and tutorials are only really helpful if you dont want to properly learn - and just want to gain some knowledge.

As someone once said to me...

There is a great difference between knowing how something does whatever it does and knowing why it does it that way.

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