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

FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
thanks, the alignment thingy works fine! =)

but this square... god damn...

so, I tried it with different fonts = square

with fix = square

without fix = square

without word wrapping = no square, but text is goin out of window.

so it must be in this script snippet because this writes the square somewhere...

#-------------------------------------------------------------------------- # * Word Wrapping #-------------------------------------------------------------------------- def word_wrapping(text, pos = 0) # Current Text Position current_text_position = 0 for i in 0..(text.length - 1) if text == "\n" current_text_position = 0 next end # Current Position += character width current_text_position += contents.text_size(text).width # If Current Position > Window Width if (pos + current_text_position) >= (contents.width) # Then Format the Sentence to fit Line current_element = i while(text[current_element] != " ") break if current_element == 0 current_element -= 1 end temp_text = "" for j in 0..(text.length - 1) temp_text += text[j] temp_text += "\n" if j == current_element end text = temp_text i = current_element current_text_position = 0 end end return text end

I have no clue why this draws a square symbol oO
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
Try another word wrap script, maybe the others won't have that square symbol.


KilloZapit's Word Wrapper script is one of the best one for sure.


But if you won't plan on releasing your script for others, you are better off with hard-coding the texts and their positions instead of using a word wrap script.


Even if you plan to release your script, you can do it without relying on a word wrap script for sure.
 

FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
I use KilloZapit's Word Wrapper, but even his script wont wrap the texts... and I plan to release the script here as soom as this problem is solved! ^^

but really no clue why the hell it is not wrapped or it prints the square, this really bugs me off!
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
Okay, I got a question now too. :D


What's up with Window_HorzCommand?


Every time it's contents get wider than around the current Graphics.width*125%, it just stops scrolling with the cursor when the cursor reaches the X position of the mentioned limit.


The items are there, the cursor moves, but the drawn contents in the window will stay where they are until I enter within the limit again. This means the cursor will get off the screen after the limit.


Is there any way to prevent this? Or a workaround? Something? >.>
 

♥SOURCE♥

Too sexy for your party.
Veteran
Joined
Mar 14, 2012
Messages
693
Reaction score
411
Primarily Uses
Okay, I got a question now too. :D

What's up with Window_HorzCommand?

Every time it's contents get wider than around the current Graphics.width*125%, it just stops scrolling with the cursor when the cursor reaches the X position of the mentioned limit.

The items are there, the cursor moves, but the drawn contents in the window will stay where they are until I enter within the limit again. This means the cursor will get off the screen after the limit.

Is there any way to prevent this? Or a workaround? Something? >.>
Plug and play:

Code:
class Window_HorzCommand < Window_Command    def top_col=(col)    self.ox = (col < 0 ? 0 : col) * (item_width + spacing)  end  end
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
Too simple to be true, yet it is! :D


Thanks a lot!
 

FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
Uhm... I am curious... I want to change the opacity of all menu windows to a lower value.

Is there a way to do this at one place or must I adjust this in every window class?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
class Window_Base alias aliased_init initialize def initialize(*args) aliased_init(*args) self.opacity = 100 # or it could be back_opacity endendUse inheritance
 

FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
oh, sure!! this was too easy, omg ^^"

thanks!
 
Last edited by a moderator:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
While we are at windows and their opacity topic, I noticed something when I designed my menu engine...


If all windows on the scene are completely transparent, the FPS will get a whooping 100% boost.


I got from 30 FPS to a stable 55-60 FPS on a resolution of 800x608.


So, if it is possible, I suggest everyone to make their scenes with 0 opacity for all their windows (opacity, not contents.opacity, obviously), and instead use an image file to make the backgrounds/visuals for the windows in the form of a sprite created in the scene itself. Not only will it give countless new and unique ways for making the visuals of the scene, but will greatly increase performance.


Just wanted to share this info, in case someone will find it useful.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,517
Reaction score
3,221
First Language
Binary
Primarily Uses
RMMZ
Interesting...  So, your suggesting it uses less processing power to blt a semi  transparent image than it would with the same image but non transparent.

Think I'll benchmark that to be sure...

Edit:

Perhaps the window class checks if opacity is 0 before blting, which would explain faster processing...
 
Last edited by a moderator:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
My thoughts exactly, and it would make sense after all.


The only thing I did was to set all of my windows' opacity to 0, and my FPS doubled instantly.


Regardless of how many windows I used on the scene or how big they were, my FPS was on a stable 55-60.


I can barely reach that FPS on the default game resolution, and now I could reach it on much higher resolutions. *-*
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,517
Reaction score
3,221
First Language
Binary
Primarily Uses
RMMZ
Does it enhance map performance?  Cause I have employed a huge array of techniques to try help map performance, so that would be a helpful if it does ~ I dont use default windows on the map anyway (rarely) :D
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,848
First Language
English
While we are at windows and their opacity topic, I noticed something when I designed my menu engine...


If all windows on the scene are completely transparent, the FPS will get a whooping 100% boost.


I got from 30 FPS to a stable 55-60 FPS on a resolution of 800x608.


So, if it is possible, I suggest everyone to make their scenes with 0 opacity for all their windows (opacity, not contents.opacity, obviously), and instead use an image file to make the backgrounds/visuals for the windows in the form of a sprite created in the scene itself. Not only will it give countless new and unique ways for making the visuals of the scene, but will greatly increase performance.


Just wanted to share this info, in case someone will find it useful.
There have been observations that performance is improved when a sprite is not visible (ie: @visible = false)


They may be skipping certain things from updating when the window is not visible.
 
Last edited by a moderator:

FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
While we are at windows and their opacity topic, I noticed something when I designed my menu engine...

If all windows on the scene are completely transparent, the FPS will get a whooping 100% boost.

I got from 30 FPS to a stable 55-60 FPS on a resolution of 800x608.

So, if it is possible, I suggest everyone to make their scenes with 0 opacity for all their windows (opacity, not contents.opacity, obviously), and instead use an image file to make the backgrounds/visuals for the windows in the form of a sprite created in the scene itself. Not only will it give countless new and unique ways for making the visuals of the scene, but will greatly increase performance.

Just wanted to share this info, in case someone will find it useful.
interesting fact! I am anyway a friend of own menus with pictures, but the problem is not to get the windows invisible or the background image, it is the positioning or text sizes, fonts, layouts and so on. 

Sure, with enough knowledge it is "easy" to do (though it is a lot of work) but not for every beginner ^^
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Using that method, you only need to adjust the background picture, not the texts etc since you don't really edit the contents of the window in any way...
 

sokita

Crawling back to the surface
Veteran
Joined
Apr 27, 2014
Messages
198
Reaction score
29
First Language
Indonesian
Primarily Uses
Where the names of variables and switches are saved? I want to know because when I am working with a team, they usually uses variables and switches (eventing, scripting, mapping). So, if I know where they are, I can update my side from the team project and never get messed with double usage of variables or switches.

P.S.: I mean, in which .rvdata2 file?
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
I think that's internal... The game's scripts after all uses the array directly ($game_variables and $game_switches) instead of using names...
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
Where the names of variables and switches are saved? I want to know because when I am working with a team, they usually uses variables and switches (eventing, scripting, mapping). So, if I know where they are, I can update my side from the team project and never get messed with double usage of variables or switches.
$data_system.switches

$data_system.variables

Edit :

System.rvdata2
 
Last edited by a moderator:

FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
Using that method, you only need to adjust the background picture, not the texts etc since you don't really edit the contents of the window in any way...
Oh, yeah sure, I thought we talk about entirely custom menus. XD

But in that way, you're right!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,456
Members
137,821
Latest member
Capterson
Top