KingAlpha

  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

About KingAlpha

  • Rank
    Junior Member
...
  1. Hi guys. I'm modding a healing gun for my friend. I want it to attack people and heal them instead of damaging them. I finished it and it's working fine, However it only work in pvp server because in non pvp you can't click on other player with weapon in hand. I heard that you can by pass the "check of variable" from non pvp server which prevent you fo click on other player. But I'm not sure how to do it. Any suggestions?
  2. I've been trying to work around your suggestion but maybe I'm totally off track here and it's not how this should be . I'm making this special attack for my character, I wants it to deal AOE damage to creatures around the target when the attack hit. I have removed all the unnecessary parts about hitting workable and explosive or ignite because it's an ice attack. This is in my character.lua. So I press a button to charge it local function powerready(inst) if not inst.components.inventory.equipslots[EQUIPSLOTS.HANDS] then return end local item = inst.components.inventory.equipslots[EQUIPSLOTS.HANDS].prefab if item ~= "boomerang" and item ~= "blowdart_sleep" and item ~= "blowdart_fire" and item ~= "blowdart_pipe" and item ~= "blowdart_yellow" and item ~= "blowdart_walrus" and item ~= "waterballoon" and item ~= "sleepbomb" then inst.components.king.power = 1 inst.powerfx = SpawnPrefab("deer_ice_charge") inst.powerfx.entity:AddFollower() inst.powerfx.Follower:FollowSymbol(inst.GUID, "swap_object", 30, -150, 0) if item == "umbrella" or item == "grass_umbrella" then inst.powerfx.Follower:FollowSymbol(inst.GUID, "swap_object", -10, -380, 0) end if item == "shovel" or item == "goldenshovel" or item == "pitchfork" then inst.powerfx.Follower:FollowSymbol(inst.GUID, "swap_object", 0, 130, 0) end if item == "swordcane" then inst.powerfx.Follower:FollowSymbol(inst.GUID, "swap_object", 0, -150, 0) end if item == "totooriastaff1" or item == "totooriastaff2" or item == "totooriastaff3" or item == "totooriastaff4" or item == "totooriastaff5green" or item == "totooriastaff5orange" or item == "totooriastaff5yellow" then inst.powerfx.Follower:FollowSymbol(inst.GUID, "swap_object", 0, -185, 0) end inst.components.combat.damagemultiplier = inst.components.king.level*5/150 + 4 inst.components.talker:Say("Here come the big FINALE!!") end end Then attack an enemy, This is I want it to be an AOE when hit. local function doAreaDamage(x, y, z, damageRange, damageToLivingEntities, doDamageToNonCombatants, mustHaveTags, cantHaveTags, mustHaveOneOfTheseTags) local ents = TheSim:FindEntities(x, y, z, 6, nil, {"INLIMBO"}, {"player"}) for i, v in ipairs(ents) do if v:IsValid() and not v:IsInLimbo() then if v.components.health ~= nil and not v.components.health:IsDead() then local dmg = damageToLivingEntities if doDamageToNonCombatants then v.components.health:DoDelta(damageToLivingEntities) end end end end end local function hitother(inst) if inst.components.king.power == 1 and inst.components.combat.target and inst.components.combat.target:IsValid() then if inst.components.rider:IsRiding() then return end inst.components.king.power = 0 SpawnPrefab("icing_splash_fx_full").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("icing_splash_fx_med").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("icing_splash_fx_low").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("icing_splash_fx_melted").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("crabking_feeze").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("crabking_ring_fx").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("icespike_fx_1").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("icespike_fx_2").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("icespike_fx_3").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("icespike_fx_4").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("splash_snow_fx").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("spawn_fx_small_high").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("groundpoundring_fx").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) local x, y, z = inst.components.combat.target.Transform:GetWorldPosition() doAreaDamage (x, y, z, 5, 100, nil, {"INLIMBO"}, {"player"}) inst.powerfx:Remove() inst.fxout = SpawnPrefab("deer_ice_burst") inst.fxout.entity:SetParent(inst.entity) inst.fxout.entity:AddFollower() inst.fxout.Follower:FollowSymbol(inst.GUID, "swap_body", 0, 0, 0) inst.SoundEmitter:PlaySound("dontstarve/common/fireOut") inst.components.combat.damagemultiplier = 1 if inst.components.hunger.current <= 0 then inst.components.health:DoDelta(-40) end inst.components.hunger:DoDelta(-40) inst.components.sanity:DoDelta(-20) end end Please tell me if it's possible to do it this way or I should try other methods. I will continous to learn more. For now this code works without error but the attack stayed the same. Thank you for your kind reply.
  3. Hi @YakumoYukari. I stumbled on this post while dealing with my creation. I'm trying to make an ultimate attack for my character. And when it hits I would like it to hit enemies around the initial target. For now this is what I have. So the way it works is I press a button, weapon will lights up, and when I press attack on the enemy this bunch of fx will happen and the attack is hit. Please do not laugh too hard at my fx spam, I like it fancy . local function hitother(inst) if inst.components.king.power == 1 and inst.components.combat.target and inst.components.combat.target:IsValid() then if inst.components.rider:IsRiding() then return end inst.components.king.power = 0 SpawnPrefab("icing_splash_fx_full").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("icing_splash_fx_med").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("icing_splash_fx_low").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("icing_splash_fx_melted").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("crabking_feeze").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("crabking_ring_fx").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("icespike_fx_1").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("icespike_fx_2").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("icespike_fx_3").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("icespike_fx_4").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("splash_snow_fx").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("spawn_fx_small_high").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) SpawnPrefab("groundpoundring_fx").Transform:SetPosition(inst.components.combat.target.Transform:GetWorldPosition()) DoAOEAttack(inst, target) inst.powerfx:Remove() inst.fxout = SpawnPrefab("deer_ice_burst") inst.fxout.entity:SetParent(inst.entity) inst.fxout.entity:AddFollower() inst.fxout.Follower:FollowSymbol(inst.GUID, "swap_body", 0, 0, 0) inst.SoundEmitter:PlaySound("dontstarve/common/fireOut") inst.components.combat.damagemultiplier = 1 if inst.components.hunger.current <= 0 then inst.components.health:DoDelta(-40) end inst.components.hunger:DoDelta(-40) inst.components.sanity:DoDelta(-20) end end This worked in game as it attack only one enemy. This code is in my character.lua because the special attack can be use on any weapon. Thank you very much
  4. Thank you for your reply. I have worked my way around it to avoid the complication of this. It's way too complicated for my modding skills right now.
  5. Hi, I'm a total newbie to modding. I'm creating a weapon that only usable when reached 100% and slowly decrease durability as times goes. Now I'm trying to make it recharge itself from 0% but seems stuck and couldn't find away. If anyone can help me with a line of codes or some suggestion that would be great. Thank you all very much!!!