dragonacool Posted July 22, 2015 Share Posted July 22, 2015 (edited) ok so i have the weapon almost complete. one part of the weapon shoots a projectile towards a target, i got that working. besides the fact that i cant get the overcharge sound to play when that happens. other than that its ok now the second part is spawning lighting around. now the weapon makes the sky go dark and i hear the lightning sound but i dont see any lightning nor does it do any effects to the surround areas. is it because the weapon is set to projectile or could it be do to the world position. here is my code for the projectilelocal assets ={ Asset("ANIM", "anim/tm24_projectile.zip"), Asset("ANIM", "anim/bishop_attack.zip"), Asset("SOUND", "sound/wx78.fsb"), Asset("SOUNDPACKAGE", "sound/dontstarve.fev"), }local function fn(inst) local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) RemovePhysicsColliders(inst) inst.AnimState:SetBank("bishop_attack") inst.AnimState:SetBuild("bishop_attack") inst.AnimState:PlayAnimation("idle", true) if not TheWorld.ismastersim then return inst end -- inst.AnimState:SetBank("projectile") -- inst.AnimState:SetBuild("staff_projectile") inst:AddTag("projectile") inst.entity:SetPristine() inst:AddComponent("projectile") inst.components.projectile:SetSpeed(30) inst.components.projectile:SetOnHitFn(inst.Remove) inst.components.projectile:SetOnMissFn(inst.Remove) ---------------------------------------------------------------------- ------------------------------------------------------------------------ local pt = Vector3(inst.Transform:GetWorldPosition()) local num_lightnings = 16 inst:StartThread(function() for k = 0, num_lightnings do local rad = math.random(3, 15) local angle = k * 4 * PI / num_lightnings local pos = pt + Vector3(rad * math.cos(angle), 0, rad * math.sin(angle)) TheWorld:PushEvent("ms_sendlightningstrike", pos) Sleep(math.random( .3, .5)) end end) return instendreturn Prefab("common/inventory/tm24_projectile", fn, assets) Edited July 22, 2015 by dragonacool Link to comment Share on other sites More sharing options...
Asparagus Posted July 22, 2015 Share Posted July 22, 2015 @dragonacool, you should place this mod-related topics here:http://forums.kleientertainment.com/forum/79-dont-starve-together-beta-mods-and-tools/ Link to comment Share on other sites More sharing options...
dragonacool Posted July 22, 2015 Author Share Posted July 22, 2015 i did. i realized i had placed the original in off topic. do u no how to delete topics you create?@Asparagus 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