Overworld combat attacks?

Thank you, it works like a charm now, nothing less than what I wanted!

I’ll let you know when the next point comes up.

I’d like the Attack Collision that follows the player to turn invisible when it’s not being used and Visible when it is in the middle of an attack, but i don’t know how to get there. Suggestions?

Also, I’m trying to implement the actual attacks the player can perform right now, and I’m like…semi-succeeding. Are you OK if I pose multiple questions per post? I feel like it’d be the quickest way to go about this, since I want to do a lot of attacks, and most questions will be along the lines of “Here is the code I have made, but it isn’t doing (this), do you know why?”

Transparent ON and OFF in the move route list is the easiest way. It takes one frame and works on any event, so put a Set Movement Route on the Attack collision inside the attack common event, Transparent OFF right after the Set Event Location at the start and Transparent ON as the last thing before ATTACKING flips OFF. If you’ve still got the Step Forward and Step Backward routes, those can just be the first and last commands in them. Change Opacity 0 and 255 does the same job if you’d rather fade it later.

I’d keep both toggles in the common event rather than in the collision’s own parallel. An event only holds one forced route at a time, so a route forced from there while ATTACKING is ON would replace whatever the attack route is in the middle of.

Multiple questions per post is fine, one thread for the whole system beats five scattered ones. Screenshots of the exact block like you’ve been doing is the fastest way for me to read it.

Yep, that functioned. Now time for my first multi question.

This is my code for a Shield action. It’s meant to move Attack Collision out in front of the player, and then leave it one tile in front of them for as long as they have the X key held down. When they let go of the X key, it should disappear and become inert.
Instead, pressing X causes the shield to move out in front of the player and then instantly disappear. Trying this action too many times randomly removes the ability for the player to use ANY action at all.
Any ideas?

This action increases the player’s speed for 5 seconds, then, once the speed wears off, they become unable to use this action again for another 5 seconds.
Instead, the player’s speed is increased and never returns to normal, meaning that a cooldown period never happens.
Any ideas?

This action is meant to turn the player invincible, and have them run forward 4 tiles, ramming and damaging any enemies that they run into, knocking them away until they hit a wall (this knockback process is handled inside the enemy event remember)
Instead, if the player is at a standstill, the screen-shake and sound effect happen, but the player remains still. Then, regardless of which arrow the player presses, they run in the direction that they originally performed the action (only while they have the arrow held down though) in for four tiles, before their control is returned to normal.
Any ideas?

  1. Three things in the shield.

The hold check only runs once. After the step finishes, the isPressed branch is evaluated a single time and the block ends, so a tap lands in the Else and vanishes, and a hold lands in the pressed side and then falls out the bottom with ATTACKING still ON and nothing ever turning it off. Wrap it in a Loop with a Wait 1 frame on the pressed side and a Break Loop on the released side.

The release side is also in the wrong order, and that’s the “no actions at all” one. While ATTACKING is OFF the collision’s own follow logic forces a Turn route on it every frame, and an event only holds one forced route at a time, so the Transparent ON route you set after flipping OFF gets replaced before it can finish and the Wait on it never comes back. The whole event freezes there. Route first with the Wait, ATTACKING OFF last, and the same rule for anything else that routes the collision.

CurrentX2 and CurrentY2 read This Event, which in that event isn’t the Attack collision. Either pick Attack collision in the Character dropdown or drop those two lines and the Set Event Location under them, since the collision doesn’t move while ATTACKING is ON anyway. Skip If Cannot Move on the Step Forward route too, a blocked step with Skip off is the same freeze.

◆Loop
  ◆If: Script: Input.isPressed("action2")
    ◆Wait: 1 frame
  ◆Else
    ◆Set Event Location: Attack collision, ({BPlayer X},{BPlayer Y})
    ◆Set Movement Route: Attack collision (Wait)
      : Transparent ON
    ◆Control Switches: #0181 ATTACKING = OFF
    ◆Break Loop
  ◆End
◆Repeat Above
  1. Wait 300 frames parks the whole event, so every other action is dead for those five seconds. It also dies if the event instance gets rebuilt during that time, which a map transfer does, and then Speed 4 never runs. If you’ve dashed through a door while testing, that’s the never returns. There’s also no cooldown in the block yet, it just ends after Speed 4.

