Go Back   The PokéCommunity Forums > Create & Discover > Game Development > Scripts & Tutorials
Reload this Page Essentials script [Essentials v13] Faster text and faster exp. gain animation

For all updates, view the main page.

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.

Thread Tools
Old January 16th, 2014 (4:23 AM).
Stochastic's Avatar
Stochastic Stochastic is offline
Join Date: Dec 2013
Gender: Male
Posts: 112
If you're dissatisfied with even the fastest text speed and exp. gain bar animation speed then this tutorial is
for YOU! *points finger*

This short tutorial will teach you how to make the text speed in Pokémon Essentials twice as fast with a little trick
and how to make exp. gain bar animation duration same for all exp. gain amounts (for example, gaining 50 exp
and 500 exp will take the same amount of time).

Note: This tutorial is written for version 13.

This is how I did it in my game. First, you should find the updateInternal method
in script SpriteWindow. The first line of the method should look like this:

curcharskip=@frameskip<0 ? @frameskip.abs : 1
After that line, add this:

curcharskip += 1
This will make all text in messages appear a lot faster. How does it work? Instead of showing one letter by letter
it will show (at least) two letters at a time. However, if we do this, then a problem arises in pokémon battles. If the text
appears too fast, before the "pokéball appearing" animation is over, the battle will freeze. So, we introduce a
control variable that will turn on the char skip only during non-battle messages (made with Show Message).
We update the above line like so:

curcharskip += 1 if $skip_one_more
Next step is to initialize the global variable $skip_one_more. Insert this in the Settings script, first line.

$skip_one_more = false
It should be false by default, and true only when we're showing messages. So let's turn it on in method
Kernel.pbMessage (script PokemonMessages, line 1010). Insert this as the first line in the method:

$skip_one_more = true
And insert this before the last line (return ret)

$skip_one_more = false
That's it! If you'd like to have an option of choosing this text speed, you could add another control variable
that together with $skip_one_more activates the char skip. For example:

curcharskip += 1 if $skip_one_more && $hyper_text_speed_ACTIVATE

On to the exp. bar animation.

Add this on the end of the method animateEXP (script PokeBattle_ActualScene, line 691)

    @expAnimSpeed = (newexp - oldexp) / 60.0
    @expAnimSpeed = 1 if @expAnimSpeed < 1
In method update, on line 811, there should be:

@currentexp += 1
Overwrite that line with this:

@currentexp += @expAnimSpeed
@currentexp = @endexp if @currentexp > @endexp
That's it. Now to explain what's going on here. Firstly, we set some animation parameters. @expAnimSpeed is
calculated as a difference between new exp. and old, divided by 60. This is equivalent to calculating speed from
distance and time needed to cross that distance. Here, we want to cross the "distance" between new exp. and
old exp. in 60 frames, regardless of that distance's length. If the speed is less than 1, we set it to 1, because
minimally, we want to gain 1 exp per frame.

The second part is in the update method. Instead of increasing the current exp by 1, we increase it by
@expAnimSpeed, and if we go beyond the @endexp, we set the @currentexp back to @endexp

If you've tried it and it works, a thanks will suffice. No credits are needed.

Reply With Quote
Old January 16th, 2014 (10:53 AM).
Radical Raptr's Avatar
Radical Raptr Radical Raptr is offline
Join Date: Mar 2011
Location: everywhere
Age: 20
Gender: Male
Nature: Sassy
Posts: 1,116
Send a message via Skype™ to Radical Raptr
That's pretty cool, great job! I'm testing it right now, but it works very well

~My Deviantart - Litharreon Wiki - Litharreon Game Download~

Reply With Quote
Old March 1st, 2014 (3:15 AM).
Chrisario's Avatar
Chrisario Chrisario is offline
Friend code :0018 2912 2366 let me know
Join Date: Jul 2013
Location: In friend Safari
Age: 19
Gender: Male
Nature: Adamant
Posts: 103
I never asked for this but thanx alot for this The exp SE I seem can't get it from google
because the quietness when gaining EXP is borring
Reply With Quote
Old March 30th, 2014 (11:31 PM).
39Gamer's Avatar
39Gamer 39Gamer is offline
Join Date: Jun 2013
Location: Australia
Gender: Male
Nature: Bold
Posts: 50
you have a sound for the xp game theRiovile2?
This signature has been disabled.
Exceeds signature height limit.
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
Reply With Quote
Old May 8th, 2014 (7:19 AM).
FL's Avatar
FL FL is offline
Pokémon Island Creator
Join Date: Sep 2010
Gender: Male
Posts: 1,498
Nice tip!

First, you reverse it. 'curcharskip += 1 if $skip_one_more' should be 'curcharskip += 1 if !$skip_one_more'.

To solve the freeze problem, after each 'pbDisplayPaused(_INTL("{1}\r\nwould like to battle!",@opponent.fullname))' line and 'pbDisplayPaused(_INTL("{1} and {2} want to battle!",@opponent[0].fullname,@opponent[1].fullname))' line, add:

    while @scene.inPartyAnimation?
Doing this, the $skip_one_more stuff is unnecessary.
Reply With Quote
Old October 21st, 2014 (11:10 AM).
Spinda94 Spinda94 is offline
Join Date: Aug 2014
Gender: Male
Posts: 9
Sorry but I do not understand where I have to put $ skip_one_more = true in the script PokemonMessages
Reply With Quote
Old February 25th, 2015 (2:33 AM).
voymike's Avatar
voymike voymike is offline
You will not outwork me.
Join Date: Apr 2011
Location: Cyprus
Age: 19
Gender: Male
Nature: Adamant
Posts: 23
Does this work with Pokemon Essentials v15?
Reply With Quote
Old May 9th, 2015 (9:30 AM).
Courtland's Avatar
Courtland Courtland is offline
Join Date: Apr 2014
Gender: Male
Posts: 43
Jeez, doesn't work if you have a Pokemon with speed boost or leftovers. It just endlessly get exp.
Reply With Quote
Old May 9th, 2015 (10:03 AM).
Luka S.J.'s Avatar
Luka S.J. Luka S.J. is offline
Jealous Croatian
Join Date: Dec 2008
Location: Croatia
Age: 22
Gender: Male
Nature: Adamant
Posts: 929
Quote originally posted by Courtland:
Jeez, doesn't work if you have a Pokemon with speed boost or leftovers. It just endlessly get exp.
Quote originally posted by Stochastic:
Note: This tutorial is written for version 13.
Also, if you're using my battle system. I doubt this will work.
Reply With Quote
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are UTC -8. The time now is 11:57 PM.