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

@Nikita

I know that, that's the point of classes in general.

And what will be other subclasses of Fire and Liquid?

Can you tell us more what have you planned to do with classes named like elements and show us your implementation?
And what will be other subclasses of Fire and Liquid?

Can you tell us more what have you planned to do with classes named like elements and show us your implementation?
Well... I was just messing around and doing nothing, But I wanted to create a mini world in just a script.

A little example:

Spoiler
class WorldendPlanet = World.newclass Ocean < World def Flood endendclass Island < Worldendclass Plant def inhale_OC2 endendclass Sapling < Plant def grow endendclass Tree < Sapling def grow_apples endendclass Rockendclass Grass < Plantendclass Liquid def go endendRock1 = Rock.newPacifist_Ocean = Ocean.newEurope = Island.newPlant1 = Plant.newSapling1 = Sapling.newOak = Tree.newSome_Grass = Grass.newWater = Liquid.new 
HUDFRGm.png


Put the little script into da spoilerrr.
Yeah, it can't be done...

World is to complicated to be written in Ruby 🙂
Yeah, it can't be done...

World is to complicated to be written in Ruby 🙂
Atleast a small and basic world can be done 😀
Why couldn't it be done?


If someone got the patience to do it, it can certainly be done.


With a good database setup and good coding (without over-complicating the code needlessly), it is really just a matter of time to do it... and a lot of willpower to keep on going until it is finished.


Btw, I am not sure that Europe is classified as an island. 😀


For the "double inheritance"... That is why we have modules. You can include any number of modules you want into any class.
@Sixth

Yeah, but that person would become a millionaire.

How would you program AI for that world?

And yeah, I was too much into JS lately I forgot that Ruby has modules XD
What AI? I don't see any AI mentioned. I meant on a database containing the stuffs of the "world".


But even if you want AI, why couldn't it be coded? Even the default engine got basic AIs programmed.


Basically, there are countless scripts out there for making an AI for something (no matter what, enemy AI, respawn counter, in-game time, and so on, the list is endless).


It is an automated process based on conditions. We can make conditions. We can trigger methods anytime. This means that we got everything for making an AI for anything.


The difficulty of programming any AI surely changes based on what kind of AI we want to make, but no matter how difficult is, it can be done.


Unless the "world" is meant to be a full 3D world, there is really no obstacles which could stop a programmer to do that said "world", regardless of which program language we talk about.


The applicable graphics (and some other functions) depends on what engine/PC we want the "world" to run, and because (sadly) RPG Maker VX Ace got no GPU support, full 3D is not something possible to make while keeping a playable FPS at the same time. But aside from that, code-wise, it is very much possible.
I meant, how would you program people?

Those would be called self-aware machines, and I don't think that's easy to achieve.

I don't even know how my awareness is working, how can I program somebody else's?

(But this is getting off-topic, I'll stop now...)
I'm very sorry 🙁 if I'm posting this in the wrong place but...

There's this script called Mail System by Evgenij.

Link here: http://forums.rpgmakerweb.com/index.php?/topic/32319-mail-system/

Broken link leads here: http://www.evgenij-scripts.org/?page_id=196

The link provided in the OP seems to be broken.

I'm just thinking maybe anyone who has a copy of the script would be kind enough to provide me with it?

Thank you for helping! 😀
I can't help with that, but especially since Evgenij is still active in this community you might try asking in the script thread first anyway. After all, it's beneficial for everyone if the author can fix the link himself. 🙂
@Another Fen

Thank you!

I'll try asking for it in his thread like you said. 🙂
How do I set these hover alerts to appear above pictures viewport? (I am using pictures for overlay so it can look wonky at times)

http://rmrk.net/index.php?topic=46911.0
In Sprite_HoverAlert->initialize find "self.z = 200" line. Try changing 200 to something like 999999999
In Sprite_HoverAlert->initialize find "self.z = 200" line. Try changing 200 to something like 999999999
I don't think that value goes above 200, someone actually mentioned that in the original topic as well.
The hover alerts use @viewport1, the pictures use @viewport2. @viewport2 has higher Z than @viewport1.


This means that no matter how high you set the hover sprite's Z value, it will always be below the pictures.


There is no easy solution for this, because the class which creates the hover sprites got no access to the map's spriteset, which contains the viewports.


You could make a separate viewport for the hover alerts, but that means that a new viewport will be created for each hover alert sprite. No idea if that will lower the game's performance or not.


Accessing viewports created in the map's spriteset seems to be a pain in the apple. I tried it, and it works, but only until I change the scene. When I try to exit the new scene back to the map, the game will freeze. >.>
So there's really no way to fix this then, really?
# Put [update] in the event's name and the move route will always update.## ~Kread class Game_Event < Game_Character #-------------------------------------------------------------------------- # * Determine if Near Visible Area of Screen #-------------------------------------------------------------------------- alias_method🙂krx_alfix_ge_nts?, :near_the_screen?) def near_the_screen?(dx = 12, dy = 8) # YEA compatibility if $imported && $imported["YEA-CoreEngine"] dx = dy = nil end # YEA compatibility return true if @event.name.include?('[update]') return krx_alfix_ge_nts?(dx, dy) endendI found this snippet of code in the Tips and Tricks for Vx Ace thread (#9), but I don't know where to put it in my scripts. Can you help?
Is it possible to get the option currently highlighted in a command window?
Hoping there's a simple way to do this.

I want to convert a range of numbers

(1..100)to an array with a limited index that distributes the range's numbers equally.

[1, 50, 100][1, 25, 50, 75, 100]I want to do this without having to know the exact number of values within the range.

Edit: Nevermind! Figured it out

  #--------------------------------------------------------------------------  # New Method: distribute  #--------------------------------------------------------------------------  def distribute(begin_value, end_value, array_size, return_ints = false)    diff = 1.0 * (end_value - begin_value)    n = [array_size-1, 1].max    (0..(array_size-1)).map do |i|      v = begin_value + i * diff / n      return_ints ? v.round : v    end  end # distributebegin_value = First value in array

end_value = Last value in array

array_size = Maximum number of indexes within array

return_ints = Round values to integer? true or false (optional)

Script Call

Code:
distribute(0, 100, 5, true)# => [0, 25, 50, 75, 100]
Can you call methods and variables defined in the script editor using the "script" event command?

EDIT:

You can.  I figured it out by myself, the method calls worked in the script command

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