Jump to content


Photo

Magic Units


  • Please log in to reply
17 replies to this topic

#1 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 28 May 2012 - 03:10 PM

Magic Units
Author: Tsukihime

Posted Image

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, 29 June 2012 - 02:20 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#2 MachRiderZ

MachRiderZ

    Newbie

  • Member
  • 9 posts
  • RM Skill - Jack of All Trades

Posted 29 June 2012 - 01:46 PM

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, 29 June 2012 - 01:49 PM.

Posted Image

#3 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 29 June 2012 - 02:20 PM

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, 29 June 2012 - 02:22 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#4 killerb255

killerb255

    Member

  • Member
  • 22 posts

Posted 30 July 2012 - 10:31 PM

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?

#5 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 31 July 2012 - 11:06 AM

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)
All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#6 Tammsyn

Tammsyn

    Advanced Member

  • Member
  • 173 posts

Posted 01 October 2012 - 01:20 PM

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, 01 October 2012 - 02:23 PM.


#7 Tammsyn

Tammsyn

    Advanced Member

  • Member
  • 173 posts

Posted 02 October 2012 - 11:50 AM

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, 02 October 2012 - 11:59 AM.


#8 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 02 October 2012 - 11:52 AM

I don't have any support for that.
All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#9 Tammsyn

Tammsyn

    Advanced Member

  • Member
  • 173 posts

Posted 02 October 2012 - 12:58 PM

ah shame would have been nice to have

#10 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 02 October 2012 - 03:48 PM

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, 02 October 2012 - 03:50 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#11 Tammsyn

Tammsyn

    Advanced Member

  • Member
  • 173 posts

Posted 02 October 2012 - 04:49 PM

ok tried that kept getting get_units is undefined method

#12 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 02 October 2012 - 05:26 PM

Oops it's `get_magic_units` lol
All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#13 Tammsyn

Tammsyn

    Advanced Member

  • Member
  • 173 posts

Posted 03 October 2012 - 12:30 AM

thank you that worked :P

#14 Galdelonian

Galdelonian

    Advanced Member

  • + Sponsor
  • 62 posts

Posted 01 January 2015 - 11:47 AM

Ehm where do I get the .dll?



#15 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 01 January 2015 - 12:33 PM

It's in the RTP folder.

Edited by Tsukihime, 01 January 2015 - 12:33 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#16 Tesaigo

Tesaigo

    Member

  • Member
  • 15 posts
  • RM Skill - Pixel Artist

Posted 09 January 2015 - 03:14 PM

Can you have a skill to use both MP and 'Magic Units' or you can only have one at time?



#17 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 09 January 2015 - 03:31 PM

This was intended to replace the way your spells work, so no you can only choose one.
All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#18 Wren

Wren

    Paragon/Renegade

  • Member
  • 1128 posts
  • RM Skill - Jack of All Trades

Posted 23 January 2015 - 03:57 AM

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.


Super Awesome People Shoutout

Spoiler




1 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users


    Bing (1)