Lordkazar

Villager
Member
Joined
Dec 23, 2013
Messages
24
Reaction score
1
First Language
English
Primarily Uses
I could use help on another script if any one has time please.
I think I'm getting better, but then I run into another one that stumps me.


If : Script: $gameActors.actor(5).Skill($gameVariables.value(11), true)

$gameActors.actor(5).Skill($gameVariables.value(11), true)

So I want it to check if actor #5 has Skill #x where x is Variable#11.



Thanks
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,180
Reaction score
15,543
First Language
English
Primarily Uses
RMMV
And what's happening when you try? Are you getting an error message? We need to know what it says.

$gameActors.actor(5).isLearnedSkill($gameVariables.value(11))returns true if the actor has the skill whose id is in variable 11, and false if they don't.
You don't need to pass true into it.


Here's a good way to start learning - if it's something you can do via event command, look at the rpg_objects.js file at the Game_Interpreter class. With your cursor on that line, search for the name that appears on the event command button. In this case, it's in Conditional Branch, so I searched for Conditional Branch. The 'cases' listed in that function all correspond to the different options you can choose for Conditional Branch. Case 4 is Actor, and underneath that you'll find Skill, which returns actor.isLearnedSkill(n)
 

Lordkazar

Villager
Member
Joined
Dec 23, 2013
Messages
24
Reaction score
1
First Language
English
Primarily Uses
Here is a picture of the way i had it, and the error.

Thanks for the advice Shaz. I will try actor.isLearnedSkill(n) and look into that file for reference.
[IMG]http://i1086.photobucket.com/albums/j455/AnimeImports/actor-skill_zpszizesskt.jpg[/IMG]
 
 

Lordkazar

Villager
Member
Joined
Dec 23, 2013
Messages
24
Reaction score
1
First Language
English
Primarily Uses
the formula sees skills added by level up, but it does not seem to reconize a skill added from an equipped item as a learned skill. is that a bug or is there a differnt way or formula for that?
 

And what's happening when you try? Are you getting an error message? We need to know what it says.
 

Code:
$gameActors.actor(5).isLearnedSkill($gameVariables.value(11))
returns true if the actor has the skill whose id is in variable 11, and false if they don't.


You don't need to pass true into it.

Here's a good way to start learning - if it's something you can do via event command, look at the rpg_objects.js file at the Game_Interpreter class. With your cursor on that line, search for the name that appears on the event command button. In this case, it's in Conditional Branch, so I searched for Conditional Branch. The 'cases' listed in that function all correspond to the different options you can choose for Conditional Branch. Case 4 is Actor, and underneath that you'll find Skill, which returns actor.isLearnedSkill(n)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,343
Reaction score
8,767
First Language
German
Primarily Uses
RMMV
the formula sees skills added by level up, but it does not seem to reconize a skill added from an equipped item as a learned skill. is that a bug or is there a differnt way or formula for that?
That is because skills added by equipping items aren't learned, they vanish as soon as the item is unequipped. It's a different way to store the skills on the actor, and it's intentional as different.
Can you tell us what you want the code to use for in your game? there are usually several ways to do something with different advantages and disadvantages, but without knowing your intention we can't give better help.
 

Lordkazar

Villager
Member
Joined
Dec 23, 2013
Messages
24
Reaction score
1
First Language
English
Primarily Uses
I am trying to do a open world game and i want to have objects in the game that can only be removed if the user has a certain skill no matter how they attained that skill, and also have various interactions changed by those skills.
 

YuuHkiSay

Villager
Member
Joined
Jan 25, 2016
Messages
6
Reaction score
0
First Language
English
Primarily Uses
This may be kinda late, but I figured i'd put this in case others saw this.


You can use the Conditional Branch to check if an Actor has equipped a piece of equipment and add a skill to that actor's learnedSkills list. You just have to make a Common Event with the Trigger set to Parallel and have a Switch set to ON for it to do anything.


Then in whatever Event you're wanting to check the Actors' learnedSkills, just have a Conditional Branch check if the skill is learned.


That should get what you're looking for.

Blah.png
 

Latest Threads

Latest Posts

Latest Profile Posts

Q:"Why don't you get a job?"
A: Posting statuses IS my job. It just so happens to not pay and happen periodically over the course of three months.
My new 49" monitor has been dispatched from the warehouse. Will it arrive tomorrow? The day after? I love that we can track packages now, even if it does only tell me when it's left that end and when it's arrived at the local centre. As long as it doesn't end up in Melbourne again, which has happened before ...
My friend's doing a surprise stream of my game Origin Hunt on Twitch here ! Feel free to stop by :yhappy:
Me, designing it a long time ago: Having an optional boss fight as a random chance to trigger when you fish in a certain spot with a certain type of bait is fun! Cool idea!
Me, trying to playtest everything again: oh god just let me see the boss, my bag is so full of fish!

Forum statistics

Threads
117,232
Messages
1,105,712
Members
153,389
Latest member
Tsurm
Top