[XP] RO Job/Skill System

Started by Blizzard, January 09, 2008, 04:24:13 pm

Previous topic - Next topic

Aqua

There's an event command that does this. :)

You could also use
ACTOR[ACT].learn_skill(ID)


Where ACTOR is either from $game_actors or $game_party
ACT is the actor ID (begins with 1 with $game_actors but 0 with $game_party)
and ID is the skill ID.

$game_actors[1].learn_skill(1)

Would make Arshes learn Heal.

themrmystery

I feel like an idiot, ugh.  I've been working on my very first script for like the past week or more, and completely forgot how to actually make simple events.

Thanks though, haha, that works very easily. =P

Blizzard

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.

themrmystery

February 13, 2009, 11:35:45 am #63 Last Edit: February 13, 2009, 11:49:10 am by themrmystery
Question about the Skill Levels / Power Cost:

This may just be a bug, if so, might be worth fixing? Or if not possible to fix, so be it =)

When setting the power cost for level 1; normally as per your instructions your set it higher... 150% or 200% and the cost reduces as you spend more job points into it...

ie) 200 SP cost at 1, 175 SP cost at 2... etc..

My problem is I want to work a backward method, and I set the cost to be less than 100%, which works... I also use low power for my skills... sooo

At level 1 your character has anywhere from 5-10 SP
Your first level skill has a max SP of 50, and a level 1 cost of 10%

So: Aluxes has 5 SP and has a skill at 50(10%) = 5 SP cost
(this part of the script works fine)

The problem is, the skill doesn't become "usable" in combat UNTIL you get 50 SP on your actor.... once used the skill properly takes away only 5.  I just need the skills to be activated while the player has 5-49 SP ant not 50, as long as the modified cost is in his SP range.

I hope I explained that well enough. But basically, my actors sit there with 10 SP and a skill costing 5 SP, and can't use it, until their max gets to the upper limit.


Why do I need this?
To me it makes more sense that as a spell/skill gets more powerful and you get more total SP, it should cost more =)

Thanks!

Edit: Addition: I tried something simple, like this, but it gives me a no method defined error for skill_level

class Game_Battler
  #--------------------------------------------------------------------------
  # * Determine Usable Skills
  #     skill_id : skill ID
  #--------------------------------------------------------------------------
  def skill_can_use?(skill_id)
    # If there's not enough SP, the skill cannot be used.
    if $data_skills[skill_id].sp_cost > BlizzCFG::LVL1_POWER + (@actor.skill_level(@skill.id) - 1) *
          (100-BlizzCFG::LVL1_POWER) / (BlizzCFG.roskill_maxlevel(@skill.id) - 1)
      return false
    end
  end
end

Blizzard

February 13, 2009, 01:15:15 pm #64 Last Edit: February 13, 2009, 01:19:21 pm by Blizzard
You are fixing one of two methods. You need to remove the "@actor." as you are calling the method from within the actor already.

The other place you need to edit is where the SP are consumed. You need to apply the same formula. Your formula is much easier to implement.

class Game_Battler
  alias skill_can_use_mod? skill_can_use?
  def skill_can_use?(skill_id)
    if self.is_a?(Game_Actor) &&
        $data_skills[skill_id].sp_cost * self.skill_level(skill_id) / BlizzCFG.roskill_maxlevel(skill_id) > self.sp
      return false
    end
    return skill_can_use_mod?(skill_id)
  end
end
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.

themrmystery

I'm not quite sure I follow you.  When the SP cost is set below 100% so it uses less SP at lower levels, until it reaches it's max, at higher levels, it already correctly subtracts the smaller amount...

ie) if you have 15 SP max, the skill is at level 2 and costs 7 SP, and at level 10 the skill will cost 50 SP... currently, you can't use the skill (what I'm trying to fix)
but if you have 60 SP max, the skill is at lvl 2 and costs 7 SP, and at level 10 it still is 50 SP, the script lets you use the skill, and only takes away 7 SP

