Jaymonius

Veteran
Veteran
Joined
Mar 22, 2012
Messages
253
Reaction score
77
First Language
English
Primarily Uses
Hey there, Jaymonius here. Need a little assistance fixing this script.


It was last updated six years ago, but one individual mentioned already on that script that whenever you cancel when using the teleport system, the game crashes and brings up this error:

Script 'Easy Teleport' line 86: RangeError occured. bignum too big to convert into 'long'

If someone can help fix this, it would be great. I'm using the script as well, and want to get this little issue dealt with.
 

yeetMyDudes

Villager
Member
Joined
Feb 21, 2021
Messages
11
Reaction score
2
First Language
English
Primarily Uses
RMVXA
From what I'm understanding, the line "$game_message.choice_cancel_type = 999999999999" is the source of your problems, as that number is too large to be represented in the same way a regular integer could be (basically, it's just too absurdly large). I'm struggling to understand why the number is so immensely large in the first place, but I would suggest replacing both lines with a large number of 9 digits or less "$game_message.choice_cancel_type = 1000000" for example. I haven't used this script before, but that may be a push in the right direction. Hope that helps.
 

Jaymonius

Veteran
Veteran
Joined
Mar 22, 2012
Messages
253
Reaction score
77
First Language
English
Primarily Uses
Now I get:
Script line 85: NoMethodError occurred.

undefined method'[]' for nil:NilClass
 

yeetMyDudes

Villager
Member
Joined
Feb 21, 2021
Messages
11
Reaction score
2
First Language
English
Primarily Uses
RMVXA
Now I get:
Script line 85: NoMethodError occurred.

undefined method'[]' for nil:NilClass
Is this with cancelling, or generally? I'm going to attempt to run the script on my end, and see what I get. Also, if possible, could you provide screenshots of exactly what you're doing?
 

Jaymonius

Veteran
Veteran
Joined
Mar 22, 2012
Messages
253
Reaction score
77
First Language
English
Primarily Uses
Oh, it's specifically when I'm cancelling the teleportation list. That's about it. But I can still provide a screenshot. Just give me a moment.

Edit:
P6screenie4.png

The moment I'm at this selection, I try to cancel, and the error happens.
 

yeetMyDudes

Villager
Member
Joined
Feb 21, 2021
Messages
11
Reaction score
2
First Language
English
Primarily Uses
RMVXA
Apologies for the late reply, I think I've found a fix. (before you do anything please save your previous code somewhere, eg a text file, in case there's further errors with my fix. I've tested it a bit, but I'd rather be safe than sorry). Anyway here goes.

I only changed a few lines, specifically putting an if statement in the Proc.new statement, and adding an extra choice, so I do not wish to take any credit. But hopefully you'll be able to exit using this code.
(FULL CREDIT TO @Balrogic FOR THE ORIGINAL CODE.)
Replace the self.unsorted function.
def self.unsorted $game_self_switches[[:balrogic, :teleport, :override]] = true if $game_self_switches[[:balrogic, :teleport, :disabled]] $game_message.add(@disabled) if @disabled $game_self_switches[[:balrogic, :teleport, :override]] = nil else if $game_self_switches[[:balrogic, :teleport]] $game_message.choice_cancel_type = 1000000 $game_self_switches[[:balrogic, :teleport]].each{ |x| $game_message.choices << x[0] } num_choices = $game_message.choices.size $game_message.choices << "Back" $game_message.choice_proc = Proc.new { |x| if (x < num_choices) $game_player.reserve_transfer( $game_self_switches[[:balrogic, :teleport]][x][1], $game_self_switches[[:balrogic, :teleport]][x][2], $game_self_switches[[:balrogic, :teleport]][x][3], $game_self_switches[[:balrogic, :teleport]][x][4]) Balrogic::Teleport::configuration end } $game_message.add(@destination) if @destination else $game_message.add(@nodestination) if @nodestination $game_self_switches[[:balrogic, :teleport, :override]] = nil end end end

And here's the self.sorted code.

def self.sorted $game_self_switches[[:balrogic, :teleport, :override]] = true if $game_self_switches[[:balrogic, :teleport, :disabled]] $game_message.add(@disabled) if @disabled $game_self_switches[[:balrogic, :teleport, :override]] = nil else if $game_self_switches[[:balrogic, :teleport_manual]] $game_message.choice_cancel_type = 1000000 @sorted_list = [] $game_self_switches[[:balrogic, :teleport_manual]].each{ |x| @sorted_list << x if x } @sorted_list.each{ |x| $game_message.choices << x[0] } num_choices = $game_message.choices.size $game_message.choices << "Back" $game_message.choice_proc = Proc.new { |x| if (x < num_choices) $game_player.reserve_transfer(@sorted_list[x][1], @sorted_list[x][2], @sorted_list[x][3], @sorted_list[x][4]) Balrogic::Teleport::configuration end } $game_message.add(@destination) if @destination else $game_message.add(@nodestination) if @nodestination $game_self_switches[[:balrogic, :teleport, :override]] = nil end end end
 
Last edited:

Jaymonius

Veteran
Veteran
Joined
Mar 22, 2012
Messages
253
Reaction score
77
First Language
English
Primarily Uses
Alrighty! It works fine. HOWEVER, something unusual is going on though. 1614801889547.png This thing occurs, and then goes back to the game as if nothing happened. Any idea what could be causing that?
 

yeetMyDudes

Villager
Member
Joined
Feb 21, 2021
Messages
11
Reaction score
2
First Language
English
Primarily Uses
RMVXA
Ah, my bad!
Give me a second! I'll edit my post to remove the msgbox_p I used for bug testing!
EDIT: Should be fixed now! Apologies for that! :aswt:
 

yeetMyDudes

Villager
Member
Joined
Feb 21, 2021
Messages
11
Reaction score
2
First Language
English
Primarily Uses
RMVXA
Alrighty! It works fine. HOWEVER, something unusual is going on though. View attachment 181582 This thing occurs, and then goes back to the game as if nothing happened. Any idea what could be causing that?
Remove the line in self.unsorted that begins with msgbox_p, and that should do it. I've updated the code in the extract to reflect this.
 

Jaymonius

Veteran
Veteran
Joined
Mar 22, 2012
Messages
253
Reaction score
77
First Language
English
Primarily Uses
Perfect! Thank you sooooo much for your help! I really appreciate it! ^_^

Works perfectly fine now! Awesome!
 

Latest Threads

Latest Posts

Latest Profile Posts

You know you've been working on RPGMaker for a while when you go to move your projects to a 16 GB USB drive and get told not enough space to do this operation.
The latest post on TheDazzlingsAreBack...
besides itch and occasionally here where are people doing game jams at y'all? (plz do not cross reference this with my previous status lol)
Go out all day!
★No work★
Just want to sleep when I get home Zzzzz
just went through 50 issues of Fables, only to left kind of disappointed by it, I guess I have to wait for season 2 of TWAU instead.

Forum statistics

Threads
110,439
Messages
1,053,302
Members
143,507
Latest member
Arcanjo
Top