• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Astralneko's Miscellaneous Scripts

v19 Astralneko's Miscellaneous Scripts 1.1.1

This resource pertains to version 19 of Pokémon Essentials.
Pokémon Essentials Version
v19.1 ➖
This plugin consists of five sets of scripts I've made for my game that I think are useful little plugins, but that are honestly too small to be their own plugins (each section is one to three functions and at most two saved items, and they don't really affect the game all that much, they just add polish or make certain things easier to develop). So, I combined them into one plugin.

This might work in v20.1, but hasn't been tested, hence why it's only listed for v19.1.

  • Download the plugin using the button above.
  • Place the "Astralneko's Miscellaneous Scripts" folder inside the Plugins folder.
Functions Included:
Probably the largest plugin of the bunch. If I think of something else to use the temporary storage class, I'll probably separate this into its own plugin.

In the DS Pokémon games, occasionally characters will have a distinct animation that plays. For example, when using a Pokémon Center in the Unova games, the player character will fiddle with their Bag briefly, presumably taking out their Poké Balls and setting them on the counter. In the same games, the player will also hold up the item that they collect if they find one on the ground. You can technically do this for all characters with move routes and distinct files in Graphics/Characters, but setting the player's graphics (as in the example above) only works at all if the character is facing a certain direction (down). So, this section's commands make it possible to more easily animate the player as needed.

All commands in this section require the existence of an image in Graphics/Characters where the file is stored. The image is formatted similarly to a standard graphics file, albeit with each frame starting in the top left and then going across, going to a new line if needed. The longest supported animation is 16 frames, e.g. every slot on a standard RMXP character sheet.

The image's filename should start with the base graphic file, e.g. trainer_POKEMONTRAINER_Red. Add on vehicle and outfit versions as needed, e.g. trainer_POKEMONTRAINER_Red_bike_1. Then, add "_[animation name]" to the end of the filename. Whatever you put in place of [animation_name] will then be used to call the animation.
Plays a player animation.
Usage: anPlayPlayerAnimation(animation_name, frame_rate, length, stayOnVehicle?)
Required Fields:
  • animation_name - The name of the animation file. This should only be the part of the filename that differs from the base filename, discluding the underscore. For example, if your filename is trainer_POKEMONTRAINER_Red_get, this field should be "get".
Optional Fields:
  • frame_rate - The amount of frames that each part of the animation should display for. This will default to 2.
  • length - The amount of parts the animation file has. This will default to 1.
  • stayOnVehicle? - Whether the animation has different versions for vehicles (bicycle, surf). If true, a version of the animation for each vehicle must be added. This will default to false.
Plays a player animation from a certain frame. Useful to loop part of an animation without needing a seperate image file.
Usage: anPlayPlayerAnimationFromFrame(start_frame, animation_name, frame_rate, length, stayOnVehicle?)
Required Fields:
  • start_frame - The frame the animation starts at. This is not zero indexed, so the first frame of your animation is in fact frame 1.
  • animation_name - The name of the animation file. This should only be the part of the filename that differs from the base filename, discluding the underscore. For example, if your filename is trainer_POKEMONTRAINER_Red_get, this field should be "get".
Optional Fields:
  • frame_rate - The amount of frames that each part of the animation should display for. This will default to 2.
  • length - The amount of parts the animation file has. This will default to 1.
  • stayOnVehicle? - Whether the animation has different versions for vehicles (bicycle, surf). If true, a version of the animation for each vehicle must be added. This will default to false.
Plays a player animation in reverse.
Usage: anReversePlayerAnimation(animation_name, frame_rate, length, stayOnVehicle?)
Required Fields:
  • animation_name - The name of the animation file. This should only be the part of the filename that differs from the base filename, discluding the underscore. For example, if your filename is trainer_POKEMONTRAINER_Red_get, this field should be "get".
Optional Fields:
  • frame_rate - The amount of frames that each part of the animation should display for. This will default to 2.
  • length - The amount of parts the animation file has. This will default to 1.
  • stayOnVehicle? - Whether the animation has different versions for vehicles (bicycle, surf). If true, a version of the animation for each vehicle must be added. This will default to false.
Returns the player to the direction and vehicle that they were using before an animation was ran. This should be used after all player animations, so that the player's graphics do not get messed up.
Usage: anEndPlayerAnimation after running anPlayPlayerAnimation or anReversePlayerAnimation

