[XP] Weapon Specific Skills

Started by Aqua, July 29, 2009, 02:04:12 pm

Previous topic - Next topic

samsonite789

September 28, 2009, 07:13:52 pm #20 Last Edit: September 28, 2009, 07:26:58 pm by Aqua
Yes, I do not have a weapon equipped when it throws the error.  That makes perfect sense.

I'm going to try adding Guillame's (sp?) multi-slot equipment script in and see if I can get them to work together, since that has the option of allowing barehanded weapons.  I don't know if that would fix the element set problem, but...

I'll play around with it and see if I can't cook something up.  But thanks for the insight!

Cookies coming your way.

Edit:
Me <-- Scripting n00b

What is the method or some such to check if a character has something equipped?  If I can just add another "if" in there checking if they have anything equipped, that might bypass the problem.

Aqua

September 28, 2009, 07:27:30 pm #21 Last Edit: September 28, 2009, 07:41:13 pm by Aqua
Don't double post within 24 hours; it's against the rules.

Lemme fix it right now.

Edit:
Posted edited.
Demo coming later... when my FTP host isn't so slow >.>

samsonite789

My apologies for the double-post.  I didn't realize it was against the rules.

Thank you for the edit!  I must admit, however, I messed around with it and came up with another solution as well.  I also figured out a way to make it work with more than one weapon slot (since barehanded having no element set was the problem).  I'd like to post that here so anyone else with similar problems can fix it as well:

IF USING ONE WEAPON SLOT:
Spoiler: ShowHide

class Game_Actor
  alias aqua_weapon_specific_skill_can_use? skill_can_use?
  def skill_can_use?(skill_id)
    unless $data_weapons[@weapon_id] == nil  <-----ADDED THIS LINE
      for i in 0...Aqua::WeaponSpecificSkills::DUMMY_ELEMENT.size
      dummyele = Aqua::WeaponSpecificSkills::DUMMY_ELEMENT
      weapon = $data_weapons[self.weapon_id]
        if $data_skills[skill_id].element_set.include?(dummyele) &&
             weapon.element_set.include?(dummyele)
          return super
        end
      end
    end
  end
   a = Aqua::WeaponSpecificSkills::DUMMY_ELEMENT.any? {|e|
        $data_skills[skill_id].element_set.include?(e)}
    return false if a == true
    aqua_weapon_specific_skill_can_use?(skill_id)
end


By adding the line:
Quoteunless $data_weapons[@weapon_id] == nil

It just bypasses the whole check if the player doesn't have anything equipped instead of thinking it needs an element set that isn't there.

