Question in title. I love coding custom Lua scenarios, and I was thinking about improving the player experience by allowing them to change variables in my scenarios. For example, I want the player to enable or disable the tracking beacons in my Catch Them All scenarios. I've been trying to wrap my head around methods I can use to do this. Here's what I have in my WIP test scenario: The player can drive into the race markers to switch the scenario between Race and Chase modes. It works great (and it's quite fun), but I feel that it's too clunky to use in a proper scenario. I've also been reading up on input actions, but I can't figure them out; I had no success in getting key presses to change anything in my scenario. I would like to use this idea, though. Perhaps I could make a little UI app, but I've never done that before. I could try. Thoughts?
I guess I'm answering my own thread. Here's a nifty way to do it! be:getPlayerVehicle(0):queueLuaCommand("obj:queueGameEngineLua('eventHorn = ('..electrics.values.horn..')')") if eventHorn == 1 then core_environment.setTimeOfDay({time = 0.5})end This creates a global variable called "eventHorn" with a value of 0 (horn off) or 1 (horn on). You can use this in an onRaceTick() function. In this case, honk your horn to change the time of day in the scenario. You can make it do whatever you want. I think that headlights and blinkers can also be used for pseudo options. Clever, eh?
Hmm, that jolts my memory about this, maybe you can find some use for this? https://wiki.beamng.com/Modding_input_bindings
I tried that before, I couldn't figure it out. But maybe I was feeling dumb, I'll play around with it soon.