Tsukihime

Magic Units

18 posts in this topic

Magic Units

Author: Tsukihime

 

iYSum.jpg

 

Overview

 

This script converts skill types to "units". In the default engine, skill use consumes MP or TP. A "unit of magic" is treated like an item; in order to use the magic, you must have one, and each time you use it, you consume as many units as required.

 

Features

  • Specify skill types that should be treated as units
  • Consume units of skill rather than MP or TP
  • Gain or lose units through script calls
  • Anyone can use the skill as long as they have units

Usage

You can determine how many units of each skill you can have using

 

<max-units: n>

 

For some integer n

 

You can also determine which skill types should be treated as

units by specifying it in the configuration.

 

You can add/remove magic units by using script calls

 

add_units(skill_id, amount, scope_id, scope)
lose_units(skill_id, amount, scope_id, scope)

 

scope is either "actor" or "party".

 

If the scope is "party", then the scope_id is the number representing

the position of an actor in your party. 1 will be the first person,

2 will be the second person, etc

 

If the scope is actor, then the scope_id is the actor_id.

By default, the scope is "party"

 

Download

 

Script: http://db.tt/47ySZhca

Demo: http://db.tt/5UCTLMZH (copy rgss30x.dll to the System folder to run it)

Edited by Tsukihime
Allusion and Wren like this

Share this post


Link to post
Share on other sites

I really like this concept. I think I may try this out. Thanks!

EDIT: But it's a little confusing. Do you think you can make a demo?

Edited by MachRiderZ

Share this post


Link to post
Share on other sites

I've added a demo. Copy rgss30x.dll to the system folder since I didn't include it to make it small (most people should have it)

 

I didn't touch the database.

In the script, I specified skill type 2 (magic) to be treated as units.

 

There are 4 NPC's. Two on the left demonstrate adding/removing units. The one on the top adds magic to a specific actor in the game. The slime is just for using magic in battle.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Nice script, Tsuki! I'm currently using it now.

 

Is there a way to do the following:

 

1) Have an Actor or Class increase the maximum number of units for their alloted skills as they level up?

2) Have the Skill display "0" uses left when they run out (instead of the Skill disappearing from the menu altogether)?

3) Restore units by resting at an inn?

Share this post


Link to post
Share on other sites

The design was fairly simple.

 

Someone could probably write an add-on that changes the default behavior, because each magic was modeled after item usage, and not skill-uage (eg: 4/4 uses, 0/5 uses)

Share this post


Link to post
Share on other sites

ok well ive got it so that once drawn the skill remains even when at 0 (shows 0) but i cant get it to show when the actor levels up and is supposed to learn the skill

is there a way to add this whit a pre determined amount (wouldnt say full since by default thats 99 which is a bit unfair to start with)

 

EDIT

 

ok so now ive got it so that when you level up you'll learn the skill and gain 10 units of that skill also when reduced to 0 the skill remains however the skills can still be drawn by actors who do not learn the skill so kindda makes it pointless except for the free skill points

Edited by Tammsyn

Share this post


Link to post
Share on other sites

ok sorry for the double post but can we store the amount of units a specific skill has as a variable so that we can can do a sort of exchange system like what you can do in final fantasy 8

Edited by Tammsyn

Share this post


Link to post
Share on other sites

Maybe, but I can't come up with any reasonable way to do it.

You can in theory have arbitrary units of magic on your character so how would you manage that...?

 

I mean, you can always do this:

 

$game_variables[20] = $game_actors[1].get_units(30)

 

Which stores the number of units of magic 30 that your actor has in variable 20.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

What?  I thought I stalked you good enough to know most of your scripts, but this one has escaped my attention for 2 years.  This sounds exactly like something I am doing now using common event checks on every cast of a spell, so using a script to make it more tidy seems like a great idea.

 

I'm going to try this out on my current project and see what happens.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.