RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
VXA] Check Monster # in Troop?

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 36
RMRK Junior
This has been driving me crazy for a little while. I'm trying to make a system where you can talk to the enemies during battle and convince them to join you. i want to have "affection" of enemies increase if you give them what they want, and I would use variables for the affection. What I'm having trouble with is how to keep track of which enemy has how much affection.

Is there a way I can check a monsters number within the troop? For example, if I want to add 5 affection to monster 1, how would I go about saying "if target monster is #1 in the troop, then variable a. =+5". I'm setting this up within a common event as well.

***
Rep:
Level 72
The cloaked schemer
Most Promising Project 2014
Code: [Select]
$game_troop.members[#].enemy_id
# is the enemies index.

**
Rep: +0/-0Level 36
RMRK Junior
Thanks for such a prompt reply!

I have it set up as $game_variables[4] = $game_troop.members[1].enemy_id but it's coming up with the error undefined method 'enemy_id' for nil:nilclass

Am I doing something stupid?

Edit: The explanation may have been poorly worded. I'm looking to make it so if I use this skill on "enemy 1", then the variable associated with enemy 1 increases. Is there a way I can make it so "if skill a. hits enemy 1, variable x is set to 1. But if skill a. hits enemy 2, variable x is set to 2."?
« Last Edit: August 24, 2014, 11:41:29 PM by mr.watson »

***
Rep:
Level 72
The cloaked schemer
Most Promising Project 2014
Do you have 2 or more enemies? $game_troop.members[1].enemy_id is the second enemy. $game_troop.members[0].enemy_id is the first enemy.
Also, then I think your request is a bit more complicated. I'm making a script for you right now
Edit: I actually might not be able to do this o.o
I have no idea how to get the last skill used, or the skill ID in general lol
« Last Edit: August 25, 2014, 01:01:04 AM by Chaos_Zexion »

**
Rep: +0/-0Level 36
RMRK Junior
You're right, that was the reason for the error :/ Still can't make it accomplish exactly what I'm looking for unfortunately, so I would really appreciate a script. Thanks for taking the time =)

***
Rep:
Level 39
RMRK Junior
What features do you want in the script? If it's something short I'll write it up for you when I get the time. If it's longer but interesting to me, I'll still probably write it, it just might take a bit longer since I start school tomorrow.
My Website:

:tinysmile:

**
Rep: +0/-0Level 36
RMRK Junior
The way I want the enemy trust system to work is you use a talk skill on an enemy, and he tells you what he wants. If you give him what he wants, his trust of you will increase, which I'm going to use a variable for.

So the script would be to take the index of the enemy you use the skill on into a variable. For example, if I use the skill on the first enemy in the troop, then when his trust goes up it will increase variable a. If I use the skill on the second enemy in the troop however, then variable b. will increase. I'll be using 4 variables, which is the max number of enemies I'm going to have in a single battle.

***
Rep:
Level 39
RMRK Junior
I'll look into writing it, but I have a large list of stuff to do, so I hope it's not urgent.
My Website:

:tinysmile:

**
Rep: +0/-0Level 36
RMRK Junior
Nope, whenever you get a chance is great, thanks =)

***
Rep:
Level 39
RMRK Junior
Gonna give it a shot right now. Most likely won't finish it for a bit though. Just gonna get started and gauge how much work this will take.
My Website:

:tinysmile: