[XP] Element Attack Armors

Started by G_G, February 22, 2010, 10:30:29 pm

Previous topic - Next topic

G_G

February 22, 2010, 10:30:29 pm Last Edit: February 26, 2010, 09:55:20 pm by Hellfire's G_G
Element Attack Armors
Authors: game_guy
Version: 1.0
Type: Armor Add-On
Key Term: Actor Add-on



Introduction

All armors setup in the database just allows you to make them guard against elements. This scripts makes it possible to allow them to add elements to your attack. Ex: You have Fiery Ring = Weapons do fire-typed damage when equipped.


Features


  • Adds elements to your attacks according to armor wearing.



Screenshots

N/A


Demo

N/A (Unless you really want one. Ask me.)


Script

Spoiler: ShowHide

#===============================================================================
# Element Attack Armors
# Author game_guy
# Version 1.0
#-------------------------------------------------------------------------------
# Intro:
# All armors setup in the database just allows you to make them guard against
# elements. This scripts makes it possible to allow them to add elements to
# your attack. Ex: You have Fiery Ring = Weapons do fire-typed damage
# when equipped.
#
# Features:
# Adds elements to your attacks according to armor wearing.
#
# Instructions:
# Go down to Setup Armors and follow instructions there.
#
# Credits:
# game_guy ~ For making it
# jragyn00 ~ For requesting it
#===============================================================================
module GameGuy
 def self.accelement(id)
   case id
    #===========================
    # Armor Element Attack Setup
    # Use when armor_id then return [elements]
    #===========================
   when 25 then return [1, 2, 3, 4]
   end
   return []
 end
end
class Game_Actor < Game_Battler
 alias gg_elem_armor_attack_lat element_set
 def element_set
   return multi_equip_elem if defined?(G7_MS_MOD)
   elem = gg_elem_armor_attack_lat
   for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
     if i != nil
       for j in GameGuy.accelement(i)
         elem.push(j)
       end
     end
   end
   return elem
 end
 def multi_equip_elem
   elem = gg_elem_armor_attack_lat
   for i in self.armor_ids
     if i != 0
       for j in GameGuy.accelement(i)
         elem.push(j)
       end
     end
   end
   return elem
 end
end



Instructions

In the script.


Compatibility

Not tested with SDK.
Compatibility made with Guillaume777's multi equip script.


Credits and Thanks


  • game_guy ~ For making it
  • jragyn00 ~ For requesting it



Author's Notes

Enjoy!

Spaceman McConaughey


WhiteRose

Another fantastic script masterpiece by G_G. Great work, like always. *Levels up!*

Landith

Very nice. Good job.

[offtopic]

And gratz to WhiteRose for reaching post 69.

WhiteRose

Why thank you. It is indeed a momentous occasion.

Jragyn

 8)
Your scripting technique works, and works well.
You are welcome to add the compatibility of BlizzABS to this as well (if it matters) as it works there too!

I thank you again for making this script!
I will make certain to harass you specifically for scripting methods again in the future   :)


--JeR
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

Blizzard

I see no reason why it shouldn't be working with Blizz-ABS already.
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.

Jragyn

No no no, I mean...
add the wordage that states its compatible with Blizz-ABS in the original post, so people know! :D

My mistake for the miscommunication.

I know it werks with BlizzABS, it was the first thing I verified upon posting.  :ninja:
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

Jragyn

Okay, so I suppose I didn't think to bother trying this, but I noticed a err, bug perhaps?

Upon equipping the armor, it does indeed grant the element, and it works just fine.
However, if you pull the armor off that granted the elemental effect, the effect persists.

Its like equipping the Fire Ring once was all it took! Now my attacks are forever fire-typed even IF I unequip the ring! nuuuuuuuuuuu.

I imagine the fix will be like, a single line, adding an else statement or something to nil the element that was .pushed...but I dunno.

boss?

A bright light can either illuminate or blind, but how will you know which until you open your eyes?

G_G

I just tested it with and without the multi equipment script. The fire element does not stay. Are you sure you don't have the ring equipped twice? Or perhaps a weapon or another armor with the fire element on it?

Kett Shee

neat script G_G. *puts in my closet of favorite scripts*
You're all daft cunts. I love you. <3

G_G


Kett Shee

Your Welcome! *levels up* This already fills my head with random names for elements.
You're all daft cunts. I love you. <3

Jragyn

oh, actually I DO use G777, in conjunction with BlizzABS, so perhaps it is what is making the difference... On that note, I am quite certain that I have only one equipment piece that grants such an effect. X_X Oh its a sad day.


--JeR
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

G_G

Make an event and use this script call.
p $game_actors[id].element_set

Call that script when the fire ring is equipped.
Then remove the ring and call the script again.

Jragyn

Upon following your instructions, this is what printed before the ring was equipped:

[]

Then while the ring was equipped:

[1]

And after the ring was removed:

[1]


Judging by this, I'd say that removing the ring doesn't remove the element.
Whats next?
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

G_G

Its probably another script conflicting with it. I just tested it again on multi equip. The only option I can think of is try placing this script below the Multi Equip script.

Jragyn

I tested it tooooo.
I opened a brand new project, no scripts save the G777 and your element script, and it commits the same grave sin. What are you doing that I am not?

Here are my steps, correct me if I made a mistake:

-->new game! walk on event that calls the script as you requested involving .element_set

-->equip a piece of armor that grants an elemental attribute. Step again on the event involving the .element_set to verify that actor[ID1] does infact have the fire element in his attack set. He does.

-->take the armor off and step once more on the event that calls .element_set of actor[ID1] to see
what he has, and sure enough the .element_set includes the [1]-element still.

Am I missing something?
Would you like a brief demo showing these steps?

A bright light can either illuminate or blind, but how will you know which until you open your eyes?

G_G

The only problem I see is that you're not using the latest mutli equip script. The one I'm using and testing with is 6.2.2. Here's a demo. Talk to the guy it'll show that you do have elements in your attack. Remove the shield talk to him again and it'll show you that its empty.

http://www.sendspace.com/file/cmngwm

If you're not using 6.2.2 use the script from the demo.

Jragyn

but I am using the latest script. 6.2.2, spot on.

here, take a look at this:
http://www.sendspace.com/file/5vhsl6
Its my demo. You begin with a fireshield in your inventory. Step on the flower to view elements.
I even made a feign battle so you could make sure maybe by some offchange the element.set wasn't updating or something.

I can't possibley view anything that is wrong.
Maybe I just missed something.

btw, I dunno if err its you or sendspace, but its claiming I can't download it from some error.


--JeR

PS_Thanks for your continued support, I do appreciate you barreling through my dilemma after dilemma.
A bright light can either illuminate or blind, but how will you know which until you open your eyes?