Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Getting NAN for my custom stats?

A topic by AllusionAtelier created 83 days ago Views: 60 Replies: 1
Viewing posts 1 to 2

Hi, Eli! Thank you very much for this plugin, it's exactly what I needed! :D I'm so happy!

But, I think I found a bug; I'm using VisuStella's core engine and elements status plugins, along with a small JS snippet to reflect the custom parameter's values in the status menu! The snippet is;

return this.cparam(1); (1 is the parameter ID number.) 

However,  when I use that little code, it messes up whatever parameter is last in the custom list? The value shows up as NAN.

I tested this in a blank project as well, and got the same result. Would you have any clue how to fix this?  

Developer

Hi there!

"this" is a javascript special keyword that can mean different things depending on the context. As so, it's best for you to take a look at visustella documentation to understand what context they are providing you on that formula.

Because the "this" keyword may not be referecing the actor, but something else.

If you are sure that "this" is referecing the actor, then you need to make sure that you created the custom parameter on the Plugin Parameter of my plugin and also added a value to it.

Remember:

  • 0 = The first custom parameter
  • 1 = the second custom parameter

and so on.