Enemy's target

OmnisScio

Veteran
Veteran
Joined
Oct 26, 2015
Messages
43
Reaction score
2
First Language
English
I know how to get an actors target.


BattleManager._subject.inputtingAction().makeTargets()[0]


Though there is probably a better way.


How do I get the enemy's target?


The enemy doesn't have the inputtingAction function, and I cannot find an equivalent function. 


This code is being written in a separate .js file (a plugin), so as far as I know I don't have access to user and target variables (I wish I did).


I'm making a function that is called when a skill activates. 
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
can you describe a bit more what exactly you want?


The enemy target is selected randomly based on the actor target rates - but when the skill is processed, it is stored in the object b of the damage formula.


Depending on when exactly you want something to happen and what that something is, there are several ways to handle this.
 

OmnisScio

Veteran
Veteran
Joined
Oct 26, 2015
Messages
43
Reaction score
2
First Language
English
The function is called in the notetag section of the skill. I'm using the function to implement additional affects that the skill will have on it's target. Seeing as I do not know who the enemy will target, I need to be able to dynamically interact with the target, including obtaining it's Id to store in a variable.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
and what plugin are you using to process the notetag data? because by itself the notebox has absolutely no function, it is only a way to give info to plugins.


And why are you using the notebox for this? such a thing is usually done in the damage formula, and in the damage formula you have the info on who the target is - object b.


That's how you access the target data (for example b.def) throughout the damage formula, and it can be used to process any javascript command, including the commands to add states or if-else-sequences to give different results depending on target conditions.


For example in the damage formula, you should be able to use something like $gamevariable(xy).setvalue(b.id) (untested syntax, I'm not at my regular computer at the moment)
 

OmnisScio

Veteran
Veteran
Joined
Oct 26, 2015
Messages
43
Reaction score
2
First Language
English
I'm using a .js file that I made myself. I include it in the plugin section, and then I can use the functions I write in that file through the notetag section in the editor.


I did not know you could put that sort of code in the damage formula, I will have to try it.


Regardless, I would still like to know if there is a way to access the enemy's target for future reference.


Thanks for the replies.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!

Forum statistics

Threads
106,036
Messages
1,018,461
Members
137,821
Latest member
Capterson
Top