-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update transporters to be more effective with the area load command. #1946
base: master
Are you sure you want to change the base?
Conversation
What about the other hardcoded behaviours (e.g. set altitude to target unit height, what if I'd rather the unit was beamed up via tractor beams like an UFO?) spring/rts/Sim/Units/CommandAI/MobileCAI.h Lines 112 to 113 in b4240c3
|
Those values are only used as inputs in the Lua callback |
They aren't, they are completely lost in a bunch of steps. First the raw values most useful for games (heading diff, distance) aren't passed anywhere, they are only used to produce the "is above arbitrary threshold" bools. spring/rts/Sim/Units/CommandAI/MobileCAI.cpp Lines 1408 to 1410 in b4240c3
The bools aren't ever used separately, they are ANDed together into a single bool. spring/rts/Sim/Units/CommandAI/MobileCAI.cpp Line 1412 in b4240c3
That bool is passed to the C++ side of the callin (called spring/rts/Lua/LuaHandleSynced.cpp Lines 864 to 879 in b4240c3
So Lua does not actually receive any of those. It would be nice if it received
The boolean check(s) are used as the default, in case Lua does not return anything. So they must stay, at least for now. But indeed they aren't used if Lua returns something, so I now think it's fine if they are arbitrarily hardcoded since Lua can just return something if it doesn't like them. The game can do nothing about the other behaviours though (set altitude, set wanted rotation etc) so there would ideally be a way to opt out of those. |
Thanks for the clarification that the Lua event handler doesn't push the How is the |
This is only the default if there is no C++ side event client. If there are event clients, any of them returning spring/rts/System/EventHandler.cpp Lines 214 to 219 in b4240c3
The C++ side of spring/rts/Lua/LuaHandleSynced.cpp Lines 881 to 884 in b4240c3
|
Gotcha. |
In that case I'll leave it for now. |
Having thought about it, the PR is basically acceptable already, perhaps except it would be nice to name the new unit def tag something futureproof like |
Adds a unitDef to allow transporters to pick up units without trying to turn to face the same heading.
Fixes #1945