Element transmited to skills by weapons
#1
hello,

i having hard times on RMXP as i don't know programmation.
There is one thing i really need to change in the RMXP system and i don't have a clue how to proceed... :

* You can add element (as Fire, Air, Earth, Water, etc) to a weapon (ex. Fire Sword)
or to a Skill (ex, spell Fire 1).

* But the element associated to the weapon, as for the Fire Sword, will give element (Fire) only in case of normal attack.


* I' m using so far 5 Element for my project, as :

1 = Fire
2= Air
3 = Earth
4 = Water
5 = Non Elemental (that i set in the data base as an Element)


What i need is to change the system so that any Non Elemental Skill ( in other word
any Skill taged with Element #5) get the Element of the weapon Equiped.
So that a Non Elemental Skill as for example Dash Attack, will get a Wind attack if the user has equiped a Wind Sword.

But if the Skill is elemental, (ex Tsunami = Water = Element #4), nevermind the weapon used or its Element, it s still gona be Water (and only Water, i don' want any equip/ skill to have more than 1 Element).

Could a script make it possible ?
thanks for your help !


PS : sorry if my english is bad... i'm french :/

Fighting for peace is like screwing for virginity.
Reply }
#2
This is most likely possible, at least through scripting. I'm thinking to myself if there is already a script out there that does this, I'll take a look. Anyway, there may be a way to do this with common events (since eventing is my speciality) and I think you can change states. Anyway, I'll look into it for you until a scripter comes online and reads this.
Reply }
#3
That' s really kind, thank you so much !

Fighting for peace is like screwing for virginity.
Reply }
#4
This requires a change in Game_Battler 3, method def skill_effect(user, skill)
Put

Code:
# Element correction
      weapon_elements=[]
      if skill.element_set.include?(5)
        if user.weapon_id > 0
          weapon_elements=[1,2,3,4]&$data_weapons[user.weapon_id].element_set
        end
      end
      self.damage *= elements_correct(skill.element_set | weapon_elements)

instead of

Code:
# Element correction
      self.damage *= elements_correct(skill.element_set)
Reply }
#5
Thanks a lot for your reply Charlie ! :cheery:

It looks like the script change you have advised is not having the required effect.
I will detail more how my battle system is working :


Basically, all weapons and armors are Non Elemental (#5), and later in the game a crafting system allows
weapon enchanting with elements. (i already get this feature in my scripts)

Non Ele attack (5) against : Non Ele defense = 100 % dmg
Non Ele atk against : any Ele def (#1,2,3,4) = 75% dmg
Any Ele atk (1,2,3,4) against : Non Ele def = 125% dmg

then, when both attack and def are elemental, it s going like that :

Fire attack against : Fire, Earth = 100 %, Wind = 150%, Water = 50%,
Wind atk against : Wind, Water = 100%, Earth = 150%, Fire = 50%,
Earth atk against : Earth, Fire = 100%, Water = 150%, Wind = 50%,
Water atk against : Water, Wind = 100%, Fire = 150%, Earth = 50%

I got all the script i need for that already and the system is working perfectly,
except when i m using skills.

Let's take the example with Wind def :

When the actor got an Earth Sword, normal attack, dmg to Wind def is about 170
When the same actor got a Fire Sword (all with same stat or atk pwr) the dmg to wind is about 400.

So the system is working pretty well. My problem is that when i use a
Non Elemental skill (as Double Slash), with my fire sword, i want the Double Slash skill to get the Fire Ele from the sword instead of its own Non Ele.

After i have copy/ paste your code, and tried it out,

my Non Ele skill with Fire Sword on wind mob was about 520 dmg
my Non Ele skill with Earth Sword on wind mob was about 520 too.
(Whereas one more time, when i'm using normal attack, the element resistance/ weakness is working)
I just need the non ele skill to get the weapon Element, so that it deals more dmg when it's Fire against Wind, and less when it s Earth against Wind.


I hope i m not too confusing.. And it looks like i still need your help ><
thank you ! m(_ _)m

Fighting for peace is like screwing for virginity.
Reply }
#6
The code I posted does what you asked for with the default battle system. You should have mentioned that you have custom scripts.

What scripts are you using? If you posted a demo it would help.
Reply }
#7
OK... I m sorry for inconveniences

Charlie i made a demo i m gona send you throught PM right now.
thank you
OMG Charlie you're so right !

you're script is working now !
as i m using the Tenketai SBS system i had to go in the "Sideview 2"
script and find the sentence you asked me to find in Battlers3.

it s all fixed now, thank you so much for everything !!! XD
Reply }
#8
you're welcome Grinning
Reply }
#9
All right, after testing everything i actually have a last pblm with this issue... (*sight*...sorry)

