Keyboard and Gamepad problems - Shooting

Discussion and feedback on Construct 2

Post » Sat Feb 14, 2015 12:31 am

Hey guys,

So I have this really, really bizarre problem.

I have an OR event, On Key Pressed "OR" On Gamepad Key Pressed - spawn object at image point.

Here's the thing, if I trigger the event with the keyboard, the object is spawned ahead of the image point, if I use the gamepad, the object is spawned at the image point.


Any reason this would happen?
Last edited by Nesteris on Sat Feb 14, 2015 2:19 pm, edited 1 time in total.
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Mon Feb 16, 2015 4:04 am

Never observed that ( doesn't mean it didn't happen ), but I'd guess it might have something to do with latency compensation.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
91
S
30
G
22
Posts: 1,985
Reputation: 20,149

Post » Mon Feb 16, 2015 7:25 am

Can't think what would cause this, but I'd be very interested to see it in action. Could you share a capx?
B
57
S
15
G
11
Posts: 912
Reputation: 12,626

Post » Mon Feb 16, 2015 12:53 pm

I can't share the .capx because it's my full game, but I can put a link to download an outdated exported NW.js version.

https://drive.google.com/file/d/0B0gW1A ... sp=sharing
https://drive.google.com/file/d/0B0gW1A ... sp=sharing

Anyone of these should do, I think.
(FYI, the font isn't pixel because I'm using a custom font and I used text boxes instead of spritefont, I tried a program that was

Basically, when you shoot using the controller, it spawns at the image point properly, when you run however, the spawns a little behind the image point.

When you shoot using the keyboard, it shoots ahead of the image point, and never changes its spawn point relative to the character, so there's no spawning behind where it normally would while running like the controller version does.


The sad thing is, I can't reproduce this so Ashley won't really give a y'know what. (Kind of impossible to distil 374 events into less than 40).

I've tried a number of possible solutions, like deleting the object that's supposed to spawn in Construct 2 and replacing it with another made from scratch, doing the same with the object that spawns it.

I tried a unique fix that worked for me before when events weren't working properly which was to delete the object and events, recreate it, and then recreate it's events all from scratch, which didn't work.

I ended up settling for making a separate event tree specifically for the keyboard firing, which used a different image point about 8 pixels behind the proper image point (this is on a 256x224 in-game screen, so it's pretty huge visual difference) and now it spawns nearly at the exact same spot when you're not moving, otherwise the gamepad shots spawn behind where they're supposed to. The only problem with this is that now the keyboard shots have slightly reduced range, by the difference in distance from the two image points, so the gamepad shots go further than the keyboard shots (until you get Long Beam, then this becomes a moot point).

I thought this might be due to JavaScript being a garbage collecting language as I think Ashley(?) put it, also I heard that C2 writes using JavaScript, so yeah.


Also, I tried disabling literally all my events except for the events needed to shoot to try to confirm what is triggering the bug and it still appears even with everything else turned off. Still appeared even after doing the same thing with a new set of events after deleting the old ones.
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Mon Feb 16, 2015 1:36 pm

C2 is buggy!
On a layer below i have objects. I spawn bullets above but the bullets fly below these objects. Shooting with mouse.
Playable games:
http://jamesxxxyz.newgrounds.com/
Newest: Blue and red arrows
Latest update: Blue and red arrows

What you want in C3?
viewtopic.php?f=146&t=122050

Youtube: https://www.youtube.com/channel/UCLE7Ml ... /playlists
B
11
S
4
Posts: 281
Reputation: 1,543


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 14 guests