Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 17 posts ] 
    BlueScope
  Fri Dec 26, 2008 6:19 pm
The Third Man
User avatar



Location: Germany
Database Flag Reader
v1.2

Introduction


Another very little script, and the first real scripting tool of mine. It's purpose is to practically use the note fields in the database, effectively returning it's contents to a hash. Check the instructions section for a more in-depth explanation of that.
Bottom line is: All of us who are using element tags to set non-default aspects to database elements can now not only choose between true or false (element_set.include? boolean), but also assign any integer, string or array you want for further usage.


Features


  • Returns any requested, predefined object in string, integer, array, hash, boolean, float or nil form
  • Works with all note-capable database tabs (Skills, Items, Weapons, Armors, Enemies, States)
  • Allows default values for easier setup and reduced error probability 1.2 and above


Script


Expand to see the code.



Instructions


Instructions



FAQ


Q: Why is this script VX-only?
A: RMXP doesn't feature note fields in the database, which is why a XP version wouldn't make sense.


Compatibility


Unless any other scripts have the same names as the ones in my script, it's perfectly compatible, as it's a simple add-on - no modified methods.


Author's Notes


I'm personally using this for my newly developed (unreleased) equip system, because - as mentioned in the introduction - just a boolean value isn't enough customization sometimes. It's a neat little add-on that won't hurt performance even if you just use it for a single item... though of course, you could most likely get there some other way in that case ;)


Thanks


...to Devlin for pointing out a major bug, along with the solution, which has been fixed for v1.2


Terms and Conditions


You may use and/or modify this script in any way you want, and/or release your modifications, as long as you accept the following terms and conditions entirely.
You may not use this for commercial projects, profit-oriented projects, or projects that aren't meant to be sold, but otherwise aquire money (i.e. through donations). That is not limited to RPG Maker projects, but valid for all appliances. You may not remove or delete contents of the original header included in the script, but you may add your name if you made any changes.

The actual mentioning of my nickname in your release (i.e. in-media credits, printed pages or even a readme file) is not necessary, but much apprechiated.

_________________
Image

If you have a slightly positive memory of my Power Shift contest game,
you might be interested in this development screenshot...
More info about that soon!


Last edited by BlueScope on Fri Mar 11, 2011 10:48 am, edited 18 times in total.

Top Top
Profile      
 

    Twirly
  Fri Dec 26, 2008 7:53 pm
aka twirly


This sure is interesting, it will make the life of many scripters easier
and if it will be creatively used, there will be some nice results.
Good job BlueScope :thumb:


Top Top
Profile      
 

    Twilight
  Fri Dec 26, 2008 10:33 pm
User avatar
Member


Location: Tuning up my Mech
Interesting script Scope, however I have a single question for you. Would I be able to make an effect like Attack*4 on a single line, where the script would reach each individual item (Attack, *, and 4) seperately? or would I have to make each effect a different value read?

_________________
http://sabao.xepher.net/blog/wp-content ... mariel.gif[/img]
http://i9.photobucket.com/albums/a64/pu ... cana/4.png[/img]
Everyone loves Mecha! Right?
Projects
Metal Wolf - (Mecha)


Top Top
Profile      
 

    BlueScope
  Sat Dec 27, 2008 1:11 am
The Third Man
User avatar



Location: Germany
I don't quite see what you're trying to do here, but I figure it's about multiple attacks... what you could do is make something like AttackCount = anInteger, and then have your battlesystem execute the basic attack algorythm for just as much times, using for example:

Expand to see the code.


It's pretty simple and useful, if you ask me... ^^

_________________
Image

If you have a slightly positive memory of my Power Shift contest game,
you might be interested in this development screenshot...
More info about that soon!


Top Top
Profile      
 

    tensuke
  Mon Dec 29, 2008 9:57 am
User avatar
Member

BlueScope wrote:
It's pretty simple and useful, if you ask me... ^^


That pretty much sums up this script! Great job!  :thumb:

_________________
Me+Lumi Forever!! <3


Top Top
Profile      
 

    BlueScope
  Mon Dec 29, 2008 10:55 pm
The Third Man
User avatar



Location: Germany
Heh, thanks for your input there. Glad you like it, and I hope you can utilize it ^^

_________________
Image

If you have a slightly positive memory of my Power Shift contest game,
you might be interested in this development screenshot...
More info about that soon!


Top Top
Profile      
 

    DrakoShade
  Tue Dec 30, 2008 5:51 pm
User avatar
Member

A curious method.  Notably less bulky than what I had done, although I see that the function is similar only on the most superficial level.  Dependent on on the needs of the user, I'd recommend yours over what I did in many situations.

_________________
Give a man a fire, and he's warm for a day...
Set a man on fire, and he's warm for the rest of his life.


Top Top
Profile      
 

    Twilight
  Tue Dec 30, 2008 6:11 pm
User avatar
Member


Location: Tuning up my Mech
Pretty neat, I think I can convert my script with this with a method name
Algorithm = [Strength, %, 300] which would return a skill that does damage equal to 300% of the users attack.

Sorry for the question for for that method HouseTeam, how would I set up the script to read it like that? Right now the method I am thinking about using might not work

_________________
http://sabao.xepher.net/blog/wp-content ... mariel.gif[/img]
http://i9.photobucket.com/albums/a64/pu ... cana/4.png[/img]
Everyone loves Mecha! Right?
Projects
Metal Wolf - (Mecha)


Last edited by Twilight on Tue Dec 30, 2008 6:29 pm, edited 1 time in total.

Top Top
Profile      
 

    BlueScope
  Tue Dec 30, 2008 8:13 pm
The Third Man
User avatar



Location: Germany
@Drako: I haven't seen yours, to be honest... if you submitted it, would you mind pointing me there for reference? ^^