I’d do it with two variables and no Wait. On trigger, only if both are 0, set the speed and DashTimer = 300. Above the trigger check, every pass, if DashTimer > 0 subtract 1 and when it hits 0 set Speed 4 and DashCooldown = 300. If DashCooldown > 0 subtract 1. The decrements run in whatever instance of the event exists so they survive a transfer, and nothing blocks the other actions.

  1. That block is right for a plain project. A forced route on the player runs whether or not a key is held and the arrows get ignored while it’s going, so the arrows mattering and the standstill doing nothing both point at something outside the block.

Two questions. Where does the Attack collision sit while idle, on the player’s tile or the tile in front, and does it have Through on? With Skip on, a Step Forward into a tile the collision occupies gets skipped instead of retried, so four blocked steps finish in four frames and the player never moves, which is the standstill result exactly. And are you running any movement plugins, VisuStella’s Events and Movement Core especially?

  1. Here’s what I’ve got.

  1. Here’s what I’ve got. Below SCREENSHAKE MEDIUM nothing is different.

  1. While Idle, the attack collision sits on top of the player. It’s forced there at all times while ATTACKING is off. Through is On. I have no VisuStella plugins, I’ve heard bad things about compatibility.

I’m sorry if I’ve made any more mistakes here, I’m really trying my hardest to follow what you’re saying.
This is all several magnitudes more complicated than any eventing I’ve worked on in my life, and I’m trying REALLY hard to comprehend everything without getting overwhelmed lol. I really appreciate the level of patience you’ve shown so far.

  1. That reads right. CurrentX2 and CurrentY2 aren’t used by anything anymore so they can stay or go, they’re not hurting.
  2. The timer logic is sitting inside the isTriggered block, so it only runs on the frame you press the key, and a timer that only ticks when pressed never counts down. The decrements need to live above the trigger check where every pass of the event reaches them. The other piece is the DashTimer = 0 branch, which is true the entire time you’re idle, so it would fire every frame rather than once. Nesting it inside the decrement makes it fire only on the frame the timer actually lands on zero. Shape:
◆If: DashTimer > 0
  ◆Control Variables: #0207 DashTimer -= 1
  ◆If: DashTimer = 0
    ◆Set Movement Route: Player
      : Speed: 4
    ◆Play SE: STUTTER
    ◆Control Variables: #0206 DashCooldown = 300
  ◆End
◆End
◆If: DashCooldown > 0
  ◆Control Variables: #0206 DashCooldown -= 1
◆End
◆If: Script: Input.isTriggered("action3")
  ◆If: DashTimer = 0
    ◆If: DashCooldown = 0
      ◆Common Event: SCREENSHAKE MEDIUM
      ◆Play SE: GO UP
      ◆Set Movement Route: Player
        : Speed: 6
      ◆Control Variables: #0207 DashTimer = 300
    ◆End
  ◆End
◆End
  1. Through on and the collision on the player’s tile rules out what I was thinking, so here’s my next question. Is there anything else in the project that sets a movement route on the Player while no arrow is held? An idle pose, an image swap, a turn to face something, anything that runs every frame when you’re standing still. Same one forced route at a time rule from the collision. If something re forces a route on the Player every frame while you’re idle, the ram’s route gets replaced before its steps can run, the Player stays frozen because a route is always forcing, and the moment you hold an arrow that other thing stops, the ram’s route finally executes, and you run four tiles in whatever direction you were facing. That would produce exactly the standstill doing nothing, the arrow direction being ignored, and the run only going while a key is held.

No need to apologize for any of this, eventing was never built for an action system and you’re keeping up fine.

  1. Shield works as intended, but I’d like the player to be forced to be immobile while the shield is active. As it stands, they can spawn the shield, hold X down and run away from it. Do you know how to do this?

  2. Here’s what I’ve got. Everything below the blue selected area is just End commands. It doesn’t seem to be working properly still since the player never slows down so I probably broke something here too argh.

  3. Well that’s scary. No, I don’t believe anything Parallel Processes a move route onto the player off the top of my head. The closest I know of is some code that asks if the player is facing a direction in order to turn the Attack Collision to face the player’s facing, and the code that changes the player’s appearance depending on certain variables, but even that is just a Change Actor Images command.

  1. A forced move route is what blocks player input, the arrows get ignored while one is running, so force one that never ends. Right after ATTACKING = ON in the shield block:
