To all you scripters out there having issuse with the TriggerAddEventKeyPressed() script to create WASD style movement I have a possible solution.
The Issue: WASD movement relys on the EventKeyPressed event. This event allows for the input from any player and thusly, queries the server every step for every concievable key press.
I tried to write my own event that skips the server part of it... but I dont' have enough access to the API to get at necessary functionality...
(I tried faking the even call with a default value of Player1, but couldn't get that to work as well as attempting to write an overloaded function for the event with my own list of parameters, but don't have enough access to do that...)
So... I resided myself to accept a workaround.
What I have done is instead of using the KeyPressed() event, I have attempted to affix a unit's movement to the "Camera - Player 1 moves the camera for Key Scroll Reason"
Issues I am having...
You can't lock the camera if you are going to do this...
you cannot lock the camera to mouse movement. but my application doesn't require it to be locked (I'm not doing a TPS)
Also need to rebind the arrowkeys to the wasd for viewport movement.
I still need to find a way to restrict the camera movement so that it cannot stray more than a few pixles from the player... I'm trying to dig through the API, but cannot find a "Set key pan speed" type variable...
I've thought of writing a script to over ride it (not C# override) but have a feeling that will generate some jumpy camera movement.
Just a thought. Working on a bunch of things, and not really focusing on this but I'll let you know if I have any further progress.
Hope this helps someone.
To all you scripters out there having issuse with the TriggerAddEventKeyPressed() script to create WASD style movement I have a possible solution.
The Issue: WASD movement relys on the EventKeyPressed event. This event allows for the input from any player and thusly, queries the server every step for every concievable key press.
I tried to write my own event that skips the server part of it... but I dont' have enough access to the API to get at necessary functionality... (I tried faking the even call with a default value of Player1, but couldn't get that to work as well as attempting to write an overloaded function for the event with my own list of parameters, but don't have enough access to do that...)
So... I resided myself to accept a workaround. What I have done is instead of using the KeyPressed() event, I have attempted to affix a unit's movement to the "Camera - Player 1 moves the camera for Key Scroll Reason" Issues I am having... You can't lock the camera if you are going to do this... you cannot lock the camera to mouse movement. but my application doesn't require it to be locked (I'm not doing a TPS) Also need to rebind the arrowkeys to the wasd for viewport movement.
I still need to find a way to restrict the camera movement so that it cannot stray more than a few pixles from the player... I'm trying to dig through the API, but cannot find a "Set key pan speed" type variable... I've thought of writing a script to over ride it (not C# override) but have a feeling that will generate some jumpy camera movement.
Just a thought. Working on a bunch of things, and not really focusing on this but I'll let you know if I have any further progress. Hope this helps someone.
So, how will this work in reality actually ? I mean how will it look ?
Camera will be locked to a unit or ? Since you are moving it using WASD... or ?