Saturday, September 11, 2010

Code Snippets (51 total)

Introduction
This is my collection of code snippets i make for fun. I just release to the public in case they want them or see them as handy. This is not a shop, don't ask me to write you a snippet. I write these in my spare time and therefore, requests ruin my fun.

List
Here is a list of all my snippets here, useful more so when i get more. Descriptions for snippets can be found here in the list.

WindowSkin Snippet: This lets you have custom windowskins for every default window in the program.
Hide Text Box Snippet: This lets you make a text box that can be hidden, then brought back up by the player.
Run/Guard Hotkey: This lets you assign a button for quick access in battle that lets the player guard, or run.
Run/Guard Hotkey ATB Version: Does the same as the above, except works only with ATB.
Aliased Load Menu Option: It adds a Load menu option for quick loading.
Speed Save: This lets you assign a button to bring up the save menu quickly.
Extra Windows: This adds extra windows to the main menu, decided by you.
Parameter Icons: This adds icons next to parameters. Not yet compatible with Enelvon’s luck and resistance scripts.
Success Bar: This lets you create a bar of success that can turn switches on/off.
Change Actor Options: This allows you to change actor options like super guard or two swords style.
No Actor EXP: This allows you to define actors that cannot gain exp for some reason or another.
Change Windowskin: This lets you change the windowskin will in-game with a simple script call.
Cheat System: This lets you add a cheat system to your game.
Records Window: Allows you to show a window with values of variables in it.
Level Up Effects: Lets you add extra effects when the player levels up.
Disable Battle Commands: Allows you to disable commands like “attack”, “skill” and such in battle.
“If Party Has Equipped”: Allows you to quickly check if anyone in the party has a certain weapon/armor equipped.
“If Party Has Skill: Same as above but with learned skills instead.
Set Actor’s Max Level: Allows you set set each actor’s maximum level individually.
Break States: Lets you designate states to break HP and MP, making them 0 at a hit.
Immortal States: Lets you designate states that make the character immortal.
Diagonal Map Scroll: Lets you scroll the map diagonally.
Percentage of Damage: Lets you deal a percentage of hp/mp.
Screensaver: Dims the screen after a certain amount of time of the program being idle.
Remove Dead Actors: This allows you to remove incapacitated actors from the party.
Singular EXP: Allows you to have a single actor that gains exp and the rest level with him.
Blue Magic: Allows you to create characters that learn enemy skills.
Item SE: Adds a sound effect when you use an item.
Change GameOver Graphic: Allows you to do exactly what the title says.
Actor Approval Rating: Adds approval to party members that can increase/decrease depending on choices.
Level Up SE: Plays a sound effect when an actor levels up.
Gameover to Map: Sends the player to a map with 1 hp instead of a regular gameover.
No Failure Message: Allows you to specify skills that will not show the failure message.
Change Map Encounter Rate Formula: Lets you change the default random encounter formula.
No Encounter Conditions: Lets you make conditions that, if met, will result in no random encounters.
Map Actor Name Window: Shows a window on the map with the charcter’s name in it.
Mimic Event: Will let you make an event that will mimic the player’s movement.
Random Battle Transition: Does exactly what the name says. Makes the battle transition random.
One Press Sprint: This snippet will make it so they only have to press Shift to sprint, and they will have this sprinting state until they press shift again.
Map Tint Carry-Over: Will carry a map’s tint over to the battle screen.
Change MessageBack: Does as the name says. Allows you to change the “Dim” message background.
(Note: Not all snippets are listed here.)

The Snippets

Time System

Introduction
This is my time system. It has a whole lot of features and customization options. I have obtained opinions from users like you to know what they want in a time system. This has all the features of the time system you may already use, PLUS MORE! Enjoy.

Features
#===============================================================================
# CHECK means the script has the feature
# WIP means it is a future feature
#-------------------------------------------------------------------------------
# Thomas Edison Compat. CHECK
# Auto-Tint CHECK
# Auto-Weather CHECK
# Auto-Season CHECK
# Time to variable/switch CHECK
# Weather to switch CHECK
# Changable Days/Months CHECK
# Military time CHECK
# Real time option CHECK
# Resting CHECK
# Map/Menu Windows CHECK
# Changable map encounters CHECK
# Map labels CHECK
# Alignment System compat. CHECK
# Skill damage differences depending on time of day. CHECK
# Update only on Map feature. CHECK
# Turn time window on/off. CHECK
# Stamina system compat. CHECK
# Weather/time effects accuracy. CHECK
# Hunger/Thirst compatability. CHECK
#===============================================================================

Script

FAQ
Q: Where do I put this script?
A: Put this script in the script edition under Materials and above Main
Q: How do i edit ______?
A: Look at the script configurations first! If you are SURE the option is not there, post in this topic.
Q: Can i freeze time?
A: Yes, you can. Look in the script intructions, or download the demo.
Q: What is military time?
A: Military time is when they use a 24-hour clock. Instead of 5 PM, it'd be 17.
Q:What is the difference between real time and script time?
A: Script time is entirely created and help BY the script. Real time draws the time set on your computer.

Credit
Jet10985/Jet
Mr. Anonymous
bulletxt if used with Thomas Edison VX
Kylock

Stamina System

Features
Full functional Stamina system
Optional Menu and Map windows
Prevents dashing when stamina runs out
Fully compatible with most extra movement system (swimming, jumping, climbing, etc.)

Screenshot

Demo

Credit
Jet
Mithran

Reedo's Sideview Add-Ons

Introduction
Well, with Reedo not being around to update his thread with user-made Add-Ons, I decided to start this thread until Reedo returns. Reedo’s script had a lot of untapped potential. This thread is for Add-Ons to Reedo’s Simple Sideview Battle System and is to be noted that this is not a request thread!

Demo 


List
Blue Magic
Run/Guard Hotkey
Surprise Attack Field Change
Battler Knock Backs
Actor Dead Sprites
Active Actor Move Forward

Credit
Reedo
Yanfly if used with YEZ
Anyone whose Add-Ons you use

Pokemon Stat System

Summary
This script is the Pokemon Statistics System that will mimic the Pokemon Stat calculations. This means IVs, EVs, Base Stats, Natures and Level will all be taken into account when calculating attack, defence, spirit, and agility. Agility is considered the equivalent of speed, and Spirit is both Special Attack and Special Defence combined. Spirit being both, I now some of you are thinking “But some natures lower one and higher the other! BAHHHHH!” Well, I did not do anything about that =(
Anyways, enjoy the script, and credit if used.

Features
Mimics the Pokemon stat calculations
Adds natures to players
Items give raise EV of characters
Enemies also give EV
And more…

Script

Credit
Jet

Item Gauge

Introduction
This is my annoying to program item gauge script. I worked on and off on it because I always ran into something wrong. Now though, I have it basically done, and I’m liking it so far. Hope you enjoy it as much as I suffered for it ;) 

Features
Fully functional Item gauge and limitation
Default looking gauge
Good customization
Easy to use
Cool all together

Script

Credit
Jet

Alignment System

Introduction

This script adds a simple and easy-to-use alignment system to your game. This will allow the character to be good, evil, or anything in-between. You can even change it up from alignment to other stuff like Rank or Vampirism.

Features
- Adds Alignment
- Easy to add/subtract points
- Easy to make new alignment names
- Adds alignment name in status menu
- You can add tags to equipment/skills to require a certain alignment condition

Screenshots

How To Use
The alignment name and value match to the corresponding one in the other array.
EX: In the default, "Very Evil" is the first name, and -100 is the first condition
This means, if -100 or lower is the value of $game_system.alignment, the
character will be "Very Evil".
--------------------------------------------------------------------------------
How to change alignment: We have 2 command to change alignment points.
sub_alignment(points) and add_alignment(points)
In both commands, replace "points" with the amount of change you want in the
character's alignment points.
sub_alignment will subtract the amount of points.
add_alignment will add the amount of points

Script/Pictures
With the newest update, you can now use an image based bar/cursor to indicate the alignment. My good friend Xalidir was kind enough to whip up some defaults for use to use.
You need both if the bar is to be used.




Patches
Place all patches below my alignment script AND the script being patched.
YERD Status ReDux: Patch Here
Show Alignment on Map: Patch Here

