Problem Description
____ Any time I put a keyboard event inside a for loop it creates a error and no longer functions, I get a stack trace error.____
Attach a Capx
https://drive.google.com/file/d/0B3nfY4x9Y0kueHZjcEsxV2toMEU/view?usp=sharing
Description of Capx
This Capx demonstraights the problem I am having as the capx I was working with and discovered this problem with isn't as simple but the problem boils down to this simple demonstration.
In the project I discovered this I am going into a for loop because I am accessing and storing key code values and gamepad indexs into a 3d array. x = device type(has different events for each device type, this is where the step 3 would be in recreation), y = buttonid/keycode, and z = player/gamepadindex. It saves those values and loads them correctly too. In a seperate event sheet it loads the saved values into the array again, then tests if the button codes are pressed and shoots out functions, again with a for loop, with keyboard events. I was making this as a custom controls template to save time on doing it. But ran into this problem while trying to simplify the project down to as few events as possible. Logically it should work, and does with the gamepad, just not the keyboard.
I didn't feel it was necessary to upload a 60 event capx if the issue is so small, but breaking literally everything I had planed, this is not flawed logic in retrospect as the issue works perfectly fine with a gamepad, and prior to me having it simplified as such. (it was at 104 events prior to setting up for loops)
Steps to Reproduce Bug
- Step 1 insert a for loop, have the index start at 0, name the index something. Keep end 10 if want
- Step 2 insert a global varible have it be any number between 0 & 10 but not 0 or 10
- Step 3 Create a event that compares the global varible to the loopindex("name"), make sure this is inside the for loop.
- Step 4 insert the keyboard object into the project, and insert a On Key Pressed, set it to any key such as A, make sure the event inside of the step3's event
- Step 5 insert a text object on to the scene
- Step 6 insert a action inside of step 4's On Key Pressed that changes step 5's text object's text
Observed Result
____ What happens? ____
A stack error occurs, and the events and actions are ignored.
Expected Result
____ What do you expect to happen? ____
I expect it to not go into a stack error and allow the action of text to change.
Affected Browsers
- Chrome: YES
- FireFox: YES
- Internet Explorer: YES
Operating System and Service Pack
____ Your operating system and service pack ____
Windows 8.1 Pro 64bit
Construct 2 Version ID
____ Exact version ID of Construct 2 you're using ____
Release 184(64bit)
built at : 15:42:21 October 9 2014