Putting Skill name in a variable and getting an error?

Status
Not open for further replies.

Ganucci

Villager
Member
Joined
Apr 26, 2020
Messages
29
Reaction score
3
First Language
English
Primarily Uses
RMMV
I'm trying to store the name of the first Skill an Actor has, in a variable. Variable 68 is the Actor ID.

I've put in the following:

◆If:Script:$dataSkills[$gameActors.actor($gameVariables.value(68))._skills[0]].name === null
◆Control Variables:#0090 Party Member Skill = 50

:Else
◆Script:let skillname = $dataSkills[$gameActors.actor($gameVariables.value(68))._skills[0]].name;
: :$gameVariables.setValue(90, skillname);

:End

(By the way, the skill name of Skill 50 is "None".)

I thought this would allow me to get past an Actor who has no Skill, but I get the error "Cannot read property 'name' of undefined". However, it DOES work when the Actor has a Skill. Help please!

EDIT:I figured it out. I made the conditional branch check how many skills an actor had with this $gameActors.actor(1).skills().length. If 0 then (stuff) if not 0 then (different stuff)
 
Last edited:

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
3,729
Reaction score
4,685
First Language
English
Primarily Uses
RMMZ

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,467
Members
137,821
Latest member
Capterson
Top