Total Enemy Control (Charm+)

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
Just in case you want to know why...

Alright then, so this morning I stumbled across a classified add for a script request that I thought I could replicate with pure eventing... I offered to but the author of the add seemed to want to either give up or already had something different lined up or something but I'd already pretty much worked out how to do it and I was bored so I still figured out how to do it... but I have no use for it in my game, though it's a cool idea so I figured I'd post it and let anyone else who might want to do it us it instead.
Have you ever wanted to put a monster tamer in your game? Someone who can turn enemies into allies temporarily and force them to kick their own allies' asses? If the answer is yes then this tutorial could help you perhaps.

Difficulty: I don't believe it to be difficult, tedious maybe... but not difficult. Feel free to let me know if I'm wrong and I'll change this I guess.

What you will need:

Decent Eventing skills such as an understanding of switches, variables and indexes... also probably organizational skills if you intend to utilize this as it can become unwieldy depending on how many monsters you want it to work with... I've only done 3 so far. Also you cannot have more than one monster with the same amount of maxhp, just as a side note.

1. create your enemies

Ok, so first things first, what you need to do is choose a couple of the enemies in your game that you want to make controllable and create a class for each of them. Set all of the stats of that class to be equal to the enemies stats in the database (i.e. if the enemy has 700 hp then the monster has 700 as well.) and link the classes to an actor space that you aren't using for an actual actor and name that actor whatever you named the enemy it corresponds with. Be sure to also give the actor version all of the traits and elements and skills that his enemy counterpart has as well. (after all this would be pointless if all it could do was attack.) and finally, create a blank enemy (give him no name and no graphic)

2. Create States

State 1: Restriction = cannot move, set it to however many turns you wish to control the enemy for, and set PDR, MDR and RCR to = 0%

3. Create a common event:

This requires 6 variables to complete, I'm going to give them names here so it isn't quite so confusing...feel free to rename them whatever you wish.

Monstershpmax

Monstershp

Monstersmp

Turn Count

Enemy Index(database)

Enemy Index(battle)

This is the monotonous and tedious part right here, start with a conditional branch with the condition that: Enemy 1 is [state1id] inflicted. Directly under that set Monstershpmax = Enemy1's mhp.

*Next you create another conditional branch that checks Monstershpmax, I would start with the first enemy and go down the list, so if monster number 1 has 700 base hp then the first conditional branch will be that Monstershpmax == 700. Under this conditional you will add the actor that corresponds to whatever enemy has that amount of hp by using the change party member command.

Set Monstershp == enemy 1's hp and Monstersmp == enemy 1's mp. Then decrease the hp and mp of the actor that corresponds to it by 9999 (make sure you do not check the box to allow knockout in battle with the hp) and then increase that actors hp and mp by the variables monstershp and Monstersmp respectively, that way the monster has its same hp and mp, the only stats that should flux unless you are using an enemy level script or something.

Now set Enemy 1 to Transform into the id of your dummy enemy and he will seem to disappear from the enemy list in battle (it isn't perfect as he can still be targeted technically, but with the state setting PDR, MDR and REC to 0% there shouldn't be much that anyone can do to it, and no name will show up so most of the time you won't really even notice him) and lastly set Enemy Index(database) to, surprisingly, the database number of the enemy that you have just taken control of, and Enemy Index(Battle) to 1. All you do now is turn a switch on(I'll call it Turncounter, for quick reference) and you are done setting up your first enemy... in your first iteration. start at the Else branch of the conditional that checks the enemies mhp and repeat from * with different mhp values until you cover every enemy that you want to be able to take control of. Once that is done you might want to use a last else branch to throw up text saying that you cannot control said monster or something to cover whenever the skill fails.

Alright, got all of your monsters? Good, you are 1/8 of the way done now (kidding kind of, the other 7/8 is easier) What I would do is just copy the whole thing starting at the first conditional (do not nest the first conditional branch, instead at this point just create a new instance after branch ends.) and paste it at the bottom of the event. All you should have to do at this point is go through this copied event and change every reference that goes to enemy 1 to enemy 2 instead (i.e. the conditional that checks said id, the variables that check for mhp, hp and mp and be sure to change EnemyIndex(battle) to 2 as well.) and repeat until you check all 8 indexes.

Here is an example of one iteration using 3 potential enemies:

Alright, so it's functional maybe, but as you've probably realized if you want to use this for most of the minor enemies in your game this can turn into a bloody mess really quickly, so a few suggestions that most people who work with event systems probably already know, but in case you don't they might help you out a bit. Firstly and most importantly comments are wonderful things, I would recommend commenting in-between each monster that you check for, just because comments are a different color and you can easily scroll through and register the changes that way as separate conditionals rather than one long line of code.

4. Create another common event

All that is really needed in this one is a conditional branch that checks if the switch [Turncounter] is on, if it is remove both states from every enemy index except for whatever Enemy Index(battle) is equal to(this stops you from freezing multiple enemies at once) and flash up some text saying that you can only have 1 enemy enslaved at once. On the else branch call the first common event that checks indexes and enemies and everything. (note, another way that you could lower single event length is by turning on switches based on where you are in the game, and using this event to check those switches and route to a common event that only covers the enemies you will encounter in the currently selected region, something to consider... because I at least HATE mile+ high single events from an organizational perspective.)

