Can't use keycode from dictionaries in a trigger

Bugs will be moved here once resolved.

Post » Mon Feb 06, 2017 2:16 pm

Problem Description
Trying to use a "on key pressed" trigger with a dictionary key won't work.

Attach a Capx
https://www.dropbox.com/s/1t2vnfnzu54fb ... .capx?dl=0

Description of Capx
Adds a new key to the dictionary with the keycode string "88" (for "X"), then waits for it to be pressed to the player can jump.

Steps to Reproduce Bug
  • Try to trigger player input from a dictionary key

Observed Result
Nothing happens

Expected Result
The player should jump if the user pressed the X key

Notes
It works just fine if you use "if key code is down", but not if you use "if key code is pressed".

Operating System and Service Pack
Windows 10

Construct 2 Version ID
beta r242
B
125
S
43
G
41
Posts: 849
Reputation: 28,260

Post » Mon Feb 06, 2017 2:30 pm

use int(Dictionary.Get("jump"))

Or add a number, not a string, to the dictionary.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Mon Feb 06, 2017 2:41 pm

99Instances2Go wrote:use int(Dictionary.Get("jump"))

Or add a number, not a string, to the dictionary.


Doh, that works. Thanks!
B
125
S
43
G
41
Posts: 849
Reputation: 28,260


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests