Community Forum

Example of registerActionEvent?

Forum Overview >> Scripting

CategoryScripting
Created15.12.2018 17:08


Daniel Dahlberg (Unknown) 15.12.2018 17:08
Hello,

I'm trying to get InputBinding.registerActionEvent to work.
Does anyone have an working example of it?
At the moment I have an action added to the game but I'm trying to figure out how to fire a function when my assigned keys are pressed.

https://gdn.giants-software.com/documentation_scripting_fs19.php?version=script&category=1&class=7052#registerActionEvent118548

Kind Regards
Haverdaden

Joachim Damm (jodamm) 16.12.2018 02:45
Hi,
it depends for what you need the action event. Vehicles have the onRegisterActionEvents and the rideable specialization ia a good starting point : https://gdn.giants-software.com/documentation_scripting_fs19.php?version=script&category=70&class=7302#onRegisterActionEvents120704

If you need a key for the player like the flashlight then there is a table inputInformation.registrationList you can find here : https://gdn.giants-software.com/documentation_scripting_fs19.php?version=script&category=102&class=7134#new119331

I have written an example mod to demonstrate some key bindings, but it was written before the documentation was released, so it is not the ideal way of doing it. http://sunxi.das-eckchen.de/FS19_exampleMod.zip



Note: Log in to post. Create a new account here.