5. Troop Events!

Almost finished now, start by setting the events main conditional to switch: [Turncounter] is on, and set the span to 'turn' and have a conditional branch check that the variable [Turn Count] == X(X being however many turns you are controlling your monster for, should correspond to the number of turns that the primary state effects the monster you are controlling to avoid monster duplicating stupidity) Under this conditional branch set the variable [Turn Count] = 0 and turn off the Turncounter switch. Then remove every enemy-actor from the party (you shouldn't have multiples running because it's to damn complicated so just remove them all without checks unless you are going well beyond this tutorial)

Alright, the next part of this troop event can be short and simple or long and tedious depending on what you want to do with it. Since you are in the troop already you actually know what enemies are there and what index they are (but not which one the player will choose to control) so checking against every enemy in your game and any index you are not using for that troop is not strictly necessary, so it depends on you. If you want to you can just account for checking the index that still has the dummy state and transform it back to the enemy that you know it is, the downside to this being that each troop event will be unique so you cannot just copy-paste it into all the other events when you are finished, still it's probably the way to go, just because skyhigh event iterations leave a lot of room for error and when you get one you have a lot more to scroll through to find it then if you keep it simple. Otherwise you will have to check the Enemy Index (Database) and leave a condition for every monster in the game to switch the index back to... not recommended.

Ok, something I completely forgot to do at first... when you are working on the troop event, right after you 'transform' your captured enemy back so that he/she appears be sure that you perform the same hp/mp trick that you did on step 3 only in reverse so that any punishment the enemies gave their friend while he was confused and thought that he was your friend is recorded and the enemy doesn't get a health boost just for snapping out of it (unless you want him to, for balancing reasons and such.

Just a recap of that step, you will store the monsters (the actor version this time) hp and mp in the variables monstershp and monstersmp respectively, reduce the enemy that you just transformed's hp and mp by 9999 (but without checking the allow knockout box) and then restore it's hp and mp by those variables and reduce it by 1 (optional really as this causes them to be -1 if they have full hp or mp so your choice whether you want that or just always want them to have +1 which shouldn't make a difference really either way.)

And another thing I forgot to include (surprised this got approved as is now) although most people would probably figure this one out on their own. Be sure in the else branch at the end of your troop event that you set it to [Turncounter] += 1 so that when Turncounter != the correct number to activate the event that it does actually count the turn and you aren't stuck with an invisible foe when the state wears off.

6. Create the skill

So your skill should target one enemy, add the state to selected enemy and call the second common event... which if valid calls the first one, which handles the rest along with your troop event. Congrats, you've got someone who can mind control your enemies. If you have any questions/comments/even hatespeech feel free, I'm sick right now and out of work, thus bored which is why I did this in the first place but I might not have described everything as effectively as possible because of it.

Here is my example project that I worked it out on, feel free to look at it but bare in mind it is a bare-bones concept project that stopped as soon as I verified the concept works, thus it is missing some needed checks and such so if something in it has a 'bug' with it and you haven't yet actually read the rest of this tutorial then try that first.

Note: I was joking around a bit when I was working on this thing because of what the concept made me think of, if you are religious (christian mainly) then you might just want to go to the first troop and select battle test instead of actually reading the three paragraphs intro or so before that battle... It isn't really 'offensive' or anything, it's just a super-short exposition that deals with a couple of the doubts that made me eventually turn agnostic and I wasn't really thinking about releasing it at the time, just a heads up, if you aren't religious but have studied religion then you might find it funny.http://www.mediafire.com/download/qw1d1ifoqw1ao9q/Omnipotence.rar
 
Last edited by a moderator:

Art Gallery

Bye Rose Wala Leo
Member
Joined
Aug 28, 2013
Messages
153
Reaction score
11
First Language
s
Primarily Uses
Thanks Much For This! ;D
 

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
Hey, it got approved! Now time to update it, I realized after doing it that I left off a kind of important detail in that when the monster leaves your party and goes back to trying to kill you that it's hp and mp are reset to whatever they were before you took control of it (or rather they aren't changed the way the actor version is before it joins your party)

edit: ...and done.
 
Last edited by a moderator:

Silent Darkness

Robomage
Veteran
Joined
Nov 28, 2013
Messages
2,283
Reaction score
323
First Language
English
Er, wouldn't a state that makes the enemy only attack it's own allies work just as well? Or is there something i'm missing?
 

Misaki

Pikalyze
Veteran
Joined
Apr 21, 2013
Messages
156
Reaction score
26
First Language
English
Primarily Uses
RMMV
Very interesting :)
 

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
Er, wouldn't a state that makes the enemy only attack it's own allies work just as well? Or is there something i'm missing?
The difference is that with my method you actually get to control the enemy and utilize his/her skillset for the duration of the state. The default method of "attack allies" sort of works like a confusion state and they will just keep using normal attack on a random ally while this way you choose exactly what he/she/it does.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,574
Latest member
nikisknight
Top