I am using a custom SBS script, that requires to tag weapon with their element for animation.
I mean that Slash Element, Bow element, Spear Element etc. will give Slah anim,
Bow anim, Spear anim, in battle.

if i dont tag my weapons + the skills with the Bow element (for example),
the bow user is gona move to the enemy and strike with his bow as if it was a sword.
So i really need to tag weapons with their animation related tag, and same for the skill.


the problem is that all the monsters have a resistance to the weapon Element of C (normal damage).
So in case of a skill (let s say "magic arrow") cast with a fire bow, on a wind enemy
(so 150% dmg is expected) RMXP is calculating like that :

Bow taged with Fire = 150 %
Bow taged with Bow = 100 %
Skill taged with Non Ele (your code fix that, it s getting the fire ele from the weapon) = no incidence
Skill taged with Bow = 100%

and instead of getting the 150 % dmg expected, RMXP makes an average of all of those, 350/3 = 117%

T_______________T
Reply }
#10
hello there,

i just edit this post cz i ve thought i ve found a script fixing the pblm... but it s not :(
i don't know what s wrong but it s supposed to give the effect i m looking fore ><

quote :
"Unless you want your skills doing extra damage to the enemy because
of their elements, I'd suggest following these instructions. (Special
thanks to PhotonWeapon here, and RPG Advocate)

#--------------------------------------------------------------------------
# ? ???????
# element_set : ??
#--------------------------------------------------------------------------
def elements_correct(element_set)
elements = element_set.clone
elements.delete(18)
elements.delete(17) #Whenever you get a new element that you don't
# ?????? want to count as an element, just add to
if element_set == [] to the elements.delete list. (Also, you
# 100 ??? might want to replace the 18 and 17, eh?)
return 100
end
# ???????????????????
# ????? element_rate ?????????????? Game_Actor
# ??? Game_Enemy ?????????
weakest = -100
for i in element_set
weakest = [weakest, self.element_rate(i)].max
end
return weakest
end"
end quote

I just have anothervery minor pblm... if anyone knows how to fix it :

All the basic armors got the Non Elemental ele (taged with ele #5)
wearing a non ele stuff makes the player weak to any ele attack so that he takes 125% dmg.

here is my pblm : when actor doesn t wear any armor, he doesn t have the non ele state anymore, and takes 100% dmg from ele attack, instead fo the supposed 125%
that means that wearing no armor makes the player more resistant to ele spells
than to wear a non ele armor, that bring some magic resist... =_____=

how can i set that ele attacks deals +25% to player that didin't equip a top ??

thank you !
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Refreshing original skills names Whisper 2 5,036 05-31-2020, 04:35 PM
Last Post: Whisper
   Showing only specific skills in a window Mel 2 5,900 01-12-2016, 01:34 PM
Last Post: Mel
   Syvakal's Conditional Skills And Equipment Crashes Samven 0 3,958 08-02-2011, 01:58 PM
Last Post: Samven
   Help with using KGC's delayed skills prioran 0 3,627 05-07-2010, 11:46 PM
Last Post: prioran
   Skills that restore SP and reactive skills. Admetrynne 5 8,034 03-29-2010, 05:49 PM
Last Post: Admetrynne
   Simple Request about Element Defense status mageone 0 3,286 11-21-2009, 06:40 PM
Last Post: mageone



Users browsing this thread: 4 Guest(s)