I realized my math was backwards, ie it was checking to see if your RO_skill_cost was less than the skill_id_max

So I changed it to read if RO_cost > self.sp   so if the modified cost is higher than your current SP? it's still not working, and I attempted to do what you said, but I'm a very novice scripter =/

class Game_Battler
  alias skill_can_use_mod? skill_can_use?
  def skill_can_use?(skill_id)
    if self.is_a?(Game_Actor) &&
        BlizzCFG::LVL1_POWER + (skill_level(@skill.id) - 1) *
          (100-BlizzCFG::LVL1_POWER) / (BlizzCFG.roskill_maxlevel(@skill.id) - 1) > self.sp
      return false
    end
    return skill_can_use_mod?(skill_id)
  end
end

Blizzard

As I said, there is anther location in the script where you need to edit calculation formula. Best you press CTRL+F and search for LVL1_POWER. There are actually two more places, but one is used in Blizz-ABS. I'll put it all in one place in the next version.
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.

feandrad

Quote from: Kagutsuchi on February 07, 2009, 06:28:47 am
I decided to temporary remove the CRSL system, until you had hopefully fixed it, but now I encounter this problem when the characters try to execute a skill.

(Skill learning script = RO Job/Skill System)

I suspect this might mean that it isn't compatible with blizz abs :( I am hoping you can fix this too. (Please prioritize getting the RO Job/skill system compatible with blizz abs, rather than the crsl system)


I have the same problem, it's already fixed?? I put the script above the ABS and Tons and the skill works, but the SP cost is always the max.

Blizzard

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.

ShadowPierce

->Excuse me but I seem to have a problem... I'd want this system to make one skill be acquired/learned by learning any of two or more skills... e.g. I want to learn "Stun Blow" by learning either level 3 "Sword Mastery" or level 3 "Axe Mastery"... If anyone still views this topic, please reply...

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

Blizzard

October 15, 2009, 11:56:34 am #70 Last Edit: October 15, 2009, 12:02:02 pm by Blizzard
The system only supports conjunctive skill prerequisites.

Translation: No OR requirements, only AND requirements. With the script alone it's not possible to make a skill be available through one set of skills OR another set of skills. Only 1 set is supported.
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.

Calintz

Why would anyone want OR anyway??
That kind of doesn't make sense to me ...

legacyblade

While I wouldn't personally want it, I can see where he's coming from. Let's say you have a really strong move called "power attack" (excuse my lack of originality). Now you want this skill to be available to anyone who has trained hard in their specified weapon's good move (we'll call it "critical hit"). But there are multiple weapons with their own critical skill, but you still want the same power attack for both axe men and sword men. It makes sense to me why he'd want it, but I do think it's kind of pointless. Just have "Sword Power Attack" and "Axe Power Attack" as separate skills, and the whole issue is cleared up.

Blizzard

You can always use a parallel process common event for that. Just check if you have a skill learned and if you do, add another skill if it's not already there.
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.

ShadowPierce

->Alright, I'll try it out... Thanks for replying...  :haha:



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

[Faint]

I love this script! I just have a couple questions.

1. How would you go about making passive skills that add boosts to stats based on what level the skills are and by passive I mean you don't have to use the skills.

2. How do you make a skill do different things based on its level. Example: a summoning skill that at level 1 summons one thing but at level 2 summons 2 things.
Scripts by me - State Requirement Skills
current project - Project: AURA

Blizzard

1. Tons supports a passive skill system, but it's not level dependent or something like that.

2. You can check the level with the script.
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.

[Faint]

how would you go about setting it up? with a common event checking the level?
Scripts by me - State Requirement Skills
current project - Project: AURA

Blizzard

Sure. Whatever suits you. A common event would be a good idea if you plan on checking it repeatedly or at several places.
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.

[Faint]

well would that be the best way to check it for using it in side view battle?
Scripts by me - State Requirement Skills
current project - Project: AURA