For the next version, we have implemented a subtle yet very powerful feature that I hope the modding community will have a lot of fun with. Extra, custom Pie-Menu options can now be defined for any Actor or HeldDevice, so that a Lua script is run each time that option is activated by the player in-game.
The custom options will show up only when an Actor of a Preset with them defined is selected, or he’s holding a device that itself has extra options defined. The options’ icons can also be of custom size and design. As an example, can you figure out what this modded Actor’s extra Pie-Menu option will do??: (it’s not what you see to the right)
In MyMod.rte/Robots/Robots.ini:
AddActor = AHuman
CopyOf = Robot 1
PresetName = Suicidal Robot
AddPieSlice = Slice
Description = Detonate Limb
Direction = 2
Icon = Icon
CopyOf = MyCoolIcon
ScriptPath = MyMod.rte/Scripts/Dismember.lua
FunctionName = Dismember
in MyMod.rte/Scripts/Dismember.lua:
function Dismember(actor)
humanoid = ToAHuman(actor);
if humanoid then
if humanoid.EquippedItem then
humanoid:ReloadFirearm();
elseif humanoid.FGLeg then
humanoid.FGLeg:GibThis();
elseif humanoid.BGLeg then
humanoid.BGLeg:GibThis();
elseif humanoid.FGArm then
humanoid.FGArm:GibThis();
elseif humanoid.BGArm then
humanoid.BGArm:GibThis();
else
humanoid.Head:GibThis();
end
end
end
This new modding feature effectively connects the entire Lua scripting interface and all its modding opportunities to the real-time gameplay presented to the player. Custom firing modes of weapons, explosive self-destruction of Actors, mission-specific commands.. you name it; pretty much anything is possible!
You can follow any responses to this entry through the RSS 2.0 feed.
Both comments and pings are currently closed.
Can the default unit AI be changed? Replacing “deliver and return” with custom rocket/dropship behavior, for example?
The hardcoded pie-menu options can’t be changed, but the AI behavior can, since the hardcoded c++ implementations are now able to be overridden with Lua AI update routines! We have made good progress on porting the hardcoded versions to Lua so they’ll be exposed for you to change as you wish in B25 😀
I see attachables are very much there for Lua, too.
Keep it up with the Devlog updates, makes it seem 200% less like the game is dying! 😛
Oh my god.
I simply cannot wait for B25.
Keep up the good work, guys.
YESSSS! SO MANY POSSIBILITIES OPEN! BWAHAHAHAHA!!!
(yeah, caps, heh)
That’s cool and all, but PLEASE let us map pie menu options to keyboard shortcuts as well.
How,Footkerchief? Perhaps with a button you press when a certain function is highlighted and then you press another button to bind it.
the problem with binding arbitrary things to keyboard keys is that it breaks down when other controllers are used, like gamepads. We try to make the game fully playable on any supported device, because having the keyboard player able to do special things isn’t fair in, for example, a 4-player game with one kb player and others using gamepads!
Holy crap an update!!!!!! Great to see it’s still being worked on. Maybe I should check out the community again…..
Hooray! AI Routines!
Excellent!
Nice. Good to see progress!
Also awesome to see further support of 4-player gamepad shenanigans. This is one of the very best kinds of shenanigans.
Ooh! I think I’m going to have to do some updartz for the Emporeans now, finally get that mod up to finished quality or somesuch.
Hmm, what about making several hotkeys for each players (which would be defined in options), and then bind any action from pie menu to these hotkeys? It could be done right in the middle of game. Something like skills in MMORPGs, you know.