◆Set Movement Route: Player (Repeat)
  : Wait: 1 frame

Repeat Movement ticked, no Wait for Completion. That loops on itself and the player can’t move or turn until something replaces it. Then in the release branch, before ATTACKING = OFF:

◆Set Movement Route: Player
  : Wait: 1 frame

Same command with Repeat off. It runs its one frame, ends, and input comes back. One thing to keep in mind, any other route set on the Player while the shield is up replaces the freeze, so the dash’s Speed 4 landing mid shield would free them early.

  1. The whole thing is still wrapped in the isTriggered at the very top, so the timers only tick on the press frame, same as before. Delete that outer If and its End so the two timer blocks sit at the top level of the event and the inner isTriggered is the only trigger. The contents are right, it’s just the wrapper.
  2. Nothing in that list would do it, so I’d rather run a test than guess again. Make a throwaway Action Button event on the map, put the exact same route in it, Set Movement Route: Player with Skip and Wait and the four Step Forwards, and interact with it while standing still. If the player walks four tiles, the route is fine and it’s something about the context it’s running in. If they don’t move, something in the project is affecting player routes everywhere, and I’d want the full plugin list including whatever adds the action1 through action4 inputs. Also worth trying the ram again now that the shield and dash aren’t freezing the event, in case part of what you saw was the old hang.

1-Yep, that’s done it.
Only thing is, while thoroughly testing it, i found that pressing an arrow and X at the same time can have the player turn+step a tile away from the shield while it’s active. And while the player is running at 6 speed, it spawns on top of the player rather than in front of them about half of the time, because the shield can’t keep up with the player i think.

2-Now it works perfectly!

3-I clicked the event with CTRL held down, and the player did indeed run forward 4 tiles.

  1. Both of those are the same root, the shield’s position and facing are borrowed from the collision’s follow logic, which is a frame behind the player. On a same frame arrow plus X, the collision’s Turn hasn’t been applied yet when the shield route replaces it, so it steps in the old direction while the player finishes turning and stepping the new way. At speed 6 the same lag puts it on the tile the player is already on instead of ahead. The fix is to stop stepping it at all and place it straight onto the tile in front, worked out from the player’s current position and direction in the same block:
◆Control Switches: #0181 ATTACKING = ON
◆Set Movement Route: Player (Repeat)
  : Wait: 1 frame
◆Play SE: Darkness6
◆Control Variables: ShieldX = Player Map X
◆Control Variables: ShieldY = Player Map Y
◆Control Variables: ShieldDir = Player Direction
◆If: ShieldDir = 2
  ◆Control Variables: ShieldY += 1
  ◆Set Event Location: Attack collision, ({ShieldX},{ShieldY}), Down
◆End
◆If: ShieldDir = 4
  ◆Control Variables: ShieldX -= 1
  ◆Set Event Location: Attack collision, ({ShieldX},{ShieldY}), Left
◆End
◆If: ShieldDir = 6
  ◆Control Variables: ShieldX += 1
  ◆Set Event Location: Attack collision, ({ShieldX},{ShieldY}), Right
◆End
◆If: ShieldDir = 8
  ◆Control Variables: ShieldY -= 1
  ◆Set Event Location: Attack collision, ({ShieldX},{ShieldY}), Up
◆End
◆Set Movement Route: Attack collision
  : Transparent OFF
  : Image: MH VitalAttacks1(2)
◆Loop
  ...

Player Direction comes back as 2 down, 4 left, 6 right, 8 up. The freeze goes first so any step already in progress is the last one, and since Player Map X and Y are already the destination tile mid step, the shield lands in front of where the player ends up. The Transparent and Image route no longer needs Wait since nothing depends on it finishing.

  1. Good.
  2. Redo that test without holding Ctrl. In a playtest, Ctrl turns off passability, so with it held a route will always walk and the test doesn’t tell us anything. If it still runs four tiles without Ctrl, the route is fine and the next test is to copy the ram block into a brand new parallel common event on its own, to see whether one of the neighboring blocks is interfering. If it doesn’t run without Ctrl, the steps are being skipped because the tile ahead reads as blocked from a standstill, and then I’d want to know what else, if anything, is invisible and sitting on or around the player.

