Muche Posted January 12, 2016 Share Posted January 12, 2016 (edited) Ice Flingomatic's machine component allows right click actions Turn on/Turn off. My mod adds another right-click action via other component, with lower priority, so Turn on/Turn off is still the default. Is is somehow possible to select other action than the default one? Edited January 12, 2016 by Muche Link to comment Share on other sites More sharing options...
DarkXero Posted January 13, 2016 Share Posted January 13, 2016 @Muche, well, you can make your action a left click one.So you get your action, the right click action turn on/off, and the examine action when pressing alt. One way is, we make your component have higher priority than the machine one, but require an extra tag. First, give your action higher priority.Then, make your component action insert the action if the player has the "_extra" tag. Then, in modmain, we allow people to toggle the tag.local function ToggleExtra(player) if player:HasTag("_extra") then player:RemoveTag("_extra") else player:AddTag("_extra") endendAddModRPCHandler(modname, "ToggleFlingo", ToggleExtra)AddSimPostInit(function() if not GLOBAL.TheNet:IsDedicated() then GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_H, function() SendModRPCToServer(MOD_RPC[modname]["ToggleFlingo"]) end) endend)By having them send RPCs to the server to tell it to toggle the tag on them. I picked the H key for this. Link to comment Share on other sites More sharing options...
Muche Posted January 13, 2016 Author Share Posted January 13, 2016 Thanks, I'll try the second approach. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now