Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX][Review] Enchanting System

RMVX Enchanting System
by Near

This script allows you to enchant weapons using magic items (the script refers to them as "Soulgems", but you can call them whatever you want in the game itself).


Instructions:


In-Game Controls:
C = Select/Confirm
B = Back/Deny/Exit
L = Info Display
CTRL = Toggle Name Window
Left = Select Weapon
Right = Select Soulgem
For a complete diagram and key legend, see the script.

Calling the Enchant Menu:
To call the enchant menu, add into a script, or an event "script command" the following code:

$scene = Scene_Enchant.new

For a guide to creating Soulgems, please see the instructions in the script.

Screenshots

_ESVX_SS1.png

Naming an item

_ESVX_SS2.png

Selected the items

_ESVX_SS3.png

Checking the enchanting info

_ESVX_SS4.png

Looking at the weapon in the Equip menu (note the test frost gem was made to be invincible :p)

_ESVX_SS5.png

The animation of the ice enchanted attack, just starting

_ESVX_SS6.png

The Chimera right before it died, over 3000 damage with the invincible ice club :D

Script


The script is located here.

Demo


The demo download is located here.

Legal Notice

This script may only be used under the following terms:
  • This script may be used for noncommercial projects, as long as credit is given to Near/NWorks. If you wish to use this code in a commercial project, please contact Near through this URL:
    http://nworks.glitchkey.com/contact.html
  • This script may only be hosted on http://nworks.glitchkey.com/ unless express permission is granted by the owner, and this header must remain intact.
 
I'm in the process of taking screenshots at the moment, I'll put them up when I have a few.

Yes and no. It's a weapon enhancement system, using a normal game item.

EDIT: Alright, screenshots are up.
 
Could be still implemented without being overpowered while giving a unique customization and flavor to your weapon o.o

A system from Elsword where you can enchant your weapon with six element, divided into 2 categories. You can only pick one from either category.
A weapon can have 1 to 3 slot for enchanting (1 slot for normal while 2 to 3 for special rare weapons)
You can stack up to 3 of the same element for more effect or mix it with other element.

Timed - Applies a status effect with set turn of duration
Ice - 1 = Decrease speed by 10%, 5% chance of activation
2 = Decrease speed by 15%, 10% chance of activation
3 = Decrease speed by 20%, 15% chance of activation

Poison - 1 = Decrease Def by 15%, 5% chance of activation
2 = Decrease Def by 20%, 10% chance of activation
3 = Decrease Def by 25%, 15% chance of activation

Fire - 1 = Deals 100 damage per turn, last 3 turns, 3% chance of activation
2 = Deals 200 damage per turn, last 4 turns, 6% chance of activation
3 = Deals 300 damage per turn, last 5 turns, 9% chance of activation

Instant - Applies the effect instantly

Holy - 1 = Deals 10% more damage, 3% chance of activation
2 = Deals 15% more damage, 6% chance of activation
3 = Deals 20% more damage, 9% chance of activation

Wind - 1 = 5% chance to deal critical damage
2 = 10% chance to deal critical damage
3 = 15% chance to deal critical damage

Dark - 1 = 3% chance to absorb 5% of damage as HP
2 = 6% chance to absorb 10% of damage as HP
3 = 9% chance to absorb 15% of damage as HP

So a 3 slot weapon can have 2 Ice with 1 Dark, or 1 Fire with 2 wind. You can't have both element from the same category though, so no Ice and Fire on a same weapon o.o

Yeah I know its kinda complicated ^^;
Its cool though *.*
 
So, as Glitchfinder seems to be the one dertermining my afternoon activites lately, his most recent doing was dragging me in here, threatening me with his steam-powered battle tank and anti-smartass ammunition (which of course would be very effective :blank: ). Now that I'm here, though, there's no need to cry, and all need to comment this, as I've heard someone wanted me to... maybe the same someone who's reading this and now thinks "Damn you, Scope... I so could've skipped this entire paragraph without missing a thing! :|"


Now that that's settled, let's get to it... I gotta note I'm writing this at work without being able to test the script, so please don't mind any logical errors I assume from your screenshots (though they might be an indicator of bad interface design ;) ).
I will test the demo when I get home, bugtesting it a bit and write up some more if I should find anything particularly interesting (which I think I will, as that's when I'll take a look at the script itself :grin: ).