Future Features
- Weapons/armor/skills dependent on alignment DONE
- Choose bewteen an in-game variable and add_alignment(points) DONE
- Suggested Features
FAQ
Q: How do I add or subtract points?
A: Read the Instructions!
Q: How do I add more alignment names?
A: Add the name, in quotes, where you want to. Then add the points requirement in the same place, but in the other array.
EX:
ALIGNMENT_NAMES = ["Very Evil", "Kinda Evil", "evil", "neutral", "good", "very good"]
I added "Kinda Evil" between "very evil" and "evil". Now I must add the requirement.
ALIGNMENT_CONDITION = [-100, -75, -50, 0, 50, 100]
See how i added -75 between the requirement for "very evil" and "evil" just like i put "kinda evil"? Thats how.

Credit and Thanks
- Jet10985 (Jet, CaptainJet)
- CrimsonSeas (rpgmakervx.net)
- Piejamas (rpgmakervx.net)
- Mithran (rpgmakervx.net)
- Yanfly
- OriginalWij (rmcollective.com)
- Synthesis

Hunger/Thirst Factor

Features
Full functional Hunger/Thirst factor
A lot of customization
Non-eventable features
And more…

Script

Credit
Jet

Event Skipper

Introduction

This script is my Event Skipper. Basically, this script will skip event commands that take time to accomplish. Stuff like show text or scroll map and the like (full list of event commands in script and below.) But, it still makes important event commands occur like Controlling switches or variables. I'm hoping this script will speed up people's game debugging, and even has the option to add game features. ;)

Features
- Speeds up event debugging
- Can add a "Cutscene skip" option to games.
- In test mode, has the option to instant skip or use a command window.
- Has 2 different skipping options.
- And more...
The following are event commands that will be skipped:
Show Text
Scroll Map
Set Move Route (will force a No wait for completion)
Fadeout Screen
Fadein Screen
Show Animation
Show Balloon Icon
Wait
Name Input Processing (The name will default to Ralph.)

How to Use/Notes
Initial commands and notes:
Auto-skipping events will only occur in test mode.
To start the point where an event will start skipping, make an event comment with
SKIP EVENT BEGIN
This is required on every page you want skipped.
To stop skipping at a specific point, make en event comment with
SKIP EVENT END
This is NOT required and if not made, the rest of the event will just be skipped.
The following event commands will be skipped when an event is designated
to be skipped:
Show Text
Scroll Map
Set Move Route (will force a No wait for completion)
Fadeout Screen
Fadein Screen
Show Animation
Show Balloon Icon
Wait
Name Input Processing (The name will default to Ralph.)
Other features:
Battles now have auto-result hotkeys that can be used anytime to end the battle
how you want to end it, instantly.
A = win
S = escape
D = lose
You now have the option for instant transfers while in test mode.
You also have 2 global skipping methods.
Pressing W during event - Skips the entire event and can be used during any
event, only usable in test mode.
Pressing Q inside tags - Can only be used after the SKIP EVENT BEGIN tag and
only skips until the SKIP EVENT END tag. Has the option to be used in any mode.
Note: In the command window that pops up when you use this skipping method,
you must use Q to select your choice, NOT Enter.
Issues:
Currently, You shouldn't use "Retain" for a transfer if the transfer is after a
move route and they can be skipped. Specify the direction.
You may not skip common events.

Script

Credit
Jet

Window Maker

Introduction
This script is a window creator. You get to design a window, then save it as a text file that can be put into your game! This is a tool that can be used by both newbies who just wants a simple custom status menu, to a lazy scripter who doesn't want to code his own windows xD
I've had a lot of testers and such, but i'm not saying there's no bugs. I just HOPE there are no more bugs.

Features
- Easy to use interface
- Interchangable iconset
- Codes it all for you!
- Has the option to alias into a scene for you!
- Loads of design features
- Saves a separate window load data that can be used to continue WIP windows, or just have a back-up.
- And so much more...

Screenshots
(to come later. DO NOT COMPLAIN ABOUT IT!)

Program

Credits
Jet
OriginalWij (No Click-out scriptlet, Input Text, some code help)