How to implement a skill that displays enemy data?

Manofdusk

Veteran
Veteran
Joined
Apr 26, 2014
Messages
211
Reaction score
39
First Language
English
Primarily Uses
 One of my characters has a skill that allows him to see enemy data (current hp, current mp, attack, def, weapon damage (formerly magic defence) element rates, and possibly special notes about a monster (like hints about how it behaves (such as "Sahuagin summons Jellyfish when afflicted by the 'Wet' Status". as an example))

 unfortunately, I don't even know how to begin making something like this. If the special notes are too much, it's not that important, but it would be nice to add an extra layer of depth to the game.

 I'm guessing I would need a script of some kind to call the desired attributes of the target (not sure what the code is to call attributes) and then show them in text boxes (again, not sure how to place code in text boxes)

 If I were to make a special note for each monster, my guess would be that I would need to call the ID of the enemy and create a separate text box for each creature somewhere (again not sure).
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Unless it's something really complicated, you could probably do it by giving your skill a common event, then using Script calls and Show Text within the common event.


The "special notes" would depend on how you intend to set them up.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,669
First Language
German
Primarily Uses
RMMV
theoretically, it could be done with events (you can get any enemy data into a variable by the control variable command:game data, and then display it), but doing it by events would require a lot of complex branching.


I suggest looking through the master script list - if I remember correctly there are one or two scripts to display enemy data, and those scripts can be turned on or off with a switch iirc.
 

Manofdusk

Veteran
Veteran
Joined
Apr 26, 2014
Messages
211
Reaction score
39
First Language
English
Primarily Uses
I looked through the battler, enemy, troop, and all the other combat data for enemies I could find but didn't see anything like that (or, if I did, I couldn't recognize it).

 I've decided to try and set all the stats to variables and then display them in text boxes.

the question now is how do I set element rates to a variable?

 also, once I get all of the variables set, how do I put them in a text box?

 Finally, I think the best way to make notes for creatures is to create an enemy variable and set the enemy's numerical ID (not sure what the code is to call that either) and then create a nested if statement that shows a text box based on what the enemy's numerical ID is.

 for example:

 The first enemy I've created is the Sahuagin. When he gets wet, he can summon Jellyfish (I haven't implemented this ability yet). So when my character Scans him, I would set his numerical ID (1) to the Variable Enemy ID and create an if statement

Conditional Branch Variable [0059] == 1

@>Text:-,-, Normal Bottom

:        : The Sahuagin can summon jellyfish when suffering

:        : from the Wet condition.

Else

Branch End

 and, in the Else branch, I can just keep adding monster numerical IDs as the variables and adding more text.

 Does all that sound about right?

Scan Script.png
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,669
First Language
German
Primarily Uses
RMMV
Does all that sound about right?
No, it does not.
Common events are executed after the action, which means that the placeholders a and b from the damage formula no longer exist.


That is why I told you to get the data by control variable : game data, NOT by control variable : script like you did in your screenshot.


If you choose control variable : game data, the preselected game data is Map ID - but if you click on the dots to the right, you can change that to almost every other data available in the game.


The scripts I was thinking of are:


http://yanflychannel.wordpress.com/rmvxa/battle-scripts/ace-battle-engine/enemy-hp-bars/


http://yanflychannel.wordpress.com/rmvxa/battle-scripts/ace-battle-engine/enemy-target-info/


I do not know if they work without the battle engine ace however...


I suggest you take a week or so off from your game project to explore the editor - there are a lot more advanced options than "only" the game data from control variables, and things will speed up for you if you take the time to look at the sample events, mapping tutorials and other things.


The link in my signature was written to guide new users to the most important tutorials and learning games.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA

Manofdusk

Veteran
Veteran
Joined
Apr 26, 2014
Messages
211
Reaction score
39
First Language
English
Primarily Uses
No, it does not.

Common events are executed after the action, which means that the placeholders a and b from the damage formula no longer exist.

That is why I told you to get the data by control variable : game data, NOT by control variable : script like you did in your screenshot.

If you choose control variable : game data, the preselected game data is Map ID - but if you click on the dots to the right, you can change that to almost every other data available in the game.
 Well, the control variable: game data requires that I select a specific enemy slot (rather than the target of the skill). Also, it doesn't cover elemental rates.

 I'm not really able to use the links as I do plan on making this a commercial game at this point (I'm using other games to practice concepts but this one is likely the most straitforward one I have planned and likely to require the least amount of programing)

 However, I will go back and look at the tutorials and samples a bit more in depth.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,669
First Language
German
Primarily Uses
RMMV
you need conditional branches to identify which slot had been targeted - but that is the only way to do it with eventing alone.


Everything else needs a script one way or another...


And there are scripts that are available commercially even without paying, you'll have to check the terms-of-service for each script or scripter.


And even if you have to pay for a license to use the script commercially, depending on what you do that is often cheaper than spending dozens of hours writing workarounds yourself.
 

Manofdusk

Veteran
Veteran
Joined
Apr 26, 2014
Messages
211
Reaction score
39
First Language
English
Primarily Uses
well, the conditional branches worked. I made the skill ad the "Scanned" state and then made the conditional branches detect for the scanned state, add the data to a variable, place the variable into text, and then remove the state.

 However, that only works for attributes. I need elemental rates too. I have 15 elements (which include the 3 physical ones: piercing, slashing, and blunt) and they're used (instead of Def) to reduce damage. I need to figure out how to set the element rates to a variable and show them too. I just don't know how to reference them.

 I also need to get the creature's numerical ID. As far as I can see, Game Data doesn't give me the option to reference that from there.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Yanfly's Enemy Info script allows you to set up a skill which includes scanning for elements, as well as for parameters, states, resistances and so on.  It seems to do everything that you want.  

The old links to Yanfly scripts aren't working.  Here is the new one.  https://github.com/Archeia/YEARepo/blob/master/Battle/Enemy_Target_Info.rb

As you can see from the script header, setting up a skill to do all this is very straightforward (there are other options, like it's default from the beginning etc. but you can ignore those).  I think it would save you a lot of time and effort.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top