!!

Welcome to Save Point!

Formerly known as RMVXP, Save-Point is a game creational forum that aids users in creating games using software like RPG Maker or Game Maker. Support is also available today for members and members can also upload and download resources and scripts to use in their games. If you are new or experienced we welcome you to register.

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[XP] Digit Extraction v1
PK8 Offline
I am the enemy. I am the antidote.

*****
Posts: 1,731
Joined: May 2009
View My Download Submissions
Thanks: 25
Given 8 thank(s) in 29 post(s)

Save Points: 8,967sp
Items: (View All Items)
Awards:

Gender: Undisclosed
Favorite Maker: RPG Maker XP
Post: #1
[XP] Digit Extraction v1

Introduction
This event script lets you extract the digits from a value via script calls.

Features
  • Extract a value and use an extracted digit via script calls.
    I haven't tested floats or negative integers but I'm sure it wouldn't work as it should because I didn't make this with them in mind
  • And for those new to my systems, this stuff is generally plug and play.
How to Install
Copy-paste the common event into your project. Depending on how far into development you are with your project, you should change its condition switch.

FAQ
  1. How do I extract a value?
    To extract a value, you could call this via call script:
    pk8_diex_extract(value)
    value - Should be a positive integer. This system wasn't made with floats or negative integers in mind.
  2. Okay, but I want to be able to extract a number to a variable in which I can read from. How do I do that?
    This can be done by setting a scripted variable of some sort to equal the array of extracted digits. Try this (Be sure to correct me if this is found to be bad practice):
    @some_variable = pk8_diex_extract(85743)
  3. How do I get it to extract a game variable instead?
    @some_variable = pk8_diex_extract($game_variable[id])
    id - Should be a Game Variable ID.
  4. How do I read extracted digits?
    You could use this script call:
    @some_variable[i]
    i - The index number will refer to the rightmost extracted digit. (e.g.: 1: Ones, 2: Tens, 3: Hundreds, 4: Thousands)
  5. I'd like to give the value of a digit to a game variable. How do I do it?
    Using calls like these:
    $game_variable[id] = @some_variable[i]
    id - Should be a Game Variable ID.
    i - The index number will refer to the rightmost extracted digit. (e.g.: 1: Ones, 2: Tens, 3: Hundreds, 4: Thousands)

    An example set of script calls:
    $game_variables[1] = 85743
    @some_variable = pk8_diex_extract($game_variables[1])
    $game_variables[2] = @some_variable[1]
    $game_variables[3] = @some_variable[2]
    $game_variables[4] = @some_variable[3]
    $game_variables[5] = @some_variable[4]
    $game_variables[6] = @some_variable[5]
Credit and Thanks
Credit
  • -
Thanks Author's Notes
The presentation for the demo was for the most part, rushed. I didn't come up with a fancy readme this time around. Once again, this system wasn't really made with floats or negative integers in mind. I will try to come up with something that could accommodate floats, but for now, this is all I got.

If anyone wants to take up the reins and build something a lot better than what I have then by all means, take it away!

A VX version has yet to be made but can easily be recreated if you copy my code command by command.

License / Terms
This is free for non-commercial and commercial use. Credit is optional.

Downloads

.zip  Digit Extraction XP.zip (Size: 189.93 KB / Downloads: 1)

Formerly known as Punk.
He Used To Feel Invincible, But Now He Doesn't Feel At All...
01-23-2012 11:19 AM
Find all posts by this user Quote this message in a reply
Post Reply 


User(s) browsing this thread:
1 Guest(s)


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  "Ultimate Attack" aka "Music Fadeout Skill" [XP] yamina-chan 11 2,438 05-03-2012 05:32 PM
Last Post: yamina-chan
  Licence System - Upgrade your Character [XP] yamina-chan 2 1,301 05-03-2012 05:26 PM
Last Post: yamina-chan
  [XP/VX] Database Limit Breaker PK8 6 1,297 04-11-2012 11:02 AM
Last Post: PK8
  [XP/VX] Ability Grid Guardian 1 1,477 05-03-2011 11:38 PM
Last Post: deathangelmagnus
  [XP/VX] Transfer With Variables Guardian 0 662 11-24-2010 02:31 AM
Last Post: Guardian
  [XP/VX] Enemy Sight Range Guardian 0 813 11-24-2010 02:29 AM
Last Post: Guardian



 Quick Theme: