How do I Fix/end this loop?

Get help using Construct 2

Post » Thu Sep 24, 2015 5:23 pm

I want to make a "Dynamic menu" Gmod style. I want the items in the game to add themselves into the spawn menu. I have made a system to spawn the backdrop of the items based on a global variable, this is the system that i cannot get working. Part of the system is within the player\items\TARDIS group the rest is outside of any group. (Yes this a clone, I do not plan on releasing it.)

EDIT: I forgot to say what the problem is... If you run the preview in debug mode you will see that the Spawnicon object keeps spawning in the same locations eventually lagging the game down.

I am quite new to construct and game making in general so the solution might be obvious.
Here is the .capx file: https://www.dropbox.com/s/4764j7sf1udbl ... .capx?dl=0

Thanks for help! :D
B
8
S
2
Posts: 24
Reputation: 536

Post » Fri Sep 25, 2015 12:34 am

The problem is with this event:
Image

At every loop of the program, you create 3 <SpawnIcon>.
B
15
S
6
Posts: 105
Reputation: 1,356

Post » Fri Sep 25, 2015 1:16 am

Hey there!

I see that you're trying to limit the loop the the Numberofitems variable. I moved the spawn item portion to your "q" keyboard event and made some changes. It should work for you now.

https://www.dropbox.com/s/dq4nzhphtczld ... .capx?dl=0
B
69
S
40
G
24
Posts: 356
Reputation: 18,314

Post » Fri Sep 25, 2015 2:04 pm

ultrafop wrote:Hey there!

I see that you're trying to limit the loop the the Numberofitems variable. I moved the spawn item portion to your "q" keyboard event and made some changes. It should work for you now.

https://www.dropbox.com/s/dq4nzhphtczld ... .capx?dl=0


Thank you very much this fixed my problems. :D
I love seeing such a friendly community.
B
8
S
2
Posts: 24
Reputation: 536

Post » Fri Sep 25, 2015 3:20 pm

My pleasure. Good luck with your project!
B
69
S
40
G
24
Posts: 356
Reputation: 18,314


Return to How do I....?

Who is online

Users browsing this forum: jezjones24, minigame, semaso, Yahoo [Bot] and 6 guests