... Dont look at me like that.
I probably missed out something important, but how do I access Actor Variables?
gameActors.actor(1).level
=> Wont Work
this._level
=> Wont Work
actor.level
=> Wont Work
I probably missed to link the variables to something, but I have no idea to what I should link to?
What I am attempting is checking the player level and change it depening on the level, there is a reason why I am not moving the levelcap up or down or give an anti-exp state.
Could someone tell me obvious thing thats so obvious that even google laughs off its ass and wont tell me what it is?
Using "$gameActors.actor(1).level" yields the following error:
Cannot read property 'actor' of nullThe script is an simple function with just "console.log($gameActors.actor(1).level);".
There are four actors so the property of actor shoulnt be null right?
when did you place that command?
Actors are only initialised on new game, before that they don't exist.
That's actually not true. DataManager.setupNewGame() is called in Scene_Boot and creates all game objects, including $gameActors. Game_Actors itself creates a new actor at the given id, if it doesn't already exist.
So, try to wait until the title screen appears and then execute your snippet via console (F8).
-- Edit:
Alright it works now, but there is one more thing: How can I keep updating the function?
e.G running it in a routine, I would say to loop it with an while option... But I believe it will just result in it crashing?
The loop should be connected to the check of the level of the player and an second variable, or should I just add it to the LevelUp option?
$gameActors is what you want to look at
^ Thanks, took me quite a bit to notice that the variables arent found in the F1 documentation but inside the scripts... I feel kinda stupid? XD
Interesting, I know pretty much nothing about script calls myself, but how would you go about using this changelevel one ingame?
I tried putting it as a "script" in an event on action trigger, but I got an error, I get an error when I use it inside the console too... I'm kinda lost!
The simple consolelog worked and is useful so now I can check things out! Thanks!! =)
Not sure if I understood what you meant...
So you wrote an JavaScript.
You created an Event.
The event used the "$gameActors.changeLevel(x, false);"?
The only thing that I noticed as wrong would be that you need to chose the Actor to.
$gameActors.actor(y).changeLevel(x, false);