Search the Community
Showing results for tags 'projectile'.
-
Howdy. I need your help with projectile that is facing the wrong direction. It's artillery shell and I need its tip to be directed to the target. I have tried using local function OnThrown(inst) inst.AnimState:SetOrientation(ANIM_ORIENTATION.OnGround) inst.AnimState:PlayAnimation("idle") end but it does not work. I have also looked into boomerang and blowdart and didn't find any clue. If someone approached the same problem in the past I will be grateful for your help.
-
Hello there. I have tried to make a projectile that spins in air before hitting target. As you can expect I failed once more. I used boomerang prefab to figure it out but following code line doesn't work: inst.AnimState:PlayAnimation("spin_loop", true). I have tried everything according to my knowledge. Thanks for help in advance.
- 1 reply
-
- help
- projectile
-
(and 2 more)
Tagged with:
-
I used some code to give my character the ability to shoot fireballs without needing to equip a weapon. However, now I'm unable to plant things, since I'm using "right-click" to shoot the fireball. I'm hoping someone can possibly see where I screwed up and can help me fix my problem. Any help would be greatly appreciate fellow starvers! CODE IN QUESTION: (Note that I put this in my character's modmain folder.) local CASTFIRE = AddAction("CASTFIRE", "Blast into Oblivion!", function(act) local projectile = GLOBAL.SpawnPrefab("fire_projectile") projectile:AddComponent("weapon") projectile.Transform:SetPosition(act.doer.Transform:GetWorldPosition()) projectile.components.projectile:Throw(act.doer, act.target) return true end) CASTFIRE.rmb = true CASTFIRE.distance = 10 AddStategraphActionHandler("wilson", GLOBAL.ActionHandler(GLOBAL.ACTIONS.CASTFIRE, "throw")) AddPrefabPostInit("vegeta", function(inst) inst:DoTaskInTime(2, function() local self = inst.components.playeractionpicker self.rightclickoverride = function(inst, target, position) local actions = {} if target and target.replica.health and not (inst == target) then table.insert(actions, GLOBAL.ACTIONS.CASTFIRE) end return self:SortActionList(actions, target) end end) end)
-
- mod
- projectile
-
(and 1 more)
Tagged with:
-
I have little to no experience in programming and was hoping for some help with a specific ability for my custom character. I want him to be able to pretty much have the same effect as a fire staff without the need of equipping the staff to do so. I am not sure where any of the code would go either, so I apologize for my high level of ignorance here. Any help at all would be much appreciated. EDIT: Having the ability like the Deadpool character mod, where his weapon shoots fireballs in essence, would be great too.
-
Based on all the code I've seen, every single projectile attack is based on launching a weapon you have in hand. Even monsters will equip their projectile item before attacking. The problem is, I want a projectile to shoot out regardless of what is in the character's hand. What I want to do is have the character's attack range set to inst.components.combat:SetRange(6, 2) so that attack attempts will be made at medium range, but the attack will miss unless you're in normal melee range. I then have a listener for inst:ListenForEvent("onmissother", rangedattack) that will trigger when the attack fails. It will allow me to execute a normal melee attack, however. So, shouldn't my code be able to just spawn in a projectile, give it a trajectory based on my target, and launch? I've tried a bunch of things, but I'm running into all kinds of issues. SpawnPrefab("spit") doesn't seem to make it appear, even just staying in place, let alone trying to make it launch. Maybe there's some way to quick swap what's in the player's hands, execute the attack, then swap it back? But then it'd probably play all the equipping noises and that'd be annoying...
- 2 replies
-
- attack
- ranged attack
-
(and 2 more)
Tagged with: