Looking for a script that allow enemies to hold characters

Ant1989

Veteran
Veteran
Joined
Nov 30, 2013
Messages
36
Reaction score
1
First Language
Portuguese
Primarily Uses
I am making a game in which some enemies have a skill to hold one of the characters. When this happens a CG is shown and the character holded can only attack the enemy holding him, and the enemy holding can only attack the caracter he is holding with a special attacks that can only be used when holding.. 


Until now I am doing everything by events, making a holded state and using a swtich. But that is very messy and limited in a  way that it only work seamless if I have only one enemy and one member in my party. If I have more than one enemy both may use the holding attack at the same time, and I wanted that only one could hold at a time. I know a way to solve this is by using an ATB. But that still leaves me with the problem of having a second party member, because the enemy holding may attack the second member while holding the other and with the attacks that should holding exclusive.


Summing up. I need a script that allow me select the specific target of an specific enemy while both are in specific states (holding and holded),  I know it is possible because in the adult game Malice and The Machine (http://eromancer.blogspot.com.br/?zx=b33dcbfbe2a49cfb +18 only), they have a similar system which works very well, but I don't know if they scripted it themselves, or if there is a free script available for that.


So, if anyone could point me to a script that do that, I thank you.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Scripts Forum is for posting scripts that you have written and wish to share with the community.  Therefore...


I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
 

Ant1989

Veteran
Veteran
Joined
Nov 30, 2013
Messages
36
Reaction score
1
First Language
Portuguese
Primarily Uses
I am sorry. I should have paid more attention.
 
Last edited by a moderator:

Harosata

Dramatic Lightning's BFF
Veteran
Joined
Aug 20, 2015
Messages
246
Reaction score
70
First Language
English
Primarily Uses
RMVXA
Okay, so you want:


1.  Holding Enemies can only hit Holded allies, and Holded Allies can only hit holding enemies.  From what it sounds like, you're okay if regular units can still attack Holded/Holding units.


2.  If an enemy is Holding, other enemies cannot use Holding attacks.


===


Okay, for number 2, Himework's Enemy Action Conditions might work.  This script adds on extra conditions for enemy skills.  This condition is placed in your enemy notebox, placing the id of the Holding-adding attack and state.


<action condition: HOLDINGATTACKID>
if t.members.none? {|mem| mem.state?(HOLDING)}
a.add_state(HOLDING)
return true
else
return false
end
</action condition>


Ideally, t.members.non?{|mem| mem.state?(HOLDING)} will return TRUE if no member of the enemy troop has that state, but the problem is that technically, both enemies don't have Holding when they select the skill.  So to play it safe, instead of having none? determine true or false by itself, I'll have it add a Holding state to the user (enemy) and then return true if there were no Holding monsters, because that would then ensure that the the Holding state exists in the same selection turn.


---


For number 1, here's Yanfly's Lunatic Targets followed by its Conditions Package.  Ideally, placing 


<custom target: foes any state HOLDEDSTATEID>


in your enemy skills that require the Holding state should make that skill only hit the Holded person...But the probably is that we are using specific skills of enemies, so how do we handle skills from actors, making then turn from normal skills to attack Holding enemies when Holded?


Well, you'll have to go into the Lunatics Target script;  near the top, you see COMMON BEFORE TARGET, COMMON AFTER TARGET,  and DEFAULT TARGET, and the bottom of the script shows these three empty blocks will usually run.  In our case, we mainly want to place something like this under COMMON AFTER TARGET:


if item.for_opponent? and user.state?(HOLDED)
targets = []
for member in opponents_unit
targets |= [member] if member.state?(HOLDING)
end
end


After replacing for the correct state ids, that piece of code occurs should check if the user has the Holded state and if the skill/item is targeting the opposite group (If an actors gets Holded, the opposite group are the enemies).  If that does work, the targets array should reset and then enemies with the Holding state should only be the targets on the list.  If you desire, you could drop the Conditions Package and place a second block of this code, but switch the ids of both states.
 

Ant1989

Veteran
Veteran
Joined
Nov 30, 2013
Messages
36
Reaction score
1
First Language
Portuguese
Primarily Uses
About number 2 I meant that two enemies can't hold the same character at the same time. But as I said, using an ATB (because everybody pick their action at the time they use it and not on turns) and having a swich going up when a character is holded and condioning the hodling skill to not use it when this swich is up should be enough. 


But 3 different scripts with a very big deal of logic. Not very neat. man, this is more complicated than I thought. But I will try your solution. Thanks..
 

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,867
Messages
1,017,061
Members
137,575
Latest member
akekaphol101
Top