This took me a long time to figure out so I thought I would share a tutorial so that anyone else wanting to make something similar can.
What it does:
This is the satellite, basically what it does is each turn it protects the player and takes the hit for them. It also rotates around party member (e.g. turn 1 actor 1, turn 2 actor 2 etc.) It cannot fight or be hit, it is just a shield. When it protects a hit, it will break but it will be back after 2 turns.
Tutorial
Plugins you will need:
YEP_BattleEngineCore
YEP_PartySystem
YEP_AutoPassiveStates
YEP_BuffsStatesCore
YEP_TargetCore
YEP_X_SelectionControl
YEP_BaseTroopEvents
YEP_WeaponUnleash
Recommended but non essential plugins:
YEP_X_ActSeqPack1
YEP_X_ActSeqPack2
YEP_X_ActSeqPack3
YEP_X_AnimatedSVEnemies
Before you start, go into the plugin settings of the YEP_Party System and set the maximum amount of party members to 5 and go into BaseTroopEvents and set which troop will be the base troop
Also, make sure to create your Satellite actor
It is just an actor with the class satellite which has no attacks or anything, using the YEP_X_SelectionControl they cannot be selected by an enemy <Cannot Select: All>
Then using YEP_WeaponUnleash <Replace Attack: 0> they cannot attack anything
Step 1: Base Troop Event Set up
For this example, the satellite appears by a switch as it is not always there in the game, only after a certain checkpoint.
Now create a base troop event or add an event page to your current base troop event and make the condition the switch, make sure it spans every turn
[/url]All of these next pieces will make up the code of the base troop event page
In my game, there are 4 actors so there will be 4 variables (Summer, Sydney, Tod & Smith)
Each variable will be the current HP of the actor (not max HP)
Everything now will be in the conditional branch If: Satellite dead = 0 as these can only run if the satellite has not collapsed. Every turn the variable satellite will have +1 so the game will know when a turn has passed and which actor to protect with the satellite
When satellite = 5 it needs to be reset to 1 so it knows to cycle through again from the beginning.
Now make if branches for each variable =1, 2, 3, 4. They will all run a different common event which will make the satellite protect each of the actors each turn. (See next step for the contents of the common events)
Finally, in the else branch of the Satellite = 0 branch, we will set up what happens if the satellite is dead, each round they are dead +1 to satellite dead, then after 4 turns run change the satellite image to the normal version and set satellite dead to 0
Step 2: Common events
Here are all the common events you will need
They are for each of the actors (Satellite shuffle, the satellite protecting each member, Actor Name Satellite is the protection event)
First I explain the Satellite shuffle events
In my game, the player can choose which party members they have so first it is important to check which members are actually in that moment present in the battle. Each has a switch assigned to them.
First visually the party members need to be in the correct order where the satellite is next to Summer
All party members apart from Summer get removed
Now the satellite gets added next to Summer and the rest of the party members can be added back. Then a switch is turned on which lets the game know that Summer is currently protected.
Now this event will be repeated 3 more times making sure the satellite is next to the correct player
Now for the "Actor Name" Satellite event
This event will be triggered after the player is hit to absorb the damage (see step 3 to see how it is triggered)
Make sure it can only run if the satellite is alive and the actor can be protected.
Then the satellite will turn invisible, the animation of the satellite protecting the player will play on the actor, then the satellite will be given a graphic where it is broken on the floor
Now the satellite will be dead as it =1 and the counting for each turn it is dead will start
Then using a different variable from the first time, find out their current HP and take away the first variable from the second variable
If it is no difference, nothing needs to happen. But if it is the HP needs to be added back so that it is as if no damage was taken and they are recovered.
Step 3: Passive States
Now make 4 states for each actor. Make sure when the satellite is added you inflict all actors with their own unique state
The custom React Effect will make code play after the player is attacked by an enemy, this how we will know the player has been targeted. Then common event 148 was "summer satellite" so if the conditions of being protected by the satellite are met the satellite will protect Summer
Playtest:
[url=https://www.youtube.com/embed/9QsUXGPjUdY]https://www.youtube.com/embed/9QsUXGPjUdY
Let me know what you think, I know some things could be simplified probably but this works for me
本贴来自国际rpgmaker官方论坛作者:petpous处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/entity-that-protects-party-members-from-damage-satellite-summon.137092/