sabatadarkness

Villager
Member
Joined
Nov 13, 2014
Messages
10
Reaction score
1
First Language
English
Primarily Uses
Ultimately, I'll want to make that actor or enemy be affected by a state if that variable is equal to 100, but this can be done without extra scripting.  Unfortunately, TP is not, by default, an option you can choose when making a variable equal to an actor's parameter.  I'd like to get a simple script to attach to a Control Variables event that calls for actor X's current TP and another that calls for enemy X's current TP.  If it affects anything, I have changed TP's name to SP in this case.
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,637
Reaction score
1,463
First Language
French
Primarily Uses
RMMV
Ultimately, I'll want to make that actor or enemy be affected by a state if that variable is equal to 100, but this can be done without extra scripting.  Unfortunately, TP is not, by default, an option you can choose when making a variable equal to an actor's parameter.  I'd like to get a simple script to attach to a Control Variables event that calls for actor X's current TP and another that calls for enemy X's current TP.  If it affects anything, I have changed TP's name to SP in this case.

tape in console


$gameActors.actor(1)


to found tp state
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,201
Reaction score
858
First Language
Hungarian
Primarily Uses
RMVXA
For actors:


$game_actors[ID].tp


The ID is the database ID of the actors.


For enemies (only in battle):


$game_troop.members[index].tp


The index is the troop index of the enemy in the battle.


If you use an ABS, you must get the enemy assigned to the event and call the tp method on that.


You can use these in Control Variables event commands.
 

sabatadarkness

Villager
Member
Joined
Nov 13, 2014
Messages
10
Reaction score
1
First Language
English
Primarily Uses
Sixth, I've tried your method, and I get the following error after inputting commands.

Script 'Game_Interpreter' line 543: NoMethodError occurred.


unidentified method 'tp' for nil:NilClass



This is my first time scripting in RPG Maker VX Ace, so I'm not sure what I may have done wrong, but here's a screenshot of the event.


State 26 Check.png
 
Last edited by a moderator:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,201
Reaction score
858
First Language
Hungarian
Primarily Uses
RMVXA
You did not use the brackets I used, these ones: [ ] .


The ID of the actors and index of the enemies must be inside those brackets.
 

sabatadarkness

Villager
Member
Joined
Nov 13, 2014
Messages
10
Reaction score
1
First Language
English
Primarily Uses
Yeah, I tried it that way, too.  I did that first, actually.  Got the same error.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,201
Reaction score
858
First Language
Hungarian
Primarily Uses
RMVXA
If that event is run on the map, you will get a NoMethodError.


There are no enemies on the map at all, so trying to get a member from $game_troop will yield a nil, and nil got no tp method/variable defined, and the error triggers.


You can't use $game_troop at all on the map, only in battles.
 

sabatadarkness

Villager
Member
Joined
Nov 13, 2014
Messages
10
Reaction score
1
First Language
English
Primarily Uses
Could the fact I did the battle in a Troop test be the cause?
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,201
Reaction score
858
First Language
Hungarian
Primarily Uses
RMVXA
Ahh, I see, you counted the troop members from 1 instead of 0.


If we talk about indexes (mostly anywhere in scripting), they start from 0 instead of 1.


So change the troop member indexes to 0, 1 and 2, and it should work, assuming your troop got at least 3 members in it.
 

sabatadarkness

Villager
Member
Joined
Nov 13, 2014
Messages
10
Reaction score
1
First Language
English
Primarily Uses
And that did it!  Thanks so much for sticking with me through this whole thing.
 

Latest Threads

Latest Posts

Latest Profile Posts

Current status screens for Shadows of the Earth: The Vrila'an Legend. Need to do something about the color scheme lol
Captura de pantalla (259).pngCaptura de pantalla (260).png
My first serious victim in game hacking - Pawnbarian.
Diana Path 2.png
I love these two design wise lol... The high school principal and the captain of the women's wrestling team. they team up as bosses to save the school's accreditation.
Kanori24 wrote on TheRamenGirl's profile.
I love your profile pic. Definitely one of my favorite scenes from OPM :D

Forum statistics

Threads
122,074
Messages
1,146,305
Members
160,359
Latest member
TheRagingKing
Top