[Resolved] [XP] Help with Charlie Lee's Enhanced Equipment script

Started by Kaiph, February 25, 2016, 11:17:46 pm

Previous topic - Next topic

Kaiph

Hey guys, I'm having a little issue with a script I found in Pandora's Box.
It's a script which allows you to enhance your equipment temporarily with certain items. It works for the most part when I use it to increase stats, but I've added in a number of enhancements to give elemental and status attack/defense.
My issue is that once these enhancements have been removed from the equipment, their effects stick to that piece of equipment, so to speak.
Example, I equip a Fire enhancement to my weapon for a snowy area, but when I take it out in, say, a desert, my attacks are still dealing the fire damage. The effect is the same for elemental/status defense.

If anyone can offer any advice on this, I'd be grateful. The scripts are below and if you're wanting to use the script to run tests or whatnot, you'll need to import the attached images into your Pictures. Thanks :D

https://www.sendspace.com/file/zig9hz

Spoiler: ShowHide

Spoiler: ShowHide

KK20

Character limit reached.

Either use something like pastebin or upload your Scripts.rxdata

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Kaiph

I didn't even realise there was a character limit, it looked fine in the post preview  :huh:
I'll sort that now, sorry.

Edit:
Uploaded the Scripts.rxdata and images :)

KK20

So I downloaded the Pandora's Box and your scripts.rxdata at work (lol) and saw absolutely no changes between the two. I don't get what you did to make your weapons have an elemental attribute attached to them when there's nothing in the instructions that mentions it.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Kaiph

I literally just made an enhancement with an elemental affinity. I made a little test game to try and replicate it using just those scripts and I've encountered the same problem as you, so I'll check my other scripts to see if I've added in anything that allows it, although I can't imagine myself having that kind of scripting knowledge about three years ago when I started this project. Will only have the time to do it tomorrow though.
The scripts.rxdata I uploaded only has the scripts for the enhancement system, so unless I've changed something in another script, or another script is conflicting with it, I dunno.

Kaiph

So I've done some tests and come to the conclusion that it's a mix of Blizzard's Tons and Analyze scripts, since if I remove either of them, the elemental/status enhancements won't work at all. I'm gonna work through each of the Tons scriptlets I'm using and try to pinpoint which part(s) is/are conflicting with it and get back to you.

In the meantime, I've got around the issue by making the elemental/status enhancements fixed so that once they're applied, they can't be removed. Though I'm still curious as to why I can't get these enhancements to work without those scripts.

Edit:
At the start of Tons 1 is a little snippet which I'm assuming is to deal with the dummy elements earlier specified in the script. If I take out this bit of code, it stops letting me make the elem/stat enhancements. Same with if I put my elements in the dummy list.

Spoiler: ShowHide
class Game_Battler
 
  def elements_correct(elements)
    multiplier = size = 0
    elements.each {|i|
        unless $DUMMY_ELEMENTS.include?(i)
          multiplier += self.element_rate(i)
          size += 1
        end}
    return (size == 0 ? 100 : multiplier/size)
  end
 
end

Blizzard

I might be able to shed some light on this mystery. Both scripts you mentioned of mine use "dummy elements" to accomplish some specific functionality. So they are obviously conflicting with this script. Have you tried putting the script above/below mine?
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Kaiph

Edited my last post before I realised you'd replied xD
And yeah, I've tried putting it above and below tons, to the same effect. The thing is, if I remove either of them, the enhancements stop working.

KK20

I actually made a mistake. The script by itself does actually apply the element set of the "enhancement". The problem I'm currently facing is finding out where the setting actually takes place.

I was putting prints for @element_set in Enhanced_Weapon#element_set. If your enhancement gave Fire (ID 1) and you equip it to your sword, the sword's @element_set will now include a 1 in the array. But I don't see anything in the script that does
@element_set =
or
.element_set =
to make this change. This only occurs when you initialize the Enhanced_Weapon
@element_set = $data_weapons[@ref_id].element_set

But I put a print statement above that line and it was never called when I attached the Fire accessory.

So I'm still at a loss as to what is going on. For one of Charlie Fleed's scripts, this is pretty bad.

EDIT: Okay I finally figured out what he's doing, but it's a terrible way to do it. In fact, a lot of the decisions he made I do not agree with at all. Can't say I can find a solution to this, but I'll try something...

Okay yep:

  def element_set
    result=@element_set.clone

Make that change and give it a shot.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Kaiph

That's worked perfectly, thanks :D I've done the same with def plus_state_set and minus_state_set so we'll see if that works the same way.

Level up though ;)