Action Ordering Issues

I was making a twinstick shooter, but I had some bullet spawning related issues:
(Files removed due to bots not allowing discord uploads)

In a nutshell

  1. 3 sprites for player (Upper, Lower, Hitbox)
  2. Each frame in Upper sprite has an extra point for bullet spawning (named “Gun”)
  3. The first shot in a different direction from current direction is spawned at the old frame’s “Gun” point
  4. It seems like upper sprite frame update is done after bullet generation when it should be the opposite
  5. But the order of the actions are in the intended order (See Image)

After some experiments with someone else on discord, we came to a conclusion that this is an engine bug.

Not an expert, and while I’d agree it was a bug, have you tried adding your events that you need to happen in order as subevents with no conditions?

i.e:

  • Condition: The timer “firerate” of Hitbox is greater than 12*Timedelta Seconds () || Event: Create object PlayerShot at position
  • Sub Event (No condition) || Do = 7 to the number
  • Sub-Sub event (No condition || Add to PLayershot a permanent force

etc?

No good. The exact same situation occurs.

Sorry that didn’t help. It was worth a shot. :frowning:

I move this to the other category.
Trying to isolate the problem in a simple project, yours is currently complicated with a lot of inversion, I think the main problem comes from here.

When the problem is properly isolated I will move it to bugs.

Just thought of an workaround for my problem.
IJKL will be considered as fire buttons & decide shot direction rather than ‘shoot in a specific direction’.
That is:

  1. Set conditions for each of 8 directions to set the upper sprite
  2. Set ‘Any of IJKL pressed’ condition to make the player fire in the direction of the upper sprite

I’ll test this out soon, but someone should try isolating the original problem.

(File removed due to the same reason as above)

No good. Still running into same issues.

What about cheating through math?

Set a global or object variable of “ShootDirection”
For events:
Have an event where “if IJKL is not pressed” set “ShootDirection” = 0"
Then have
“If I is pressed | set “ShootDirection” + 1”
“If I is released | set “ShootDirection” - 1”
(Run once on everything, obviously)
Then repeat for JKL using prime numbers that are separated far enough apart, (3, 7, 19, etc)

Then you set up your firing actions to be based off Shoot Direction
“If ShootDirection = 1 | Fire Up”
“If ShootDirection = 3 | Fire Left”
“If ShootDirection = 4 | Fire UpLeft”

etc?

I don’t think that would solve the spawn point issue, but I’ll try.

(structure below)
I - 8
J - 4
K - 2
L - 1

→ - 1, 11
:arrow_lower_right:︎ - 3
↓ - 2, 7
:arrow_lower_left:︎ - 6
← - 4, 14
:arrow_upper_left:︎ - 12
↑ - 8, 13
:arrow_upper_right:︎ - 9

I think since you’re having your animations/actions happen based off the variable matching a specific value (rather than a certain combination of events/inverted events), you should have more control over the ordering, I think.

Still no good.
I’ll just simply consider this as a bug and isolate it.

1 Like