1-I believe this is functioning as intended now!

3-I added a “turn random direction” command first so that the player didnt just infinitely run into the event, and yes, the player still completes the movement.

  1. Good.
  2. Then the route itself is fine and it’s something about where it’s running. Before the next test, try the actual ram in the real event again, since the shield and dash were both freezing that event when you first reported it and I never heard whether the ram still misbehaves with those fixed. If it works now, that was it.

If it still does the standstill thing, two more. Paste what’s inside SCREENSHAKE MEDIUM, it’s the one part of the ram block I haven’t seen. And copy the ram block into a brand new parallel common event with nothing else in it and test from there. If it runs clean on its own, one of the neighboring blocks is the problem and we can find which by turning them off one at a time.

The ram still doesn’t work on pressing S.

Screenshake Medium is just a few commands from the MythAtelier screen shake plugin.

I put the ram command into its own parallel process, and removed it from the original. It still does the standstill thing.

Good, that rules out the neighbors. Between the Action Button test that works and this parallel that doesn’t, there are two differences left in the block itself, the shake common event and the two ATTACKING lines, plus whatever the trigger key touches.

Two quick edits on the Alternate tester. Delete the Common Event: SCREENSHAKE MEDIUM line and test. If the ram runs, it’s the shake plugin. If not, put it back, delete both Control Switches lines, and test again.

Separately, ScreenShakePlus means there are plugins in the project, so I’d like the full list from the Plugin Manager. The one I care about most is whatever maps S to action4, and whether it or anything else in the list also handles movement, WASD, eight direction, pixel movement, anything of that kind. A key that’s both action4 and a movement input would be worth knowing about.

I did both changes to the alternate tester, and neither of them made the ram run UGH.

This is my plugin list anyway.

That list has one that jumps out. TurnInPlace changes how the player moves from input, and a plugin that sits between “step” and “actually move” is exactly what could make a forced route on the Player behave differently from the same route on an event. Everything you’ve described fits a plugin that only lets the player step while a direction key is held.

Turn TurnInPlace off and run the ram from the Alternate tester. If it works, that’s the culprit, and we can talk about keeping it while working around the ram. If it doesn’t, I’d do the same one at a time with BUTTON ADDERS and ToshA_Footsteps, since those are the other two that touch player movement or input.

Well, it was indeed the TurnInPlace plugin causing the issue and now the ram is working, which is good to know but also sucks lol.

I’d like to keep it in possible, because I like being able to turn in place and there are other attacks where it will be important, but I guess it’s nonessential if worst comes to worst.

Good news is you can keep it. Your Action Button test is the clue, the same route worked from an event that was running and failed from a parallel, so TurnInPlace looks like it steps aside while an event has control and only interferes with player routes coming from a parallel.

The no code fix is to make the ram come from a running event. Give it a common event of its own with Trigger set to Autorun and a switch, call it RamGo. The parallel’s action4 block just turns RamGo ON. The common event does the shake, SE, ATTACKING ON, the route with Wait, ATTACKING OFF, then RamGo OFF as its last line. Autorun runs on the map’s main interpreter the same way an Action Button event does, the player can’t move by input during it anyway which is what you want here, and it works on every map. Any future attack that moves the player with steps can use the same shape.

If you’d rather fix it at the source, paste the contents of TurnInPlace.js here or in a Pastebin. It’s probably short, and the fix is likely a couple of lines telling it to ignore the player while a move route is running, which would cover everything at once.

Genius move lol. I’ll add this in and tell you how it goes.

I’m gonna try and see if I can implement something like

Action4 Triggered=turn MOVINGATTACK ON

then in a new handler called MOVING ATTACK HANDLER

-if MOVINGATTACK is ON, then
-Move to second page of MOVING ATTACK HANDLER
-if MOVINGATTACK is ON and ATTACK TYPE=3, then execute attack