Remove dead party in combat with buffstate, need a way to save actor id as variable

miragewolf

Regular
Regular
Joined
Jul 23, 2019
Messages
80
Reaction score
15
First Language
Traditional Chi
Primarily Uses
RMMV
Hi, is there a way to save a battler's actor id to variable so they are removed either when the state wears off or are removed when knocked out?

I've tried several variations but cannot seem to save the actor id as variables

example: (state 223 is a passive state all summon gets)


<Custom Remove Effect>

if (b.isStateAffected(223))

{

$gameVariables.setValue(50, BattleManager._action ? 1 + BattleManager._action._targetIndex : -999);

$gameParty.removeActor($gameVariables.value(50));

target.performCollapse();

// Clear the target's results.

target.clearResult();

}

<Custom Remove Effect>

Have also tried
var ID = b;
$gameVariables.setValue(50, ID);

or similar ones like (var ID = user var ID = target) but none of it seems to work.

Using troops common events with span of turn works and removes the dead summons but gives a huge fps drop every turn.

The common event is shown in the picture, skill 267 only appears on dead summon when they are knocked out using a passive state.
 

Attachments

  • disepl.jpg
    disepl.jpg
    159.5 KB · Views: 1

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
5,043
Reaction score
4,395
First Language
EN
Primarily Uses
RMMZ
Does this work? (Untested.)

<Custom Remove Effect> if (user.isStateAffected(223)) { if (user.isActor()) { $gameVariables.setValue(50, user.actorId()); $gameParty.removeActor(user.actorId()); } else { $gameVariables.setValue(50, -999); } } </Custom Remove Effect>
[Edit: added state 223 check and branched for actor/enemy.]

To remove them when knocked out you could add a <Custom Apply Effect> tag to the death state, i.e. state 1.
 

miragewolf

Regular
Regular
Joined
Jul 23, 2019
Messages
80
Reaction score
15
First Language
Traditional Chi
Primarily Uses
RMMV
Does this work? (Untested.)

<Custom Remove Effect> if (user.isStateAffected(223)) { if (user.isActor()) { $gameVariables.setValue(50, user.actorId()); $gameParty.removeActor(user.actorId()); } else { $gameVariables.setValue(50, -999); } } </Custom Remove Effect>

[Edit: added state 223 check and branched for actor/enemy.]

To remove them when knocked out you could add a <Custom Apply Effect> tag to the death state, i.e. state 1.
Thank you for the answer, the formula does remove summons now.

I did a quick test and added a requirement to the first line like this

