Jump to content

Search the Community

Showing results for tags 'monster'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Blogs

  • Development Blog
  • Canardian's Blog
  • Beyond Civilization Blog Ext
  • Tyler's Blog
  • macklebee's Blog
  • B-Byrnes' Blog
  • Marleys Ghost's Blog
  • omid3098's Blog
  • Richardsimpo123456's Blog
  • DJDD's Blog
  • Rick's Blog
  • --
  • xtreampb's Blog
  • Economically Disadvantaged
  • klepto2's Blog
  • Old Blog
  • Chris Paulson's Blog
  • Davaris' Blog
  • nil
  • Rekindled Phoenix's Blog
  • Flexman's Blog
  • Kattemaksu Online
  • Marcousik's Creations Blog
  • EVE LBS Studio
  • Rendering puzzles
  • Screen Size Utility
  • Niosop's Blog
  • 1299 RTS Game Project
  • Blitzbat's Blog
  • gordonramp's Blog
  • Andy Gilbert's Blog
  • Marcus' Blog
  • JornAggror Blog
  • diedir's Blog
  • wayneg's Blog
  • Masterxilo's Blog
  • Dave Lee's Blog
  • peubuy's blog
  • OD Arts -Leadwerks Blog
  • The progression......
  • Ultra Software Company Blog
  • The Progression
  • Pancake's Blog
  • Test Blog
  • BLaBZ Blog
  • Pure³d's Blog
  • dreamhead Blog
  • RVL's Blog
  • DB's Blog
  • Toxin Games Development Blog
  • CombatHelo Blog (RSS Import)
  • Foolish's Blog
  • ZioRed's Corner
  • Toxin Games Twitter
  • Shard - Third Initiative
  • Shard's Blog
  • Soamp's Blog
  • Soamp's Blog
  • Laurens' Blog
  • JT`s warehouse district
  • Kennar's Blog
  • KiteFuchs' Blog
  • KiteFuchs' Blog
  • Rachel's Dev-Blog
  • Eagle's Blog
  • zaphos' Blog
  • please delete this blog
  • Afke's Blog
  • Richard Simpson
  • knowledgegranted's Blog
  • EdzUp(GD)'s Blog
  • aGameLife's Kelasel MMORPG Blog
  • tournamentdan's Blog
  • Beyond Civilization Blog
  • smashthewindow
  • AnniXa's Blog
  • AnniXa's Blog
  • Elemental Development
  • DigitalHax Blog
  • Aria's Blog
  • Strogg76's Blog
  • Clackdor's Blog
  • Leadwerks Project Status
  • simpleprogrammer's Blog
  • Pathfinding in LE.2.x
  • Naughty Alien's Blog
  • smashthewindow's Blog
  • Ali Salehi's Blog
  • Jardar's Blog
  • Chris Vossen's Development Blog
  • Scarlet Thread Studios' Blog
  • Kronos' Blog
  • Benton's Blog
  • ChrisV's Blog
  • tjheldna's Blog
  • shadmar's Blog
  • 3D Masons, LLC
  • Andy Gilbert's Enviro Models
  • ParaToxic's Blog
  • NarkLord's Blog
  • ChrisMAN's Blog
  • ChrisMAN's Blog
  • CGMan's Blog
  • The Game
  • Chris Tutorials
  • Leadwerks 3 Experience
  • An Alien Saga
  • klepto2 & Leadwerks 3
  • Inside the mind of eternal insomniac
  • josk's Blog
  • Shader Development in Leadwerks 3.1
  • 3D Coat : Column game making of
  • Einlander's Blog
  • Ginger George's Blog
  • I have a problem
  • Michael_J's Blog
  • nasamydifol's Blog
  • Digman's Blog
  • noesisGUI
  • SavageDogg38's Blog
  • Built from Ruins
  • Remaining Days
  • test_external_blog
  • The Hunt For Food Blog
  • Crazy Minnow Studio
  • CrazyMinnowStudio
  • Guppy's Blog
  • Playing Online
  • Evayr's Blog
  • DerRidda's Blog
  • Karl's Blog
  • whiterabbit's Blog
  • Tinyboss Games
  • abendkleider's Blog
  • sacguccireplica's Blog
  • Arena
  • Imchasinyou's Blog
  • xtom's Blog
  • Lua is better than you think.
  • mdgunn's Blog
  • Crime Closer
  • lxFirebal69xl's Blog
  • Wedmer's Blog
  • Lockdown, going forward.
  • Pump-Action Captain
  • Igor's Blog
  • Dead Anyway
  • Runenrise and more
  • reepblue's Blog
  • Slippy's Corner
  • LUA Musings
  • severjack's Blog
  • mikeporter's Blog
  • miko93's Blog
  • Megalocerous' Blog
  • lxFirebal69xl's Blog
  • aiaf's Blog
  • Lostghbear's Blog
  • echo $BLOG_NAME > blog_title.tmpl
  • johnadam111's Blog
  • Dwarf Beard
  • burgelkat's Blog
  • Charrua's Blog
  • peterpaul's Blog
  • joshmathews' Blog
  • Martin Kearl's Blog
  • Brutile's blog
  • tipforeveryone's Blog
  • Glushchenko Blog
  • Express Lab Games Blog
  • Blueapples' Blog
  • DooMAGE's Blog
  • Structura devblog
  • UltraEngine - Experiences, add-ons and other Stuff
  • martyj's Blog
  • Dragonfreak's Blog
  • Brutile's Blog
  • assigmenthelp
  • Case Study Assignment Help
  • How to deal with bad grade ?
  • How to deal with bad grade ?
  • GameDev Blog
  • devcjohnson's Blog
  • devcjohnson's Blog
  • THE WHAT? Blog
  • The Demurian Scribe
  • GUI Editor
  • GUI Tutorial
  • noob_shaders
  • The Seventh World
  • Phodex Games Blog
  • Leadwerks VS Source 2
  • Work in Progress - Scifi PBR Media
  • [C++] First Player game start
  • The Blog of Yue
  • Snowboarding Development Blog
  • Ocean: Rendering in Leadwerks 4
  • Game Ready Maps
  • Ultra App Kit (Advanced Custom Widgets)
  • Poking around
  • Blender tutorials
  • Usefull Scripts & Components
  • Thirsty Panther
  • Ultimate Action Game Controller

Forums

  • Software
    • General Discussion
    • Programming
    • Game Artwork
    • Showcase
    • Suggestion Box
    • Bug Reports
  • Addons
    • Extensions & Plugins
    • Components
    • Addon Development
  • Platforms
    • Windows
    • Linux
    • macOS

Categories

  • Streams and Events
  • Tutorials
  • Games
  • Work in Progress

Categories

  • Components
  • Effects
  • Extensions
  • Materials
    • Asphalt
    • Brick
    • Concrete
    • Effects
    • Fabric
    • Ground
    • Marble
    • Metal
    • Organic
    • Plaster
    • Rock
    • Roof
    • Sand
    • Snow
    • Surface Imperfections
    • Tile
    • Wood
  • Models
    • Animals & Creatures
    • Architecture
    • Food
    • Machinery
    • Plants and Vegetation
    • Props
    • Vehicles
  • Scenes
  • Skyboxes
  • Tools

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location

Found 2 results

  1. I found a tutorial for a decent script to make a monster spawner ,but I do not need it to run upon game start as it was shown in the tutorial. I'm pretty bad at scripting but i tried to have the spawner disabled at start and tried to start it upon enabling but I am jacking something up in the code somewhere and I lack the experience to find out where. If you can help me correct my mistake I would be thankful:) Script.Target = nil --Entity "character target" Script.SpawnRate = 5.5 --float "spawn rate" Script.MaxZombies = 5 --int Max zombs function Script:Start() self.enabled = false end function Script:Enable()--in if self.enabled == false then self.enable = true self.lastSpawnTime = 0 self.counter = 0 end end function Script:UpdatePhysics() if self.counter >= self.MaxZombies then return end if Time:GetCurrent() > self.lastSpawnTime + (self.SpawnRate * 1000) then self.counter = self.counter + 1 self.lastSpawnTime = Time:GetCurrent() --create a zombie and set location, speed, and target to the player local zombie = Prefab:Load("AddOns/Zombie Character Pack/zombie1.pfb") zombie.script:Start() zombie:SetPosition(self.entity:GetPosition()) zombie.script:Enable() --zombie.script.Speed = 2 zombie.script.Player = self.Target end end
  2. Hello, im having trouble releasing dead enemy after some time. When i kill enemy i want body to disappear after 5 sec. I have change AI script , have no errors but it does not work. Can someone help ? Here is my code. Thanks import "Scripts/AnimationManager.lua" import "Scripts/Functions/GetEntityNeighbors.lua" --Public values Script.health=40--int "Health" Script.enabled=true--bool "Enabled" Script.target=nil--entity "Target" Script.sightradius=3--float "Sight Range" Script.senseradius=3--float "Hearing Range" Script.teamid=2--choice "Team" "Neutral,Good,Bad" --Private values Script.damage=5 Script.attackrange=1 Script.updatefrequency=500 Script.lastupdatetime=0 Script.prevtarget=nil Script.animation={} Script.animation.idle=0 Script.animation.run=1 Script.animation.attack={} Script.animation.attack[0]=2 Script.animation.attack[1]=2 Script.animation.death=3 Script.followingtarget=false Script.maxaccel=10 Script.speed=1.5 Script.lastupdatetargettime=0 Script.attackmode=0 Script.attackbegan=0 Script.sound={} Script.sound.death = Sound:Load("Sound/Characters/zombiecrawlerdie.wav") Script.sound.alert = Sound:Load("Sound/Characters/zombiecrawlerintro.wav") Script.sound.attack={} Script.sound.attack[1] = Sound:Load("Sound/Characters/zombiecrawlerswipe.wav") Script.sound.attack[2] = Sound:Load("Sound/Characters/zombiecrawlerswipe.wav") Script.removeBodyTimer = 0 Script.removeBodyTime = 5 function Script:Enable()--in if self.enabled==false then if self.health>0 then self.enabled=true if self.target~=nil then self:SetMode("roam") else self:SetMode("idle") end end end end function Script:ChooseTarget() local entities = GetEntityNeighbors(self.entity,self.sightradius,true) local k,entity for k,entity in pairs(entities) do if entity.script.teamid~=nil and entity.script.teamid~=0 and entity.script.teamid~=self.teamid then if entity.script.health>0 then local d = self.entity:GetDistance(entity) --if d<self.senseradius then -- return entity.script --else -- local p = Transform:Point(entity:GetPosition(),nil,self.entity) -- if (p.z>-math.abs(p.x) and p.z<-math.abs(p.y)) then local pickinfo=PickInfo() if self.entity.world:Pick(self.entity:GetPosition()+Vec3(0,1.6,0),entity:GetPosition()+Vec3(0,1.6,0),pickinfo,0,false,Collision.LineOfSight)==false then return entity.script end -- end --end end end end end function Script:DistanceToTarget() local pos = self.entity:GetPosition() local targetpos = self.target.entity:GetPosition() if math.abs(targetpos.y-pos.y)<1.5 then return pos:xz():DistanceToPoint(targetpos:xz()) else return 100000--if they are on different vertical levels, assume they can't be reached end end function Script:TargetInRange() local pos = self.entity:GetPosition() local targetpos = self.target.entity:GetPosition() if math.abs(targetpos.y-pos.y)<1.5 then if pos:xz():DistanceToPoint(targetpos:xz())<self.attackrange then return true end end return false end --[[ function WorldGetEntitiesInAABBDoCallback(entity,extra) if entity~=extra then if GetEntityNeighborsScriptedOnly==false or entity.script~=nil then table.insert(WorldGetEntitiesInAABBDoCallbackTable,entity) end end end function GetEntityNeighbors(entity,radius,scriptOnly) local result local aabb = AABB() local p = entity:GetPosition(true) local temp = GetEntityNeighborsScriptedOnly GetEntityNeighborsScriptedOnly=scriptOnly aabb.min = p - radius aabb.max = p + radius aabb:Update() local table = WorldGetEntitiesInAABBDoCallbackTable WorldGetEntitiesInAABBDoCallbackTable = {} entity.world:ForEachEntityInAABBDo(aabb,"WorldGetEntitiesInAABBDoCallback",entity) result = WorldGetEntitiesInAABBDoCallbackTable WorldGetEntitiesInAABBDoCallbackTable = table GetEntityNeighborsScriptedOnly = temp return result end ]]-- function Script:Start() self.animationmanager = AnimationManager:Create(self.entity) if self.enabled then if self.target~=nil then self:SetMode("roam") else self:SetMode("idle") end end end function Script:Hurt(damage,distributorOfPain) if self.health>0 then if self.target==nil then self.target=distributorOfPain self:SetMode("attack") end self.health = self.health - damage if self.health<=0 then self.entity:SetMass(0) self.entity:SetCollisionType(0) self.entity:SetPhysicsMode(Entity.RigidBodyPhysics) self:SetMode("dying") end end end function Script:EndDeath() self:SetMode("dead") self.removeBodyTimer = self.removeBodyTimer + (Time:GetSpeed()/100) end function Script:DirectMoveToTarget() self.entity:Stop() local targetpos = self.target.entity:GetPosition() local pos = self.entity:GetPosition() local dir = Vec2(targetpos.z-pos.z,targetpos.x-pos.x):Normalize() local angle = -Math:ATan2(dir.y,-dir.x) self.entity:SetInput(angle,self.speed) end function Script:SetMode(mode) if mode~=self.mode then local prevmode=self.mode self.mode=mode if mode=="idle" then self.target=nil self.animationmanager:SetAnimationSequence(0,0.02) self.entity:Stop()--stop following anything elseif mode=="roam" then if self.target~=nil then self.animationmanager:SetAnimationSequence(1,0.04) self.entity:GoToPoint(self.target:GetPosition(true),5,5) else self:SetMode("idle") end elseif mode=="attack" then self:EndAttack() elseif mode=="chase" then if self.entity:Follow(self.target.entity,self.speed,self.maxaccel) then if prevmode~="chase" then self.entity:EmitSound(self.sound.alert) end self.followingtarget=true self.animationmanager:SetAnimationSequence(self.animation.run,0.05,300) if self:DistanceToTarget()<self.attackrange*2 then self.followingtarget=false self.entity:Stop() self:DirectMoveToTarget() end else self.target=nil self:SetMode("idle") return end elseif mode=="dying" then self.entity:EmitSound(self.sound.death) self.entity:Stop() self.animationmanager:SetAnimationSequence(self.animation.death,0.04,300,1,self,self.EndDeath) elseif mode=="dead" then self.entity:SetCollisionType(0) self.entity:SetMass(0) self.entity:SetShape(nil) self.entity:SetPhysicsMode(Entity.RigidBodyPhysics) self.enabled=false if (self.removeBodyTimer > self.removeBodyTime) then self.entity:Release() end end end end function Script:EndAttack() if self.mode=="attack" then if self.target.health<=0 then self:SetMode("idle") return end local d = self:DistanceToTarget() if d>self.attackrange then --if d>self.attackrange*2 then self:SetMode("chase") return --else -- local pos = self.entity:GetPosition() -- local targetpos = self.target.entity:GetPosition() -- self.entity:SetInput(-Math:ATan2(targetpos.x-pos.x,targetpos.y-pos.y),self.speed) -- return --end end self.entity:Stop() self.attackmode = 1-self.attackmode--switch between right and left attack modes self.animationmanager:SetAnimationSequence(self.animation.attack[self.attackmode],0.04*math.random(1,1.25),300,1,self,self.EndAttack) self.attackbegan = Time:GetCurrent() if math.random()>0.75 then self.entity:EmitSound(self.sound.attack[self.attackmode+1]) end end end function Script:UpdatePhysics() if self.enabled==false then return end local t = Time:GetCurrent() self.entity:SetInput(self.entity:GetRotation().y,0) if self.mode=="idle" then if t-self.lastupdatetargettime>250 then self.lastupdatetargettime=t self.target = self:ChooseTarget() if self.target then self:SetMode("chase") end end elseif self.mode=="roam" then if self.entity:GetDistance(self.target)<1 then self:SetMode("idle") end elseif self.mode=="chase" then if self.target.health<=0 then self:SetMode("idle") return end if self:TargetInRange() then self:SetMode("attack") elseif self:DistanceToTarget()<self.attackrange*2 then self.followingtarget=false self.entity:Stop() self:DirectMoveToTarget() else if self.followingtarget==false then if self.entity:Follow(self.target.entity,self.speed,self.maxaccel) then self:SetMode("idle") end end end elseif self.mode=="attack" then if self.attackbegan~=nil then if t-self.attackbegan>300 then self.attackbegan=nil self.target:Hurt(self.damage) end end local pos = self.entity:GetPosition() local targetpos = self.target.entity:GetPosition() local dx=targetpos.x-pos.x local dz=targetpos.z-pos.z self.entity:AlignToVector(-dx,0,-dz) end end function Script:Draw() if self.enabled==false then return end self.animationmanager:Update() end
×
×
  • Create New...