Is there a script formula for last targeted enemy = x?

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
You see, I want to make a item call a common event, that sets a variable for the monster's ID you used the item on. I'm designing a monster capture/training system, and I need to be able to identify any monster that may be in the troop, so I can capture x monster.
 

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
The easiest way to do this would be to assign a 'dummy state' to the skill. (which is to say, a state with no icon that lasts for 1 turn, used only in determining which foe the common event should play on.) then you can select whatever you want based on which enemy has said state at the time.
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
The easiest way to do this would be to assign a 'dummy state' to the skill. (which is to say, a state with no icon that lasts for 1 turn, used only in determining which foe the common event should play on.) then you can select whatever you want based on which enemy has said state at the time.
Ok yea, that would work, and be a hell of a lot less confusing, thanks(now I just need to figure out a way to coralate a enemy's ID, to an actor's ID), but I'm pretty sure I still need to figure a way to set X enemy's ID into a variable to run a database search of sorts..
 
Last edited by a moderator:

Mouser

Veteran
Veteran
Joined
Aug 19, 2012
Messages
1,245
Reaction score
264
First Language
English
Primarily Uses
Why not just make a variable and store the target (troop array position) of the character's attack?

When they use the skill, if it's successful, pull up that variable and get the monster ID of that troop member.

Attach that number to the item along with a flag for "true" when something's been 'caught'.
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
How do you do that,..

Hm oh wait I have an idea, but that's gonna be a nightmare to event, and I'm not even sure it will work like I want.

I'm gonna have to use a bunch of condition branches, a dummy state(tied to the enemy slot as the condition for each condition branch), and a set variable inside each condition branch(basically I need a condition branch for each enemy slot that might be in a troop's array to pull this off), but in theory it should work.
 
Last edited by a moderator:

Mouser

Veteran
Veteran
Joined
Aug 19, 2012
Messages
1,245
Reaction score
264
First Language
English
Primarily Uses
Not sure what you're trying, but a loop is generally cleaner and neater than a whole string of conditionals,

especially since you're running down a list.
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
Not sure what you're trying, but a loop is generally cleaner and neater than a whole string of conditionals,

especially since you're running down a list.
Well there is no set X troop array variable, so I need to check each one individually to set a variable for the one who has the dummy state.

If you didn't want me to do it this way, then what were you hinting at, because there's no normal means of setting a variable for a undefined position in a troop's array.

First I need to define a way to check the position of the enemy in the troop array, and there's no normal means to do a check on all of them at once, so I need to do it with condition branches.
 
Last edited by a moderator:

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
If this is going to be for most monsters in the game instead of having a common event that runs through every damn troop event and then determines which enemy is in said troop I'd just have the common event turn on a switch, and then have individual troop events (1 per troop) that activates on a moment by moment basis when said switch is on and checks for said dummy state and does whatever you need. It may seem like a lot at first but since you are having a lot of enemies effected by this it'll be better in the long run because.

1. you already know what enemy = what id per troop, so there is no variable BS to deal with and instead you just check enemy id 1 has state[DummyStateId] applied? If true then do what you want based on who enemy id 1 is(since you place them in order in the troop you already have access to said information, simple.)

2. Each event is now smaller and easier to manage, no huge list of conditionals going through every enemy cycled 8+ times each for troop positions.

3. If you need to make changes to a particular foe in regards to said system, you know exactly where to find it, in the troops that said monster exists in.

It's just a better idea all around since it deals with probably a lot of different monsters, unwieldy and long single events are never a good solution (in my opinion)
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
If this is going to be for most monsters in the game instead of having a common event that runs through every damn troop event and then determines which enemy is in said troop I'd just have the common event turn on a switch, and then have individual troop events (1 per troop) that activates on a moment by moment basis when said switch is on and checks for said dummy state and does whatever you need. It may seem like a lot at first but since you are having a lot of enemies effected by this it'll be better in the long run because.

1. you already know what enemy = what id per troop, so there is no variable BS to deal with.

2. Each event is now smaller and easier to manage, no huge list of conditionals going through every enemy cycled 8+ times each for troop positions.

3. If you need to make changes to a particular foe in regards to said system, you know exactly where to find it, in the troops that said monster exists in.

It's just a better idea all around since it deals with probably a lot of different monsters, unwieldy and long single events are never a good solution (in my opinion)
Omg talk about duh(It's so simple, It's not funny, how the hell did I not think of that? Sigh probally because I've been working with only difficult complex events lately), I can just assign a switch to each troop formation, which fixes all the problems, since such would allow me to know what monster is in what troop's slot, due to x switch being on.

Thanks a lot lol.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Just use the damage formula to set the target ( b ) to a global variable, then use that for when you need it


if you only need the id, then just do something like $game_variables[whatever] = b.id ; formula?


then make it run the common event for capturing monsters using the CE feature of skills
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
Just use the damage formula to set the target ( b ) to a global variable, then use that for when you need it

if you only need the id, then just do something like $game_variables[whatever] = b.id ; formula?

then make it run the common event for capturing monsters using the CE feature of skills
Ok cool, thanks.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
of course assuming you use damage, else if you're using Hime's script for applying extra things or my Skill Apply extension, then you can do that variable assignment there. then use the variable for the ID on the common event for the capture
 

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,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top