MV - MV + MZ Make an Action Game! Chrono Engine Advanced Features and Scripts (gamepad, status effects, fighting followers)!

● ARCHIVED · READ-ONLY
Started by AquaEcho 57 posts Page 2 of 3 View original ↗
  1. One question: In the game i'm currently making there is an issue with a state. The game have an item called "Regenerative herb", as the name suggest, is an item that gives the player a state that regenerates HP over 30 seconds. And in the beginning it works fine. But then later i introduced an accesory that have the same effect when equipped, but infinite and much weaker. But because of this second effect, the first one is reduced by half. Which means that the first regenerations only heals over 15 seconds instead of 30. Probably because the two events run at the same time and that makes the state counter go twice as fast. How i could change that?
  2. Vladar458 said:
    One question: In the game i'm currently making there is an issue with a state. The game have an item called "Regenerative herb", as the name suggest, is an item that gives the player a state that regenerates HP over 30 seconds. And in the beginning it works fine. But then later i introduced an accesory that have the same effect when equipped, but infinite and much weaker. But because of this second effect, the first one is reduced by half. Which means that the first regenerations only heals over 15 seconds instead of 30. Probably because the two events run at the same time and that makes the state counter go twice as fast. How i could change that?
    Both the item and accessory are applying the same state? Maybe have the accessory apply a different state with the same effects so they're not both counting down the same state.
  3. AquaEcho said:
    Both the item and accessory are applying the same state? Maybe have the accessory apply a different state with the same effects so they're not both counting down the same state.
    Captura de pantalla 2025-02-17 235051.png
    This is the item's regeneration.

    Captura de pantalla 2025-02-17 235109.png
    This is the accesory's regeneration.
  4. So when you equip the accessory, you're turning on the switch for a common event that heals the player every 60 frames (1 second)? In that case it is not applying a state and there is no reason for the last two lines in that common event because it's not a state.
  5. AquaEcho said:
    So when you equip the accessory, you're turning on the switch for a common event that heals the player every 60 frames (1 second)? In that case it is not applying a state and there is no reason for the last two lines in that common event because it's not a state.
    I activate the Switch the moment the player get the accesory, and is always activated. But there is a check that only applies the code when the character have the accesory equipped. Yeah, is not a state, but i don't know why that happens.
  6. You're making the accessory also count down every state which is why the number of turns of every active state is going to be cut in half (or more accurately, be applied twice as often). That is why I'm telling you to remove the last two lines on the accessory common event.
  7. AquaEcho said:
    You're making the accessory also count down every state which is why the number of turns of every active state is going to be cut in half (or more accurately, be applied twice as often). That is why I'm telling you to remove the last two lines on the accessory common event.
    I guess that could be it, but weirdly enough, poison is not affected by this. Poison last the intended 30 seconds. And even removing the last two lines it still healing half, but this could be because i'm trying it in a sabe where the switch is already active, maybe in a new one It wouldn't happen.

    Edit: Poison is affected by this, but i didn't realize i put them to 60 turns instead of 30. And thinking about poison, i'm beginning to think that maybe is poison which cause this and not the accesory.

    Edit 2: Yeah, Poison was the cause of the issue, and not the accesory. The only way i had to "fix it" was to add a conditional branch that do the check if the player have the state applied. Like that the only moment when the issue would still be there is if both the regeneration state and the poison are applied at the same time.
  8. I might not have my "Fighting Followers" video done today as I got little sleep after hearing the sad news about chaucer. But I will post a general update.

    Download
    RPG Maker MV + MZ Fighting Followers Party Action Battle System by AquaEcho
    Edit: Video available now and all event pages below!

    NOTE: The below guide is for Cross Engine and is full of Cross Engine scripts!

    So in Chrono Engine the followers already take damage from enemy attacks (and can actually fire attacks at enemies and damage them if you tell them through script calls.) This is because this is all already implemented in Chrono Mode. The real issue for ABS mode is controlling the followers so they move around independently. Followers don't have event pages like events so normally you would have to do this all through scripts, which is beyond the ability of average users.

    However, there is a more user-friendly, free plugin, TyrusWoo Follower Control which has MV and MZ versions.

    So the idea is, when an NPC joins your party (e.g. Silvia), use TyrusWoo commands to stop the default follower movement, allowing you to define custom movement. Then use common events to be their "event pages" where you tell them how to move. Each follower would have their own common event page which defines their attack pattern. There would also be a "All Followers Control" for general movement pattern that applies to all followers (e.g. move to player when more than 3 tiles away).
    1740248553230.png

    1740185389142.png
    1740185462955.png
    Code:
    for (var i = 1; i<=$gameMap.players().length-1; i++){
    if(!$gameMap.players()[i]._chrono.target){if($gameMap.players()[i].distanceToPoint($gamePlayer.x,$gamePlayer.y)>3){$gameMap.players()[i].shootPastPlayer(1+Math.random());}}else{if($gameMap.players()[i].distanceToPoint($gamePlayer.x,$gamePlayer.y)>8){$gameMap.players()[i].shootPastPlayer(1+Math.random());}}}

    There are some long scripts here to make the follower check all the events around it to see if there are any enemies that aren't dead, set the first enemy that meets those conditions as the follower's target, then attack it until it's dead or out of range.
    1740185599515.png
    Code:
    if(!this.battler().isDead() && !this._chrono.target){$gameMap.events().forEach(event => {if(event && event._user.battler instanceof Game_Enemy && !(event instanceof ToolEvent) && this.distanceToPoint(event.x,event.y)<6 && !event.battler().isDead() && !event._erased){this._chrono.target=event; return;}})}
    Code:
    var t=this._chrono.target; if(t && !this.battler().isDead()){var dist= this.distanceToPoint(t.x,t.y)}; if(t && !t.battler().isDead() && !t.battler()._erased && dist<6){if(dist<1){this.turnTowardCharacter(t);this.act(14);}else{this.shootSelfPastTarget(2);}}else{this._chrono.target=null;}

    1740185822785.png
    Code:
    if(!this.battler().isDead() && !this._chrono.target){$gameMap.events().forEach(event => {if(event && event._user.battler instanceof Game_Enemy && !(event instanceof ToolEvent) && this.distanceToPoint(event.x,event.y)<6 && !event.battler().isDead() && !event._erased){this._chrono.target=event; return;}})}
    Code:
    var t=this._chrono.target; if(t && !this.battler().isDead()){var dist= this.distanceToPoint(t.x,t.y)}; if(t && !t.battler().isDead() && !t.battler()._erased && dist<6){if(dist<5){this.turnTowardCharacter(t);this.act(15);}else{this.shootSelfPastTarget(2);}}else{this._chrono.target=null;}
  9. Part 2!

    Tool pages
    1740184490463.png
    Code:
    this.turnTowardCharacter(this.user()._chrono.target);this.shootPastTarget(1);this.rotFaceTarg();this._transparent=false;

    1740184419737.png
    Code:
    this.turnTowardCharacter(this.user()._chrono.target);this.shootPastTarget(5);this.rotFaceTarg();this._transparent=false;

    Enemy
    1740248647156.png
    Code:
    $gameMap.players().forEach(player => {if(player._user.battler && this.distanceToPoint(player.x,player.y)<6 && !player.battler().isDead()){this._chrono.target=player; this.setSelf('D',true); return;}})

    1740184802852.png
    Code:
    if(this._chrono.target._user.battler.isDead()){this.setSelf('D',false);}
    Code:
    this.turnTowardCharacter(this._chrono.target);
    Code:
    this.act(80)

    1740185249333.png
    Code:
    this.turnTowardCharacter(this.user()._chrono.target);this.shootPastTarget();this.rotFaceTarg();this._transparent=false;

    Run this script on every map entry (either with a plugin or with an event set to autorun, with this common event and then erase event itself
    1740186076447.png
    Code:
    for (var i = 1; i<=$gameMap.players().length-1; i++){
    $gameMap.players()[i]._chrono.target=null; $gameMap.players()[i].setThrough(false);}

    LINE OF SIGHT/VISION CONES
    Note: The scripts above are only checking for distance between the enemies and players (the player and followers). If you want line of sight / vision cones download Dahlys Distance Calculator and use the script calls:

    Can the follower see the enemy?
    Instead of this.distanceToPoint(event.x,event.y)<6
    Dahlys.distCalc.canSee(-2, event._eventId, 6*48, 120)

    Can the enemy see the player or follower?
    Instead of this.distanceToPoint(player.x,player.y)<6
    Dahlys.distCalc.canSee(this._eventId, -2, 6*48, 120)

    Dahyls distance calculator goes by pixels instead of tilesize so multiply 6 by 48 (or whatever your tile size is)

    Code:
     * Can Char1 see Char2:
     *   - Script call: Dahlys.distCalc.canSee(char1, char2, dist, aov)
     *   - dist and aov are optional and the plugin parameters Default View Distance
     *     and Angle of View will be used if they are left blank.
     *   - Char1 will not be able to see Char2 if blocked by: 1) tiles with Blocked
     *     Terrain Tags, 2) tiles with Blocked Region Ids, 3) other characters
     *   - Player can see through followers but event vision can be blocked by
     *     followers. Using char2 = -2 to check if Event char1 can see either the
     *     Player or any Follower.
     *   - e.g.
     *     Dahlys.distCalc.canSee(-1, 1) is true if the Player can see Event 1 at
     *     the default distance and angle of view.
     *     Dahlys.distCalc.canSee(1, -2) is true if Event 1 can see the Player or any
     *     of the Followers at the default distance and angle of view.
     *     Dahlys.distCalc.canSee(-1, 1, 100, 360) is true if the Player can see Event
     *     1 at a radius of 100 pixels (360 degrees).
  10. could this be worked around to have non party npcs attacking enemies like guards attacking npcs that wander too close into their range?

    also currently in the midst of trying out the follower Ai but for some reason when enabling tyruswoo plugin my project basically jumps to 5 fps and stays that way so I'm working on figuring it out
  11. Yes, I have a patch that lets you assign actor data to events the same way as enemies. There is just some weird knock-on effects that happen on the event death and when you use spells or items where you can select a target that it starts requiring overwriting a lot of Chrono Engine functions. You could also make the guard an enemy that attacks other enemies. I'll have to test it out

    If you have a lot of parallel events without wait commands it can cause massive framerate drops. I would check those first. It's why I have wait commands on every parallel.
  12. I've had a couple people ask me how to offset a tool upward (because they're using a tall character sprite). Just put in the tool event move route (before any movement commands):
    this.locate(this.user().x, this.user().y-0.6);
    You can adjust the 0.6 to however much you need offset

    1741284718367.png
  13. Hello, I need your help because I can't get this to work. Is there something wrong at how I tried? Second image is a screenshot of the plugin with the code to link the gamepad with my project.
    screen 2.pngscreen.png
  14. @AquaEcho I know you made keyboard/gamepad control above, but I have a more powerful solution.
    not that this method works, but I made a function that checked "pressed" and "released" as gamepad
    don't have a released function.

    what ever you want to do with a button, you bound them to 1 single command and it works both
    on keyboard and and gamepad, so it could be used both (if your interested to test it out)?
  15. ShadowDragon said:
    @AquaEcho

    what ever you want to do with a button, you bound them to 1 single command and it works both
    on keyboard and and gamepad, so it could be used both (if your interested to test it out)?
    I'd be interested in trying it out
  16. vampy_graveyard said:
    Hello, I need your help because I can't get this to work. Is there something wrong at how I tried? Second image is a screenshot of the plugin with the code to link the gamepad with my project.
    View attachment 338788View attachment 338787
    The plugin should be after Chrono Engine in your list. The controller also has to be already plugged in when you start the game. Also what controller are you using? I tested those keybindings on an Xbox controller.
  17. AquaEcho said:
    The plugin should be after Chrono Engine in your list. The controller also has to be already plugged in when you start the game. Also what controller are you using? I tested those keybindings on an Xbox controller.
    I already did these stuff and still have no luck. I use a generic PC joystick of a brand that i suppose isn't very popular, at least outside my country (brand is Nippongame)
    Could this problem be because of the generic joystick?
  18. I added a couple links to the first post for how sound effects work and how to add extra skill and item hotkeys
  19. AquaEcho said:
    I added a couple links to the first post for how sound effects work and how to add extra skill and item hotkeys
    Hello, I want to add something. It's known how to make status effects, but when you have more than one state at the same time (Let's say poison and bleed) they both check the turn count, making both states end twice as fast. And I figured out a way to make several at the same time work fine. Should I post it here?