The only other section that requires an ending. (Well, technically it doesn't, if you like your game being constantly at a certain time of day.) If I make another thing that should be saved, this will also likely become its own plugin. This section will only have a visible effect if TIME_SHADING is true in the Settings.

This section is used to make the game think it is a certain time, instead of what time it actually is. Like Pokémon Sword and Shield, this influences all time-based events in the game, including Evolution. I originally made this for a flashback cutscene that is supposed to always play at night, but you could also use this in the same way as Sword and Shield, by making it so certain parts of the story always occur at a certain time.

The time override being enabled and the time that is overriding are both saved to the savefile, so they will persist even if the game is closed and reopened.

I recommend doing this during a fadeout, so that the player does not notice the time override.

Overrides the current time of day. You can make the game think it is any time of day. While you can also set the current day, month, etc. using a Time object, that won't have any cosmetic effects by itself.

The time set is saved to $Astralneko_Storage.timeToOverride, which can itself be used with anTimeOverride. pbGetTimeNow will also return the overridden time if it is set though.
Usage: anTimeOverride(hour,min) OR anTimeOverride(time)
Required Fields:
  • hour/time - hour is an integer between 0 and 23 (0 is midnight, 23 is one hour before midnight), while time is a Time object (much like Time.now). One of these two is always required.
Optional Fields:
  • min - The minute within the specified hour to set the time to.
Ends the time override.

Using this does not reset $Astralneko_Storage.timeToOverride, which means you could use this, followed by anTimeOverride($Astralneko_Storage.timeToOverride) later. For example, Sword and Shield's story time is not used when the player enters a Wild Area map. To get the same effect, you could run anRemoveTimeOverride upon entering a Wild Area-type map, then, upon entering a map outside the Wild Area, run anTimeOverride($Astralneko_Storage.timeToOverride).
Usage: anRemoveTimeOverride

The default mart NPC, like in the default map "Lerucean Town Mart" - the one whose items depend on your badge count - works functionally, but if you have seen its code, you'll realize it's a massive mess of badge check Conditional Branches. This makes it an absolute pain in the butt to change the items that a mart has. So, this section serves to condense all those Conditional Branches into a single Script.

Runs a Pokemart. The items contained within are sold based on badge count. pbMart is shorter for non-Badge dependent marts, but anMart makes up for it if the mart does have even a single Badge dependent item, reducing the size of the code by up to 88%.

Usage: anMart(itemlist)
Required Fields:
  • itemlist - An array, which is structured where each item is followed by the number of badges required for that item to appear in the shop. The list doesn't need to be formatted where each badge requirement is on its own line, that is just a readability feature. All items need to be followed by a number of badges, just use 0 if the item should be available from the start. For example, use this to make a default mart similar to the Lerucean Town Mart:
Default mart:
anMart([:POKEBALL,0,:POTION,0,
:ANTIDOTE,1,:PARALYZEHEAL,1,
:AWAKENING,1,:BURNHEAL,1,
:ICEHEAL,1,
:GREATBALL,2,:SUPERPOTION,2,:REPEL,2,
:FULLHEAL,3,:ESCAPEROPE,3,
:REVIVE,4,
:ULTRABALL,5,:SUPERREPEL,5,:HYPERPOTION,5,
:MAXREPEL,7,:MAXPOTION,7,
:FULLRESTORE,8])

This single function creates a bitmap from multiple bitmaps stacked on top of each other. The result Bitmap will be the first argument, with the second argument on top of it, with the third argument on top of both, and so on.

Stacks as many bitmaps as you want with a single call. The bitmaps are stacked one after another.

Usage: anStackBitmaps(bitmap1, bitmap2[,... etc])
Required Fields:
  • bitmap1 - The bottommost bitmap. Must be a Bitmap object.
  • bitmap2 - The bitmap to stack on top. Also must be a Bitmap object.
Optional Fields:
  • Any additional bitmaps can be added by appending more Bitmaps to the bitmap1,bitmap2 part of the function call, comma-separated, e.g. anStackBitmaps(base,top_left,top,top_right,left,center,right,bottom_left,bottom,bottom_right) for a Rubik's cube, where all of those arguments are Bitmaps.

These two functions can be used to randomly generate a person, e.g. an ot and otgender for ownership of a Pokémon. I created these for use in a Wonder Trade code, but you could use this elsewhere too, e.g. for Triple Triad "online" opponents.

Generates a random name. The function does NOT take an argument of a list of names. The plugin comes with 1560 predefined names, which can be replaced or added to or removed from as needed in the def anRandomName in AN Scripts.rb.

Usage: anRandomName

Generates a random gender. While, for example, otgender = rand(2) could be used for this purpose, this function can base the gender decided (loosely) on the name of the character.

Usage: anRandomGender(name)
Optional Fields:
  • name - The name to use to help guide the gender returned. In code, this is based exclusively on the ending of the name, with O and A endings resulting in male and female names respectively 75% of the time, and several other endings resulting in their respective genders either 50% or 25% of the time.
Credits
Astralneko
Author
Astralneko
Downloads
705
Views
3,889
First release
Last update
Rating
5.00 star(s) 1 ratings

More resources from Astralneko

Latest updates

  1. Somehow missed a bug lmao

    Somehow I missed that the daylight tone only updates once every 30 seconds? Well it's fixed now.
  2. Config, cleanup

    Cleaned up the player animation code. Now it supports up to 16 frames of animation. Added the...
  3. Bugfixes and performance improvements

    Fixed the time override function crashing after application. The bitmap stacker can now accept...
Back
Top