The process of naiming the item, then selecting what's actually going to be in it seems strange to me, assuming you make the name input pop up upon scene launch (if you didn't, and it ONLY works when pressing ctrl, you start out with a blank giant window in your scene that will be confusing to every first-time user). It's like buying buying fancy rims for a new car that you're going to get: You know you want to get this and that car type and color, but maybe in the process of deciding, you changed your mind and have to return those because suddenly, they don't fit anymore. In your case, that means you'd have to go back to the menu and re-enter the scene. To me, that's a no-go in user guidance. Either way, you might consider using direct key input instead of select-letters-with-cursor stuff, which isn't only console-originated and therefore completely wrong on the PC, but also vastly outdated - even on most consoles!
Actually, I think an auto naming feature would be more awesome. A crafting system I did a while ago had item attributes added to crafted items as prefixes or suffixes (aka "Fiery Blade", "Blade of Fire"), depending on their appliance (offensive attributes became prefixes, defensive attributes suffixes - such as "Blade of Resistance", which obviously is just an example to illustrate it's use). Going with something like this would not only render the part obsolete where you HAVE to name your items (of course you could create an option to do so either way), but work with a consistent array of items, as every item of the same make will be named the same (i.e. all Blades with a fire gem and a resestence gem will be named "Fiery Blade of Resistance"). Regarding the naming system, note that you can include an additional adjective if two extra words isn't enough for you, for example if you do "Fiery Blade of Sparkling Resistance", or something. You also wouldn't need the added [] to the description, that personally I think is horrible... it's like a text added to one window because there's no other window to put it in. Last but not least, you will ensure your game includes only quality names, not user-defined "G" items, which might turn out bad if people post screens with that (I know, way-too-long thinking going on here... just thought I'd mention it XD ).
I'd look up the code for you, but as that was an RMXP script of mine, it's not on my system anymore, and probably was very cluttered anyway ^^"

As for the returned values, they seem to differ from the crafting result screen to the actual equip window. Furthermore, you didn't seem to cap the value at 999 in the result screen. I don't know what's up with that... might as well be the screenshots being taken at different times?
The result window also has flaws in terms of design. For some reason, you chose a window far larger than the values actually need. That seemed to result in you increasing the distance between lines, or at least that's what I figure. By returning to the default WLH, resize the window accordingly (height and width!) and maybe center the text, or make the terms aligned left and the values right, which would probably be best, you don't only get a more genuine look regarding ALL the default scenes, but also don't cover up the information at the top containing the name and the ingredients, which I think should still have focus. And while you are at making things look more integrating, you might also consider changing the term's font color to system_color, just like it's happening in Window_EquipLeft, for example - again, consistency reasons.

As for naming the Soulgems Soulgems... that is a bad idea. This is a pluginable system for games, and you're providing a default name for it. Name them 'Upgrades', and let the users decide how they want them to be called in their games, everything else seems wrong in my opinion.
Also, the list on the right (which I suppose shows all contents of $game_items that are an instance of RPG::Item) strangely shows the Potion as an available item to merge. Now, you should either correct the font color if you can merge with a Potion, or consider if this isn't a crafting script, as there's no non-crafty reason that you would be able to combine a club and a potion other than to create a giant mess ^^"

But yeah, all in all, you got something cool going there... I like the easy switch between the two windows, as i'm sure others would'Ve chosen another way - this seems intuitively to use. I also like how an item changes value upon enchanting, which is an important factor. The example value in the screenshot seems random enough for me to assume it's actually not a predefined value, but a calculated change? If so, thumbs up for that, and way to go for an alternative way in games containing this script to make money!
All in all, I like the concept, however from what I saw in Pokémaniacs screen, there's no limit on how many items you can enchant with - you might want to change that, or at least provide a (non-Constant >_< ) way to adjust it.

Like I said before, there's more to come once I actually can test something out ^^


EDIT: Argh, bunch of text already... well, blame Glitch if you have to compain about someone :p


UPDATE: Okay, so first of all, I found a few bugs here and there; one being Soulgem (core), line 105: undefined method 'skill' for NilClass, the other was some scene error I stupidly clicked away, thinking I could reproduce it... also, you can open up the name and information window simultaneously, effectively covering the name window (which btw needs a backspace function badly ^^). Also, you can actually give items a 0 letter name, which is surely not what you want, right?
Other than that, now that I actually see how everything works together, I can basically renew everything I said above XD