@Twi: Depending on how you want the % there to work, you need to adjust it. By default, it's read as ["Strength", "%", 300], having two strings and one integer. Now if the integer there is always %, you don't need that one at all, if you wanna change between % and actual add, you should include a switch, aka formating it by [attribute, effect, amount], looking like something like this: ["Strength", 1, 300]

Now what you'd need to do within your script is doing something like this:

Expand to see the code.


Expand to see the code.


And so on, you get the idea... basically, it'd be smarter to use seperate flags, though, because they're easier to work with than arrays, and you have less trouble converting. I suggest you use something like this:

Expand to see the code.


That method also means easier customization, because you can without much hassle add default values within your scripts, so the user won't have to set the whole array, but can also leave 'Attribute' and 'Type' out if he or she wants to use your default-given value. Of course, you have to set those within your conditionals.

_________________
Image

If you have a slightly positive memory of my Power Shift contest game,
you might be interested in this development screenshot...
More info about that soon!


Top Top
Profile      
 

    Twilight
  Tue Dec 30, 2008 9:02 pm
User avatar
Member


Location: Tuning up my Mech
Thanks a lot scope, you just made this script a lot easier to convert

_________________
http://sabao.xepher.net/blog/wp-content ... mariel.gif[/img]
http://i9.photobucket.com/albums/a64/pu ... cana/4.png[/img]
Everyone loves Mecha! Right?
Projects
Metal Wolf - (Mecha)


Top Top
Profile      
 

    BlueScope
  Sat Mar 14, 2009 2:27 pm
The Third Man
User avatar



Location: Germany
Updated this fucking useful script with hash, float and nil values made possible... ah, I just love it :]

_________________
Image

If you have a slightly positive memory of my Power Shift contest game,
you might be interested in this development screenshot...
More info about that soon!


Top Top
Profile      
 

    trebor777
  Tue Mar 17, 2009 7:25 pm
Member

Can you implement symbols as well?
Would be useful for example to store methods name
to use later like this : myobj.method(mysymbol).call(myargs)

As their also unique identifiers, you could use symbols in your hash instead of strings. as it's just a symbol takes less memory than a string, making it faster to call.(almost twice faster)
thehash[:Test] instead of thehash["Test"]... Very easy to convert from or into a symbol 'my_string'.to_sym => :my_string :my_string.to_s => 'my_string'
or :my_string.inspect => ':my_string'

(just have a go and test this :
a = { :Test => 3 , "Test" => 4}
t = Time.now; 1000000.times { a[:Test] } ; p Time.now - t

t = Time.now; 1000000.times { a["Test"] } ; p Time.now - t
)


Top Top
Profile      
 

    Devlin
  Thu Apr 30, 2009 8:48 am
Member

Hey, you made a mistake.

When I was trying to draw a luck amount from the weapon, the game crashed. It also crashed with the armor item. It told me the flags did not exist. According to your topic, I can draw the flaglist from skills, weapons and armor. So I went to take a look at the script.

You wrote "Item", it should be "BaseItem" When I changed it to BaseItem, weapons/armors/skills now works for me.


Top Top
Profile      
 

    BlueScope
  Sat May 23, 2009 11:04 am
The Third Man
User avatar



Location: Germany
Hm, I see what you mean... I'll look into it when I'm back at home... but either way, thanks for the advice.

_________________
Image

If you have a slightly positive memory of my Power Shift contest game,
you might be interested in this development screenshot...
More info about that soon!


Top Top
Profile      
 

    BlueScope
  Wed Nov 18, 2009 6:34 pm
The Third Man
User avatar



Location: Germany
Lemme bump this to tell ya all I've minorly updated this script for improved functionality... while it's only three lines of new code and a changed version number, it's quite an effectful change: Default values for all flags you want to use. Check the updated instruction block for further information.

_________________
Image

If you have a slightly positive memory of my Power Shift contest game,
you might be interested in this development screenshot...
More info about that soon!


Top Top
Profile      
 

    Fustel
  Mon Apr 05, 2010 4:20 pm
uh...!?!
Member


Location: near Bordeaux - France
Nice script.
Just... may I suggest the use of the 'eval' function instead of the 'decrypt_string' method. It should help avoiding a lot of complex computations, and handle all classes as well as functions/method calls and other (un-)imaginable dynamic Ruby code execution. I once read something about undetermined programing, or something like that ('non-abouti' in french): the art of writing programs that overwrite themselves.... :crazy: :cute:


Top Top
Profile      
 

    BlueScope
  Tue Apr 06, 2010 10:17 pm
The Third Man
User avatar



Location: Germany
The problem with using eval, while being aware of all the advantages, is that it's likely to spawn mistakes compared to this method. It's like taking a text field for any kind of database input instead of the determined data, number-only or whatever fields: The user may ut stuff in in the desired way, or he may put in whatever he wants, spawning errors that result in an error that is - if i'd use the eval function - the fault of the script, not his. My method, however, decides between inputs effectively and considers everything a string that doesn't match anything else, not resulting in an error from the script's side. Admittedly, both ways, the user has to know what they're doing, but I still prefer this method, as for me, it's the clearer and more straight-to-the-pont approach. Also, the method in question isn't memory-or-time-expensive at all, which therefore doesn't result in a loss of performance too much (actually, unless you check a list of items a bazillion times, it shouldn't even be noticeable).
However, as the terms and conditions state, you're free to modify this to your projects needs, so feel free to replace the method in question with an eval command... this is a scripting tool, and therefore meant to be useful to the scripter who uses it.

_________________
Image

If you have a slightly positive memory of my Power Shift contest game,
you might be interested in this development screenshot...
More info about that soon!


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ] 


Who is online

Users browsing this forum: Majestic-12 and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group