nepetaleijontheoneandonly Posted April 22, 2015 Share Posted April 22, 2015 So, I want my character to be able to "telepoof" (but it won't be called that, it'd be called "glitch") without holding the lazy explorer or even having it in her inventory. It'd just be a thing she'd be able to do on her own, at the cost of 10 sanity, and when her sanity got too low, she'd start occasionally doing it at random, like willow's low sanity fires. Can someone give me some help? (I sure do hope I'm posting this in the right place) Link to comment https://forums.kleientertainment.com/forums/topic/53048-need-help-with-teleportation-powers/ Share on other sites More sharing options...
Mobbstar Posted April 22, 2015 Share Posted April 22, 2015 First off, gameplay concerns: Will this override walking, or be a right-click action? Secondly, you need to define the Action and somehow tell the game using a component, that the action can be performed at all times (if playing that character) (don't ask me why the player can't declare that themselves). Or override walking and skip the component stuff. It seems reasonable to copy most of the action data from the blink action. Keep in mind to set the priority low enough, or else it will prevent other things. Here's how to make an action in modmain:--This action will be remote detonating explosives (I've made this for a character mod)ACTIONS.DETONATE = GLOBAL.Action(2,true) -- "2" is the priority, set this VERY low, "true" is whether the action is instant or requires a stategraph handle (I assume your action doesn't need an animation before firing? Then keep it true), adding another "true" makes it Right-Click, the last argument would be the most distance (4 = a ground tile)(keep in mind you need to have "true" or "false" in the third field when setting the distance)ACTIONS.DETONATE.str = "Detonate" --This is the name displayedACTIONS.DETONATE.id = "DETONATE" --this is odd, but necessary, just repeat the capitalized nameACTIONS.DETONATE.fn = function(act) --this is the function that fires when "acted" --your stuff here (look up the blink action from actions.lua?)end Link to comment https://forums.kleientertainment.com/forums/topic/53048-need-help-with-teleportation-powers/#findComment-631209 Share on other sites More sharing options...
nepetaleijontheoneandonly Posted April 24, 2015 Author Share Posted April 24, 2015 First off, gameplay concerns: Will this override walking, or be a right-click action? Secondly, you need to define the Action and somehow tell the game using a component, that the action can be performed at all times (if playing that character) (don't ask me why the player can't declare that themselves). Or override walking and skip the component stuff. It seems reasonable to copy most of the action data from the blink action. Keep in mind to set the priority low enough, or else it will prevent other things. Here's how to make an action in modmain:--This action will be remote detonating explosives (I've made this for a character mod)ACTIONS.DETONATE = GLOBAL.Action(2,true) -- "2" is the priority, set this VERY low, "true" is whether the action is instant or requires a stategraph handle (I assume your action doesn't need an animation before firing? Then keep it true), adding another "true" makes it Right-Click, the last argument would be the most distance (4 = a ground tile)(keep in mind you need to have "true" or "false" in the third field when setting the distance)ACTIONS.DETONATE.str = "Detonate" --This is the name displayedACTIONS.DETONATE.id = "DETONATE" --this is odd, but necessary, just repeat the capitalized nameACTIONS.DETONATE.fn = function(act) --this is the function that fires when "acted" --your stuff here (look up the blink action from actions.lua?)endThanks for the help! Though the Blink action doesn't seem to work, I'm gonna try some code from the blinkstaff.lua itself -And yes, it's a right click action -Wish me luck! Link to comment https://forums.kleientertainment.com/forums/topic/53048-need-help-with-teleportation-powers/#findComment-631666 Share on other sites More sharing options...
Seiai Posted April 25, 2015 Share Posted April 25, 2015 @nepetaleijontheoneandonlyu could also use hotkeys, put this in your modmain: GLOBAL.TheInput:AddKeyDownHandler(GLOBAL.KEY_R, function()local player = GLOBAL.GetPlayer()if player and player.prefab=="yourcharactersprefabname" thenlocal TheInput = GLOBAL.TheInputif not GLOBAL.IsPaused() and not TheInput:IsKeyDown(GLOBAL.KEY_CTRL) and not TheInput:IsKeyDown(GLOBAL.KEY_SHIFT) then--here comes the stuff u want to happen when u press Rend end end end) Link to comment https://forums.kleientertainment.com/forums/topic/53048-need-help-with-teleportation-powers/#findComment-632127 Share on other sites More sharing options...
Aphid98 Posted May 11, 2015 Share Posted May 11, 2015 Hmmmm... I can't help but seem to remember a character from a movie that could do that... Jk, Upload to workshop pls I will want to play this mod Link to comment https://forums.kleientertainment.com/forums/topic/53048-need-help-with-teleportation-powers/#findComment-636637 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.