TO MAKE IT WORK WITH MULTI SLOTS (SPECIFICALLY, GUILLAUME's):

When I tried it with multi-slot equipment (which I am using), there was another problem.  Although it wouldn't bug out, it assumed that if the first equipment slot == nil, then it didn't bother to check the second slot.  Therefore, if I equipped the required weapon in the first hand slot, the skill would work, but if it was in the second, it wouldn't.  So, I did the following:
Spoiler: ShowHide

class Game_Actor
  alias aqua_weapon_specific_skill_can_use? skill_can_use?
  def skill_can_use?(skill_id)
   
      unless $data_weapons[self.weapon_ids[0]] == nil
        for i in 0...Aqua::WeaponSpecificSkills::DUMMY_ELEMENT.size
          dummyele = Aqua::WeaponSpecificSkills::DUMMY_ELEMENT
          weapon = $data_weapons[self.weapon_ids[0]]
              if $data_skills[skill_id].element_set.include?(dummyele) &&
                weapon.element_set.include?(dummyele)
                return super
              end
        end
      end
   
      unless $data_weapons[self.weapon_ids[1]] == nil
        for i in 0...Aqua::WeaponSpecificSkills::DUMMY_ELEMENT.size
          dummyele = Aqua::WeaponSpecificSkills::DUMMY_ELEMENT
          weapon = $data_weapons[self.weapon_ids[1]]
              if $data_skills[skill_id].element_set.include?(dummyele) &&
                weapon.element_set.include?(dummyele)
                return super
              end
           
        end
      end
     
      a = Aqua::WeaponSpecificSkills::DUMMY_ELEMENT.any? {|e|
        $data_skills[skill_id].element_set.include?(e)}
      return false if a == true
      aqua_weapon_specific_skill_can_use?(skill_id)
     
  end
end


By making more than one unless block, it checks each slot independently.  Voila!

Hope this helps anyone else who has the same problem as I did.



ShadowPierce

->Hey, I have 0 scripting experience and I was wondering why this script doesn't work on my game? I currently have these scripts on my game...

Spoiler: ShowHide
Custom shop system by RPG advocate/ Fantasist(Where you can see what item can be equipped by your character & its effects)
Stat allocation system by Blizzard (Lets you customize what your character's stats are)
Ragnarok Online Skill System by Blizzard (Skill Tree system)
One man menu system by Rune (Menu where only the main character is displayed)


I have a hunch that it is in conflict with the stat allocation system but I really like those scripts & don't want to give them up, but I also need this script too... Pleas fix it...

Please & thanks!!! ^^



Spoiler: ShowHide
Quote from: Blizzard on February 16, 2011, 03:44:48 pmThere you go. It's the proof that SDK is crap. It's incompatible with itself.
3DS Friend Code: ShowHide
1161-0627-9890

Jackolas

Quotebut I also need this script too

you never NEED a script, you could use it and it makes your game better (if you know what your doing)
also.. look at what order the scripts are placed.


Aqua

Did you set everything up correctly?
Like the Dummy Elements and stuffles?

This script shouldn't conflict with /anything/... O.o

ShadowPierce

->Yep, I've made dummy elements for these weapon types:

Spoiler: ShowHide

*17- Sword
*18- Bow
*19- Javelin
*20- Rod
*21- Axe
*22- Dagger
*23- Fist
(Not sure about my numbering... Oh well...)


I also put their id in the script but when I try the game, the skills with Weapon requirements can't be used... If it's okay with you, I'll send it to you and tell me what's wrong... How can I send it to you?

Please and thanks!!! ^^



Spoiler: ShowHide
Quote from: Blizzard on February 16, 2011, 03:44:48 pmThere you go. It's the proof that SDK is crap. It's incompatible with itself.
3DS Friend Code: ShowHide
1161-0627-9890

Aqua

Did you go to the Weapons & Skills tabs in the Database and then add a Checkmark next to the corresponding dummy element?


If you did and it's still not working,
It miiight be RO Skill System... but Iunno XD

ShadowPierce

October 15, 2009, 08:20:18 pm #28 Last Edit: October 15, 2009, 08:41:21 pm by Aqua
->Yep, I did all that and checked everything that might be wrong... I'll try removing my other scripts one by one and post here when it finally works...

Please wait for my reply, I'll tell you when it works...




Edit:
->I tried removing everything but it seems that it's still not working... Maybe It's in an event or something? I made an intro NPC that forces the character to learn all his chosen job's skills... Maybe it has something to do with that? By the way, what are those stuffle thing you just said?

Waiting for your reply... Thanks for even replying!!! ^^




Aqua Edit:
No double posting within 24 hr :)

Spoiler: ShowHide
Quote from: Blizzard on February 16, 2011, 03:44:48 pmThere you go. It's the proof that SDK is crap. It's incompatible with itself.
3DS Friend Code: ShowHide
1161-0627-9890

Aqua

Make a demo of your game with no music, no extra graphics, and only map.
Zip & upload it on sendspace.com, then give me the link here.

I'll look at it when I have the time.

ShadowPierce

->I uploaded it here, please don't laugh, I'm just a noob...  :^_^': Anyway, here's the link:



Please analyze and reply when you have the time...

Please & thanks!!! ^^



Spoiler: ShowHide
Quote from: Blizzard on February 16, 2011, 03:44:48 pmThere you go. It's the proof that SDK is crap. It's incompatible with itself.
3DS Friend Code: ShowHide
1161-0627-9890

Aqua

Okay...First of all...
My script isn't in the demo you provided

And the problem isn't any of the scripts, it's your eventing.
You tried to equip a weapon to the actor when he doesn't have any weapons in the inventory.
You need to add the weapon to the inventory before forcing it to be equipped.

ShadowPierce

->The script wasn't there? Ooops... Very, very, very, very, very, very, very SORRY!!!!  :sorry:

So what's actually wrong is my intro event that forces the character to be equipped with a weapon? Well, I'll try it out now... Thanks for merely even replying...  :yesmaster:

BTW, (  :offtopic: ) what's your nationality?



Spoiler: ShowHide
Quote from: Blizzard on February 16, 2011, 03:44:48 pmThere you go. It's the proof that SDK is crap. It's incompatible with itself.
3DS Friend Code: ShowHide
1161-0627-9890

GAX

*Gives Aqua an uber-hug*

I'VE BEEN LOOKING FOR SOMETHING LIKE THIS FOR A WHILE NOW, YOU HAVE ONCE AGAIN SAVED ME!  (And G_G too, I was gonna bug him for something like this XD)

Rule 2: ShowHide
Quote from: Rule No.2Keep your signatures at reasonable size. The pictures in your signature may altogether be no more than 200kB and take up an area of 1600px2. That means 2 pictures of 400x200 are fine, one picture of 800x200 is fine and so on. Also your pictures height must not exceed 200 pixels, width can be as big as you want as long as your pictures match the other criteria. Every signature not matching this criteria is a subject of the moderator team to remove and leave this rule as message in your signature.

Aqua

Quote from: ShadowPierce on October 19, 2009, 04:56:32 am
->The script wasn't there? Ooops... Very, very, very, very, very, very, very SORRY!!!!  :sorry:

So what's actually wrong is my intro event that forces the character to be equipped with a weapon? Well, I'll try it out now... Thanks for merely even replying...  :yesmaster:

BTW, (  :offtopic: ) what's your nationality?




Yeah, you can't force the actor to equip a weapon when he doesn't have it in the inventory.
You need to add it first.

I'm Chinese

Quote from: GuardianAngelX72 on October 19, 2009, 05:16:57 am
*Gives Aqua an uber-hug*

I'VE BEEN LOOKING FOR SOMETHING LIKE THIS FOR A WHILE NOW, YOU HAVE ONCE AGAIN SAVED ME!  (And G_G too, I was gonna bug him for something like this XD)

*gasp*
An uber-hug?
Is that... contagious? D:

Murd

Is there any possibility to make skills that requires a shield (eg. Shield Slam, Shield Stun)? Or this script is only for weapons only..

Silentknight72

Did you know that this topic is almost a year old? Maybe you could just change the script or ask someone to do it.
Sigs: ShowHide






WhiteRose

His question was relevant and the author is still active, so his post doesn't break any rules.

As for your question, Murd, that is not possible with the script as it is now, but should be with a simple edit. Once Aqua gets back from her vacation, I'm sure she'll take a look at it for you.

Silentknight72

But he can make a new topic instead of that, right? maybe.....
Sigs: ShowHide






Lanzer

hey aqua can you remake it to work with armors D=?
kinda shield slam (requires shield) , mighty guard (requires armor) etc
thanks ;3