Disallowing an enemy battler to target themselves in battle?

EternalShadow

Veteran
Veteran
Joined
Sep 16, 2012
Messages
5,781
Reaction score
1,041
First Language
English
Primarily Uses
There's a sequence where one of the people in the battle screen appears as an enemy, but they are actually an ally, and will only target their own 'allies' (your enemies) with attacks. As such, you have to be careful not to use an AOE attack, lest you target them too. However, it just so happens that they can target themselves too!

Would it be possible for a script snippet that disallows for people (enemies) of a certain name to target themselves with attacks - and if no valid target is presented, to simply prevent the attack? (Battle ends once enemies are gone, but the battle still has to finish its course and it may be that one of the attacks has to choose a new target)

Thanks!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
it depends on what exactly you want to do - but the option "ally but not itself" is not a regular scope and I know of only two target manager scripts that have that option - one is a short, not supported hack by Tsukihime (I think it was deleted sometime ago from her blog) and the other one is Enelvon's:

http://forums.rpgmakerweb.com/index.php?/topic/30722-target-manager-v10-initial-release/

Enelvon's target manager can do a lot more, but it will also require specific installation logic...
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
184
First Language
Meowish
Primarily Uses
In most cases, doing a condition check simply use "self" or "self.xxx" should works.

eg. self.transparent = true/false will show/hide whichever game object in that class currently running this command method, 

which can be event/enemy/follower or even player.

Not sure what you are trying to achieve, a 3-party war situation maybe?

Due to the way how the battle system is setup, the current available "target" is either "friend" or "opponent" for Game_Actors/Game_Enemy.

So I don't think "self" check works here because it will still link to "MY" foe/friend.

To create a brand new "army"(3rd target) into the battle that has their own friend/foe setting will mean you need to make a new unit.

(Both Game_Party and Game_Troop are considered a set of units by their own in the battle scene both are super classed by Game_Unit)

(Both Game_Actors and Game_Enemy are the "Factions" in battle, super classed by Game_Battler)

To make a new unit, you have to at least clone game_troop + game_enemy and rename it accordingly.

Then check for those that link to the methods in $game_troop and add the new $game_troop_clone to whichever lines calling it.

eg, datamanager, battlemanager, scene_battle... and lastly you need a way to "call" the new units as battlers into the battle.

datamanager manages the global $ for the new class

battlemanager setup the battles calling troops and parties into the game.

scene_battle is a new scene that is called when you encounter a battle (and return to scene_map with results after the battle)

Not an easy job but do-able for those that have the time for it.

And it sounds like you are almost there,

Since you managed to set it up to attack enemies and not player, and not all enemies attacking themselves.

I assume you have found  your way to create a new unit by cloning the existing ones.

But still need that final add-on bit?

If you did clone one of the party/troop class (renamed and rewired the new class and methods into the class game_unit)

and made a 3rd battle party available in the battle,

they should be having their own set of targets and allies even though they still uses the enemy graphic and settings.

So i am not sure why they are still attacking themselves unless the methods are still pointing to somewhere wrong.

---------------------

Or, alternatively.. If you only want one enemy to act out of the way..

Don't really remember how the ally targeting works, since i haven't been using the original battle engine for ages,

but might be easier to just make a set of skills that target allies only,

and have that enemy use that skill and you should be able to have it attacking other enemies. If this is what you did and it's attacking itself.

Means you probably need to find a way to minus itself from the member index the game_action script is referring to. Scripting is still needed but at least much easier than making a 3rd battle party. :D

Or, simply have it acts like a "hostage" like most game did. Put an "invisible"(no icon) state on it  at the start of a battle

and disable it from doing anything through out the battle.
 

FireDusterStudios

Indie Game Developer
Member
Joined
Sep 1, 2015
Messages
24
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Try setting the skills it has to target, "1 Ally" or such, rather than enemies, and in the troop that it appears set an event page that checks if every other enemy is defeated and if so possibly forcibly add the state DEATH to the enemy, but then Immidiately remove it if you need it. Make sure to set a variable for it's HP before you set the death state, and once the battle is over and the death state is gone, set it's HP to the Variable and I THINK it should still count it as a Victory.

I haven't tested this so I don't know if it works.
 

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,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top