First of all, the information window belongs somewhere stationary and always visible into the scene, as its used for pre-creation information instead of - what I thought - after-the-fact details. That means put it in the scene constantly and refresh it upon item change. Until the player put two items in there, you could probably display instructions or hotkeys there.
Speaking of which, your hotkey choice is beyond mediocre... I actually figured that while reading the post really, but it proves especially right now that I play it. You actually did the name window as I planned to suggest, which is a good thing, however it's also the only way to actually create the item, and to get there, you have to press Ctrl, which is a function key. Instead, use RMVX key "A", which is on Shift by default and a commonly used button. In case you want to keep the information window popping up as it is, put that on the tab key or anything, but not L - that'd be far more suitable as a synonym for pressing the left arrow key, for those people who are familiar with the default way of handling stuff in RMVXP and assume L/R window switches.
As for the actual crafting process, it's a bit confusing that there's NOTHING in that window allowing you to craft something. Also, when you eventually figured out that you can make the name window come up, noone ever told me that "OK" means "finalize the process". I think you have a bit of user guidance ahead of you here... (again, autonaming would make things easier here... to expand that idea a bit, maybe label self-crafted (as in crafted by the very player) items somehow and then allow renaming these somewhere specific, so you don't loose the awesome naming feature that I admittedly really like - it's just in the wrong spot).

Now for the scripting par... I gotta say you got a style I don't really like... no documentation with one exception being the Gems hash entry, which is rather strangely done. You miss all kinds of method seperators, which is why people like me who automatically look for green stuff in code to seperate method with get lost. As far as scripting style goes, you have the very common "either do spaces inbefore and after an operator, or not" thing going, that isn't very nice. You also use variable names such as @ele, which personally I think is totally unexplanatory (it was mostly the Gosu forums that made me realize I'm assuming too much knowledge on the script reader myself... suddenly, I was around people who sometimes never played RPGs in their live, and I was explaining them stuff and showing them code, thinking "of course they did"... same for your element variable: If someone doesn't know what the script does, or that it'S for an RPG, they'll be totally lost).
As said above, I don't really like the term "Soulgem" being used for a script's terms, however, you named many variables after it. You should really go for an explanatory name here, instead of a made-up term that you and 50% of other people can guess right, but the rest will get wrong.

As for your way of using the Notes field: It's a nice approach, but in my opinion, it's a bit less user-friendly than it could be, as you're assuming every line getting used (and therefore take empty lines as a necessity). If instead you'd take a look at my Database Script Reader, which I linked in my signature, you'll find a vastly easier way of doing things, getting rid of the negative aspects and getting you some user guidance in terms of they always see right at the notes field what exactly they set their, instead of just random numbers. It comes with a mention-me-in-your-header license, aka no need to credit me for the people ending up using this, which again means no negative for you on that side either.

Finally for your header "script", I'd suggest making a readme file instead. That's easier portable and can be formatted, given you don't use a .txt file. If you'Re going for perfection, an illustrated PDF file would be perfect, however maybe taking it too far.

So yeah, second bottom line, I guess... I still like the script, but you have to have a lot of work ahead of you to make it a shiney product of awesome... mostly on user guidance. Also, please note that I'm not being picky for the sake of it, but because you put [Review] in the title (plus set your bloodhound Glitch on the hunt for me :shock: ). I hope I could give you an idea about what others might see in your script, and while you surely don't agree with me on everything, I think I've mentioned a few points that you should definately tinker about...

Keep up the good work.
 
Haha first things first: Thank you. You've given me more than few ideas, and think I know most of the issues I need to correct. And second: I never actually asked Glitch to hound you about it :p

A few of my personal things with it: I really don't want auto-naming, at all. I just don't like it. And I think I can implement full keyboard support for the naming, I was hoping not to, but if it seems like the better approach, then that'll work for me. Also, "OK" being the button for actually finishing the enchantment should be somewhat obvious, I mean why else would the name window have one? Though I could change to "Finish" or something similar...

And yes, I used notes, because it seemed like an easier approach than the Hash. I'm not quite so sure anymore I guess, but perhaps I can work it out. And the script you were talking about, doesn't seem like a bad idea. I'll look into it.

