Window_Selectable throws a formatting error in external editor. Why?

Bethins

Villager
Member
Joined
Nov 4, 2012
Messages
69
Reaction score
0
First Language
English
Primarily Uses
def item_rect(index)

rect = Rect.new

rect.width = item_width

rect.height = item_height

rect.x = index % col_max * (item_width + spacing)

rect.y = index / col_max * item_height

rect

end

I'm still learning and would like to understand why the "/" in the rect.y line throws the formatting off for the rest of the script in notepad ++.
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,600
Reaction score
2,360
First Language
French
Primarily Uses
this is normal 

/  = a way to seperate stuff and this can be use in string seperation like this 
:

Code:
module Cachedef self.something(filename)load_bitmap("Graphics/Something/",filename)endend
 

BoluBolu

Veteran
Veteran
Joined
Apr 24, 2014
Messages
452
Reaction score
117
Primarily Uses
@nio, I don't think that's the exact answer, the slash in your example used to move/look into a specific directory(folder in this case).

Three things that I know:

Usually forward slash is a divison operator used for math purpose, the other things that I know, forward slash is used for regexp too. And the last thing I know, it's like your answer, it used for separate between directory.

#OP

Hmm, It's not only in notepad++, I tried it to in sublime text and it does the same thing, athough it's not break the rest of code. I believe the "index"  in front of "/" is the culprit, but I don't know why, oh well I think I'll stick with this post, maybe there's someone can explain this =)
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,600
Reaction score
2,360
First Language
French
Primarily Uses
@nio, I don't think that's the exact answer, the slash in your example used to move/look into a specific directory(folder in this case).

Three things that I know:

Usually forward slash is a divison operator used for math purpose, the other things that I know, forward slash is used for regexp too. And the last thing I know, it's like your answer, it used for separate between directory.

#OP

Hmm, It's not only in notepad++, I tried it to in sublime text and it does the same thing, athough it's not break the rest of code. I believe the "index"  in front of "/" is the culprit, but I don't know why, oh well I think I'll stick with this post, maybe there's someone can explain this =)
oups made the error D:  sorry! well you mean the same thing of what I wanted truly to say XD
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,230
Reaction score
6,776
First Language
German
Primarily Uses
RMMV
The coloring in program editors is always based on the language used - a really good editor let's you choose the coloring scheme depending on the filetype, and then the coloring is different depending on whether you write a program for pascal, C++, html or whatever.


However, if the editor hasn't been told what language is written (or if he simply don't have support for that language), then the coloring changes can be off in any way, simply because the editor applies format changes based on entirely different program structures.


That is NOT a bug, it simply means that your editor doesn't support (or doesn't recognize) the programming language of the current file.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,501
Reaction score
12,044
First Language
English
Primarily Uses
RMMV
Can you show a screenshot? I put that into Notepad++ and it does absolutely nothing.


Is your file saved? What's the extension? Notepad might format according to file extension. Then you may be able to set up other rules that affects its behaviour too.


Anyway, this is not really a scripting issue - more an editor issue, so I'm going to move this to Program and Utility Discussion
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Can the Eternal Dreamers finish off the final boss? We'll see!
Fekken kill me. I unknowingly swapped out two important events's codes and saved the game to test it. I'm just doing this for fun and the fun has now been replaced with excruciating torture.
Is this how game developers feel all the time?

EDIT:
WAIT HOLY S***
MY LAST POST ASKING FOR HELP ON AN EVENT ACTUALLY SAVED IT
OH MY GOD
Coffee + Silk Coconut Milk + Splenda Zero = Not ..... awful :/ .
I was making a cutscene where Hero's dad got killed by the dragon but when he lose its say game over and send you to the tittle screen. How can remove game over for that cutscene
My new RPG Maker music pack, Emotional: Redemption, is now in progress and will be coming to RPG Maker soon. It is an album that focuses on emotional themes including the darker forms of sorrow and despair. Below is a demo of a composition from the album.

Forum statistics

Threads
94,447
Messages
920,996
Members
124,260
Latest member
Charles2020
Top