if (user.isStateAffected(223) && user.hp < 1) {

The game seems to remove actors right away without them doing anything once switches to their turn.

Then I tried
if (user.hp < 1 && user.isStateAffected(223)) {

and it works as intended, so java script requires a specific order for condition to meet?

Now I know how to remove actors, I'll try to modify the state to correspond the dismissal conditions. Thanks again.
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,261
Reaction score
9,241
First Language
English
Primarily Uses
RMMV
Your code has a lot of confusion between what is a Game_Actor and what's an ID.

Instead of trying to produce code for it, could you be more specific about what you're trying to do? Because it seems to me that you shouldn't need a lot of this code.
Hi, is there a way...so they are removed either when the state wears off
I don't see why this needs saving an ID anyplace. Just going off of this sentence, you just have the Custom Remove Effect and reference target as the battler the state is attached to. And if you need the ID, you do target.actorId()

But we don't know what your state 223 is - is that a second state? So if the actor has two specific states on, when this one wears off and they still have the other one, they get kicked out?

or are removed when knocked out?
As caethyril said, just a Custom Apply in state 1.

Thank you for the answer, the formula does remove summons now.
If you're trying to make summons, why not try using an existing plugin that handles all of this for you? Such as SRD's Summon Core?

and it works as intended, so java script requires a specific order for condition to meet?
No it doesn't, those two conditions are identical.
 

miragewolf

Regular
Regular
Joined
Jul 23, 2019
Messages
80
Reaction score
15
First Language
Traditional Chi
Primarily Uses
RMMV
Your code has a lot of confusion between what is a Game_Actor and what's an ID.

Instead of trying to produce code for it, could you be more specific about what you're trying to do? Because it seems to me that you shouldn't need a lot of this code.

I don't see why this needs saving an ID anyplace. Just going off of this sentence, you just have the Custom Remove Effect and reference target as the battler the state is attached to. And if you need the ID, you do target.actorId()

I've checked on forum, never see target.actorId() is used. I'll write this down. Thank you for the hint.

The only way I've found to remove an actor when killed through scripting is using

$gameParty.removeActor along with custom timing effect, which requires the actor ID.

I've read the buffstatecore summon example. There every summoned actor requires his own state to monitor since it's actor dependent, and if there are two summoners, having either one killed would dispel the summons.

With common event in example, I've changed the summon a bit so calling actors to frontline is dependent on party size, but I had no ways dispelling them individually unless every single summoned actor gets his own state.
But we don't know what your state 223 is - is that a second state? So if the actor has two specific states on, when this one wears off and they still have the other one, they get kicked out?
State 223 is an autopassive state that all summons get. It is used as identification as summon so they can fulfill certain conditions when using skills, aura, and events.

I then added a state using the formula in my original post to whole party when summon is used.
When the summoned creature with the state is killed or has summon state duration wear off, he should be dispelled while regular actors are not affected.

There is another skill that once out of combat, common event is used to dispel left over actors with the summons with the skills, similar to the way I did with the dispel dead summons in common event posted in first post.



As caethyril said, just a Custom Apply in state 1.


If you're trying to make summons, why not try using an existing plugin that handles all of this for you? Such as SRD's Summon Core?
My game starts to get occasional freeze with SRD in sideview battles. Only tested in frontview before.

It became more common after I used torigoya's replace dead members so I stopped using the summon plugin at all.

There was also the changing equipment crashing problem which I never managed to solve.

I could only prevent crashing by adding a passive state to summon actors to grants aura so it blocks the whole party from using the command which causes crash.

Even if all the summons are killed, the aura still requires switching around menu in combat to remove it, and require a common event (I used adding an empty character then removing him) outside combat to remove the summon aura left over which blocks changing equipment.

No it doesn't, those two conditions are identical.
Thanks, not sure why that line doesn't work for me when testing.
 

Attachments

  • summon.jpg
    summon.jpg
    159.9 KB · Views: 1

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,261
Reaction score
9,241
First Language
English
Primarily Uses
RMMV
You are free to do this however you like in your game. I would suggest that instead of working on/getting help with this, you work on and get help with SRD's Summon Core working with your other plugins.

I don't have the replace dead members thing, but I do use it with Yanfly plugins and it all works fine. That plugin would automatically do basically everything you're trying to figure out here.

The only way I've found to remove an actor when killed through scripting is using
$gameParty.removeActor along with custom timing effect, which requires the actor ID.
Correct, so in your state you'd just do:
Code:
<Custom Remove Effect>
if (target.isStateAffected(223))
    $gameParty.removeActor(target.actorId());
</Custom Remove Effect>

I've read the buffstatecore summon example. There every summoned actor requires his own state to monitor since it's actor dependent, and if there are two summoners, having either one killed would dispel the summons.
Can you link to what you're talking about? I don't see any example of that in the Buffs & States Core documentation, nor in a Yanfly Tips & Tricks article.

I then added a state using the formula in my original post to whole party when summon is used.
When the summoned creature with the state is killed or has summon state duration wear off, he should be dispelled while regular actors are not affected.
Why apply it to the party if it only does something for summons? Why not just apply it to the actors you're summoning?

Even if all the summons are killed, the aura still requires switching around menu in combat to remove it, and require a common event (I used adding an empty character then removing him) outside combat to remove the summon aura left over which blocks changing equipment.
Sorry, I don't understand what all of this means out of context with nothing to look at.

I think if you handled these problems one at a time you could get everything working smoothly.
 

miragewolf

Regular
Regular
Joined
Jul 23, 2019
Messages
80
Reaction score
15
First Language
Traditional Chi
Primarily Uses
RMMV
You are free to do this however you like in your game. I would suggest that instead of working on/getting help with this, you work on and get help with SRD's Summon Core working with your other plugins.

I don't have the replace dead members thing, but I do use it with Yanfly plugins and it all works fine. That plugin would automatically do basically everything you're trying to figure out here.


Correct, so in your state you'd just do:
Code:
<Custom Remove Effect>
if (target.isStateAffected(223))
    $gameParty.removeActor(target.actorId());
</Custom Remove Effect>


Can you link to what you're talking about? I don't see any example of that in the Buffs & States Core documentation, nor in a Yanfly Tips & Tricks article.






Why apply it to the party if it only does something for summons? Why not just apply it to the actors you're summoning?




As a line in common event, unless giving the temporary state to party would slow down game performance, change state: entire party function is much more convenient than add states separately.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,261
Reaction score
9,241
First Language
English
Primarily Uses
RMMV
I don't see anything there about killing the master and removing the summoned actor, so I think that's something you added and it could be done more efficiently. For that matter, the code you linked to was designed to only summon 1 thing.

I would not put any actor IDs into that code, I would make the skill you're using summon whichever actor then put a generic summoned state on it. I think that example is an inefficient way to do it.

As a line in common event, unless giving the temporary state to party would slow down game performance, change state: entire party function is much more convenient than add states separately.
I wouldn't put any of this in a common event. I'd have it in code on the skills. Then that would let you create references between the master and summon without having to finagle through multiple states and auras and whatever.

But I would only do that if there weren't existing solutions. If you're opposed to trying to make the Summon Core work, did you look at the plugin by LadyBaskerville that's suggested in the thread you linked to?
 

miragewolf

Regular
Regular
Joined
Jul 23, 2019
Messages
80
Reaction score
15
First Language
Traditional Chi
Primarily Uses
RMMV
I don't see anything there about killing the master and removing the summoned actor, so I think that's something you added and it could be done more efficiently. For that matter, the code you linked to was designed to only summon 1 thing.

//When state wears off, remove summoned actor
<Custom Remove Effect>
$gameActors.actor(8).startAnimation(15)
$gameParty.removeActor(8)
<Custom Remove Effect>

This is a state from the link that targets the caster (the example that shows item scope: user), it adds the summon and when state is removed either through decaying, battle end, or character killed, it removes the summoned actor.


I would not put any actor IDs into that code, I would make the skill you're using summon whichever actor then put a generic summoned state on it. I think that example is an inefficient way to do it.


I wouldn't put any of this in a common event. I'd have it in code on the skills. Then that would let you create references between the master and summon without having to finagle through multiple states and auras and whatever.
But I would only do that if there weren't existing solutions. If you're opposed to trying to make the Summon Core work, did you look at the plugin by LadyBaskerville that's suggested in the thread you linked to?

I've read through that thread, in fact the last post was me asking how to make the party remain with the summon like the post suggested rather than FFX way that replaces whole party.
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,261
Reaction score
9,241
First Language
English
Primarily Uses
RMMV
I've read through that thread
Okay, then you should have seen the post suggesting the edit and her response was to use SRD's Summon Core instead.

This is a state from the link that targets the caster (the example that shows item scope: user), it adds the summon and when state is removed either through decaying, battle end, or character killed, it removes the summoned actor.
Yes, and as I already said in my last post, I don't think that's a good way to do it. It's ignoring functionality that you get from Yanfly's Buffs & States and other plugins.

I dunno what else to say - you seem to be determined to find reasons to do this the hard way and recreate all of this on your own.

That is perfectly fine, but I think it's a bit of a waste of time instead of any possible minor tweaks to make existing plugins work in your project, so I'll stop derailing your thread.

Good luck with your project!
 

Latest Threads

Latest Profile Posts

The site is being slow and funky again. IS SOMEONE CRAFTING POEMS?!
So yeah, @TRIDIUM @TESTOSTERONE, I wuz like, "What do they mean by borderline and boundaries?"

And then, y'all know this girl?

actress1.png

alice_bikini.png

The clothes? They're just a, um, quick edit. :kaoswt:
I've uploaded the opening cutscene from my game to my channel. It basically introduces us to the first three characters, and what their relationships are:
Cosmic Inferno: Opening dialogue
I don't want to start a panic...but everyone, check the color of your milk!
IMG_20231002_082329.jpg
My One Map Challenge is nearing completion. I am in the multiple run testing phase atm. This is the map. Beware the minotaurs in the maze area. The female ones are more aggressive. Can you prove to the land of Winchell that a dragon and a human can love each other?

Forum statistics

Threads
135,021
Messages
1,253,013
Members
177,948
Latest member
Kodi_Venus
Top