Mouse and Keyboard event read value from variable.

Hi.

Would be great if the Mouse press and Keyboard press events could read and use text from string variable or\and scan code from integer variable :unamused:

They already can do from text variable, I’m not sure which name of event it was, but I’m sure it is there, 4ian even wrote about it sometime recently.

In this case it must be a bug (or I miss something again) :confused:

In that case if it should work I have uploaded an example.
docs.google.com/file/d/0B1sXiYO … sp=sharing
I try to read the value from the string (text) global variable in all ways I can imagine but nothing works.
If you press w the tank should move forward but it doesn’t.

Just noticed that,I can’t even get object events to work with variables,like create,delete object.
So,if it a missing feature then,it also would be good if the object events could read and use value of variables too :wink:

EDIT: Sound and Music events too :laughing:

Maybe your installation of Game Develop got somewhat broken? Tried reinstalling it cleanly (first use uninstaller then install again)?

Hi

I don’t think that,anything is broken, I’m using the archived version not the installer.I have downloaded again the archived version,and tried it just now.
I got the same results.I can’t use variables to test key press,play music\sound or to create\delete object because it looks like these events can’t read and use variables. They can “read” only the actual name typed in of key,sound file and object :frowning:
Or maybe I do wrong something but I don’t know what.
Are you sure about that it is possible to use variables?

You can’t and ( and will never be able ) to use variables or a string expression for an object parameter ( For performance sake, security, and to avoid developers to misuses Game Develop, making events unreadable… ).
But there is already an action called “Create object from its name” and “Key is pressed ( Text expression )” which takes a string expression as argument, so you can generate the object name or the name of the key from a variable for example. :slight_smile:

I’m sorry to hear that :cry:
But at least that would be great if key press event could read keycodes from an integer variable.

Unfortunately I’m not sure how to generate “text expression” or “object name” out of variable :blush:
I don’t even know how “text expression” and “create from it name” could help me,because if I enter the “name” of object,doesn’t work,if I enter “w” as text expression,that works exactly as key press without expression. :confused:
All I can do with variables other than test and change it value,is to write the value out of variable in to a file and read the value from file back in to variable.

I would appreciate some help with that how to generate (use) a text expression and object name out of variable because I have no idea.
A simple example would do or short explanation :unamused: