- 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)
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:

