DarkXero Posted May 4, 2015 Share Posted May 4, 2015 Then you want to attach the line to the function that gets run when the teleport thing is used.And pass a parameter to make caster equal the player entity that is using the thing. I can't really know unless I know what thing is that teleport thing. Link to comment Share on other sites More sharing options...
Fredson Posted May 4, 2015 Author Share Posted May 4, 2015 (edited) im trying to make rasmus teleport on right click, but i was trying in it in an item, also trying to make hounds dont attack ted when his mask is on Edited May 4, 2015 by Fredson Link to comment Share on other sites More sharing options...
DarkXero Posted May 4, 2015 Share Posted May 4, 2015 (edited) Well, there are many ways to blink. The difficult part here is that rasmus is not an equippable item.So we have to tie the action to the character when he has certain properties.Pretty much like how Woodie gains the gnaw action on werebeaver transformation. I'm going to abuse the fact that an item with the blinkstaff component exists. The Ted thing is easy.-- for Tedinst:AddTag("houndfriend")-- for Richardinst:RemoveTag("houndfriend")Rasmus is tricky, we are going to use the blink of the staff, so your sanity line won't be needed.-- for Rasmusinst:DoTaskInTime(0, function() local self = inst.components.playeractionpicker self.rightclickoverride = function(inst, target, position) local actions = {} if not target and position then table.insert(actions, ACTIONS.RASMUSFLY) end return self:SortActionList(actions, position) endend)-- for Richardinst:DoTaskInTime(0, function() local self = inst.components.playeractionpicker self.rightclickoverride = nilend)Now, we added the RASMUSFLY action for the player when he becomes rasmus, like when Woodie becomes werebeaver.What is RASMUSFLY? In modmain:local RASMUSFLY = AddAction("RASMUSFLY", "Poof here", function(act) local faketele = GLOBAL.SpawnPrefab("orangestaff") act.doer.AnimState:PlayAnimation("jump_pre") act.doer.AnimState:PushAnimation("jump", false) act.doer:DoTaskInTime(19 * GLOBAL.FRAMES, function() faketele.components.blinkstaff:Blink(act.pos, act.doer) faketele:Remove() act.doer.AnimState:PlayAnimation("jumpout") end) return trueend)RASMUSFLY.instant = trueI spawn a dummy orange staff, and use its blinkstaff properties to teleport.I also use the wormhole animations to make a cool disappearance act. I saw the item you were talking about.The remote control of the deadpool mod, right?The sanity line goes insideinst.components.blinkstaff.onblinkfn = function(item, position, caster) -- Here goes the line, reducing the caster sanityend Edited May 4, 2015 by DarkXero Link to comment Share on other sites More sharing options...
Fredson Posted May 4, 2015 Author Share Posted May 4, 2015 so it will spawn the staff for he to use or it just like a replacement ? and yes it was the deadpool teleport device, i got it working ) now im working his dynamite and in the masks Link to comment Share on other sites More sharing options...
DarkXero Posted May 4, 2015 Share Posted May 4, 2015 It will a spawn in an undefined place in the world.You won't see it, because it will have no position in its Transform.It will simply exist. I only want to make use of its component. Link to comment Share on other sites More sharing options...
Fredson Posted May 4, 2015 Author Share Posted May 4, 2015 okok ill see it Link to comment Share on other sites More sharing options...
Fredson Posted May 4, 2015 Author Share Posted May 4, 2015 ok here's rasmus codeif mask == "rasmus" then -- normal stats overriden inst.components.health.maxhealth = 100 inst.components.health:DoDelta(0) inst.components.hunger.max = 100 inst.components.hunger:DoDelta(0) inst.components.sanity.max = 100 inst.components.sanity:DoDelta(0) inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.1) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.1) inst.components.combat.damagemultiplier = 1.0 inst.components.combat.defaultdamage = 10 -- special mask stats that must be overriden when normalizing inst.rasmus = true inst:ListenForEvent("killed", onkilled)where should i put the inst:DoTaskInTime(0, function() ive already added rasmusfly to the modmain.lua Link to comment Share on other sites More sharing options...
DarkXero Posted May 4, 2015 Share Posted May 4, 2015 Under the inst:ListenForEvent. Link to comment Share on other sites More sharing options...
Fredson Posted May 4, 2015 Author Share Posted May 4, 2015 when i add inst:DoTaskInTime(0, function() it joins all the lines and cause a crash Link to comment Share on other sites More sharing options...
Fredson Posted May 4, 2015 Author Share Posted May 4, 2015 and also cause crash on richard line Link to comment Share on other sites More sharing options...
DarkXero Posted May 4, 2015 Share Posted May 4, 2015 Upload the maskswitch.lua component with the error. Link to comment Share on other sites More sharing options...
Fredson Posted May 4, 2015 Author Share Posted May 4, 2015 hereerror: error loading module 'components/maskswitch' from file '..\mods\Jacket\scripts\components/maskswitch.lua':[string "cannot OLDFILEACCESSMETHOD @..\mods\Jacket\scripts\components/m..."]:102: ')' expected (to close '(' at line 90) near 'local'maskswitch.lua Link to comment Share on other sites More sharing options...
DarkXero Posted May 4, 2015 Share Posted May 4, 2015 There.maskswitch.lua Link to comment Share on other sites More sharing options...
Fredson Posted May 4, 2015 Author Share Posted May 4, 2015 oh i see my error was i didnt added the ")" (sorry im a begginer at lua) Link to comment Share on other sites More sharing options...
Fredson Posted May 10, 2015 Author Share Posted May 10, 2015 hey dark:), people that arent host can teleport too with rasmus ? Link to comment Share on other sites More sharing options...
DarkXero Posted May 10, 2015 Share Posted May 10, 2015 @Fredson, I saw the steam comment, I will look into it. Link to comment Share on other sites More sharing options...
DarkXero Posted May 10, 2015 Share Posted May 10, 2015 @Fredson, this should do it.Jacket.zip Link to comment Share on other sites More sharing options...
Fredson Posted May 14, 2015 Author Share Posted May 14, 2015 thanks again dark :DD Link to comment Share on other sites More sharing options...
Fredson Posted May 15, 2015 Author Share Posted May 15, 2015 dark i have a problem, when my friends try to join they get this (image) and jacket cannot use riht click in anything (examine, dig, plant trees) Link to comment Share on other sites More sharing options...
DarkXero Posted May 15, 2015 Share Posted May 15, 2015 (edited) @Fredson, I replicated the issue with the right click. I'm looking into it. However, I never crash, do you friends have a xbox controller or are they playing with keyboard and mouse?Or what are they doing? Just entering the server?Entering the server for first time or second time? Edited May 15, 2015 by DarkXero Link to comment Share on other sites More sharing options...
DarkXero Posted May 15, 2015 Share Posted May 15, 2015 @Fredson, ok, I think I got it.Revision.zip Link to comment Share on other sites More sharing options...
Fredson Posted May 16, 2015 Author Share Posted May 16, 2015 they use keyboard, they are joining, and like the 15 time they join, this happened after the rasmus update, okok ill check if my friends can join now ) Link to comment Share on other sites More sharing options...
DarkXero Posted May 18, 2015 Share Posted May 18, 2015 @Fredson, you didn't download what I uploaded right there.Try it to see if your friends keep crashing. Link to comment Share on other sites More sharing options...
Fredson Posted May 18, 2015 Author Share Posted May 18, 2015 ill check it tomorrow so i can test it with my friends Link to comment Share on other sites More sharing options...
Fredson Posted May 18, 2015 Author Share Posted May 18, 2015 thanks dark , the right click issue is fixed but friends still crash on join :/ 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