Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: chaucer on August 07, 2014, 01:33:41 am

Title: @move_speed(Resolved)
Post by: chaucer on August 07, 2014, 01:33:41 am
Hello all, I was messing around with RMXP and while playing with @move_speed, I realized I can't call it like other objects, I.E

$game_player.move_speed

I was wondering if it's possible to call @move_speed from another scene and if so how, I'm probably missing something simple I'm sure.
Title: Re: @move_speed
Post by: Zexion on August 07, 2014, 01:54:08 am
Hmm, $game_player.move_speed works for me. What are you trying to do?
Title: Re: @move_speed
Post by: chaucer on August 07, 2014, 02:02:55 am
when I call it I get
'undefined method move_speed for #<Game_Player:0x2ffbe98>'
also I was planning to create a state that causes a slower move speed for blizz abs.
Title: Re: @move_speed
Post by: Zexion on August 07, 2014, 02:12:11 am
I think blizz-abs uses a different move_speed. Use normal_speed instead? idk really, I asked kk20
Title: Re: @move_speed
Post by: KK20 on August 07, 2014, 02:14:08 am
http://forum.chaos-project.com/index.php/topic,106.msg175785.html#msg175785

@move_speed is a Game_Character variable. I do believe it is not readable nor writable initially. You have to do

class Game_Character
 attr_accessor :move_speed
end

to be able to call it from other classes or on the map. But since you are using BlizzABS, I suggest using @normal_speed (as posted in the above link) instead since the Game_Player's move_speed updates each frame, thereby revoking your script call.
Title: Re: @move_speed
Post by: chaucer on August 07, 2014, 02:23:16 am
thanks : ) for the help very appreciated, I figured move_speed would have already been added but I guess not. D:
Also the link explained why i couldn't rewrite move_speed last time I tried.
Title: Re: @move_speed(Resolved)
Post by: MetalZelda on August 24, 2014, 11:25:46 am
You could do better, you can shortcut it to be much more faster and efficient, you can for example do

speed = $game_player.move_speed

So in your eventing page you can script call

speed(whatevervalue)
I need to search for the script I customized for dat

:naughty: :naughty: :naughty:
Title: Re: @move_speed(Resolved)
Post by: KK20 on August 24, 2014, 04:06:22 pm
You're still calling the same amount of code in the long run. There's no way that would make it "faster and efficient". Just lazier.
Title: Re: @move_speed(Resolved)
Post by: MetalZelda on August 24, 2014, 04:23:12 pm
Quote from: KK20 on August 24, 2014, 04:06:22 pm
You're still calling the same amount of code in the long run. There's no way that would make it "faster and efficient". Just lazier.


That's a great plus if you make a lot of cutscene / event that alter game_player speed ^^