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.
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?
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
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.
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?
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.
◆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
No need to apologize for any of this, eventing was never built for an action system and you’re keeping up fine.
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?
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.
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.
◆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-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.
◆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-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.
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.
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.
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