I have an issue with my menu : Cannot read property "param" of undefined

Stry

Warper
Member
Joined
Feb 26, 2017
Messages
2
Reaction score
0
First Language
French
Primarily Uses
RMMV
Hello, since a few days, I tried to create a plugin by myself but I had an issue that I didn't know how to resolve..







I understand that the problem comes from the line with TextManager.param(paramId) and _actor.param(paramId) but i don't know how to resolve it.

If anyone has a solution, I'm interested ^^'.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
from the line with TextManager.param(paramId) and _actor.param(paramId)
The error is only coming from one line, not both. You can tell from the error message exactly which line number (we can't see your line numbers in the code screenshot).


I know it is the this._actor line based on the error message. "cannot read property param of undefined" is like trying to do this:
Code:
undefined.param
Obviously, that will cause an error because "undefined" doesn't have any properties.

So you can deduce that:
Code:
this._actor === undefined
  1. Do you expect "this._actor" to have a value?
    • If so, where does this value come from?
  2. The drawAttack function you wrote takes 2 parameters but you are passing 3. I don't know which one is right
Probably you need to receive actor as a parameter in drawAttack and use that instead of this._actor but that's just a guess.
 

Stry

Warper
Member
Joined
Feb 26, 2017
Messages
2
Reaction score
0
First Language
French
Primarily Uses
RMMV
Hello !

I resolve the problem this evening, like you said I added the missing parameter which was actor, and I initialized "this._actor" with actor.



Thanks to you I understand the problem more easily, thank you for your answer ^^
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,570
Latest member
fgfhdfg
Top