How do I reload a gun with time

Get help using Construct 2

Post » Thu Mar 09, 2017 5:35 pm

Hi guys!

I have a game of Zombies in contruct 2, yes i'm very creative, i developed a gun system that shoot when you have bullets in your gun. In case o you don't have a bullets in you gun the system subtract eight bullets to yout bullets and put eight bullets in your gun. The problem is that i cant put time when reload.

Image

Please help me, this problem is breaking my head.

Regards!
B
3
Posts: 3
Reputation: 181

Post » Thu Mar 09, 2017 7:35 pm

@Immodium

Try adding the System: Wait 1 seconds action to Event 20, that should delay the sub-events 21 and 22 from firing and doing the reload.
Find all the Construct 2 games that were on Steam Greenlight here
B
36
S
10
G
7
Posts: 480
Reputation: 7,025

Post » Thu Mar 09, 2017 10:31 pm

Or add a Timer behavior to the gun (or any related object).
Start the timer when the reload is initiated.
When the timer is finished, the reload is finished.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Fri Mar 10, 2017 12:16 pm

I can't see your whole event sheet. Make it smaller.

It looks like you are resetting your check variable to zero in your reload event so it will never reload.
Banned User
B
28
S
7
G
58
Posts: 1,229
Reputation: 34,830

Post » Fri Mar 10, 2017 3:09 pm

Message: Immodium can only post plain text URLS until they have 500 rep. 4 URLS modified. Why?
Thanks for replies!

I can't solve this. I tried to use te Wait but dont work. When bullets in the shotgun are equal to zero, Load all the bullets equipped. When should load only eight.

The example: http://yamilpruebas.hol.es/MataZombies/Wait/

The eventsheet: http://yamilpruebas.hol.es/MataZombies/Wait/imagenmuestra.png

Image

I never use the behavior Timer was i tried this.

Image

http://yamilpruebas.hol.es/MataZombies/Timer/imagenmuestra.png

But this didn't work. The expample: http://yamilpruebas.hol.es/MataZombies/Timer/
I don't know what to do. I was thinking of putting the load event when shooting, but look bad.

Sorry for my bad english :(
B
3
Posts: 3
Reputation: 181

Post » Fri Mar 10, 2017 3:19 pm

Well, unless you have some other events where CargaEscopeta is being reduced that will never work.

You have it set to 8 in the global variable and I do not see anywhere where you are reducing that number so your time event will never happen because it is looking for that variable to = 0
Banned User
B
28
S
7
G
58
Posts: 1,229
Reputation: 34,830

Post » Sat Mar 11, 2017 12:02 am

Message: Immodium can only post plain text URLS until they have 500 rep. 3 URLS modified. Why?
lamar wrote:Well, unless you have some other events where CargaEscopeta is being reduced that will never work.

You have it set to 8 in the global variable and I do not see anywhere where you are reducing that number so your time event will never happen because it is looking for that variable to = 0


When i remove the events (timer,wait,etc) it works

The example: http://yamilpruebas.hol.es/MataZombies/Funcionando/
(using the wheel to down you can change the gun)


The event sheet


http://yamilpruebas.hol.es/MataZombies/ ... ando/1.png

Image

http://yamilpruebas.hol.es/MataZombies/ ... ando/2.png

Image
B
3
Posts: 3
Reputation: 181


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 29 guests