Also a few notes on my style: I am actually working on the commenting thing right now. In fact, the script I'm working on now(which unfortunately I do NOT plan to post on the net)has the most commenting I've ever done in my life. And with variable names, I'm sorry if they aren't very explanatory, but I can usually sort them out for myself, and I don't like have variable names that are more than a few characters long. It's a personal preference, but I'll work on that too. And this:
As far as scripting style goes, you have the very common "either do spaces inbefore and after an operator, or not" thing going, that isn't very nice.

I didn't quite understand what you meant there, could you repeat that to me?

Well, as I don't have a whole lot of time on my hands right now, this is all I can really say at the moment, but be sure I'll be back with more later :p
 
As far as the line goes, I meant going both "value1 + value2" and "value1+value2" in the same script.

And well, of course the script I linked isn't a bad idea :mad:
^^
 
Well, whether or not I have the space depends on the script, kind of, if you understand. What I'm doing and how far it's going on the line are big factors. If I run out of line space because of the spaces, I'll remove them.

And yeah, like I said, I'll definitely look into it.
 
Ulqiorra":3lgcz1ja said:
Well, whether or not I have the space depends on the script, kind of, if you understand. What I'm doing and how far it's going on the line are big factors. If I run out of line space because of the spaces, I'll remove them.

And yeah, like I said, I'll definitely look into it.

You could always stick the code block into parentheses and have it spill over to a second, indented line, instead of using inconsistent formatting style.
 
Glitchfinder":2c1s2b6x said:
Ulqiorra":2c1s2b6x said:
Well, whether or not I have the space depends on the script, kind of, if you understand. What I'm doing and how far it's going on the line are big factors. If I run out of line space because of the spaces, I'll remove them.

And yeah, like I said, I'll definitely look into it.

You could always stick the code block into parentheses and have it spill over to a second, indented line, instead of using inconsistent formatting style.
Exactly what I'd suggest... I gotta admit I do the same thing you do with the dependency on line length, however for a finl version, stuff like that always gets sorted out.
 
Yeah. I dunno, the the second line thing just looks strange to me. But whatever, consistency seems like a necessary thing, so I'll suck it up :p
 
there is also stuff that needs to be cleaner :)

you don't need to use return, unless you want to exit a method before its last line...
stuff like this
[rgss] 
  def item
    return @data[self.index]
  end
  def include?(item)
    return false if item == nil
    return true
  end
  def enable?(item)
    return true
  end
 
[/rgss]

is pretty bad..
then the code inside as well isn't very useful..

especially on "include?": you can save some time like this
[rgss] 
def include?(item)
    !item.nil?
end
 
[/rgss]

you can save some lines as well with the single instructions "if" and "unless" blocks...

truc = bidule if machin
rather than
if machin
truc = bidule
end

that's more self explanatory if the naming is good :) than having to document it.

WHen you break down an expression onto several line, it shall restart where the 1st element starts so that everything is properly aligned and so we understand that the new line actually belongs to the previous one, rather than being new stuff wierdly written.

Code:
 

    new_price = (effects.stat_eff[0] + effects.stat_eff[1] +

      effects.stat_eff[2] + effects.stat_eff[3] + effects.stat_eff[4] + 

      effects.stat_eff[5] + effects.stat_eff[6]) / 7

 

becomes
Code:
 

    new_price = (effects.stat_eff[0] + effects.stat_eff[1] +

                      effects.stat_eff[2] + effects.stat_eff[3] + 

                      effects.stat_eff[4] + effects.stat_eff[5] + 

                      effects.stat_eff[6]

                      ) / 7

 

nothing more to add, as everything was pretty much already picked by BlueScope :)
 
As for your last code block, you likely mean:
[rgss]    new_price = (effects.stat_eff[0] + effects.stat_eff[1] +
                effects.stat_eff[2] + effects.stat_eff[3] +
                effects.stat_eff[4] + effects.stat_eff[5] +
                effects.stat_eff[6]) / 7
[/rgss]

And yeah, while basically everything you said is technically right, I personally like the return indicators for readability. Sure you have a bit more code here and there, but imagine a relatively new person looking at a line that just says !item.nil?... that'll totally screw every beginner (and even some intermediates?), as it's simply not explanatory at all. The return indicator isn't all that performance-breaking either, as you save a line of comments for it (and comments are being read by the RGSS Interpreter). All in all, I think this is a think that benefits guidance through the script greatly.
Overall, I like your shortenings though... the default scripts don't suggest doing something like that, which is likely why so few people even try (gotta count myself to these ^^" ).
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top