-
Posts
218 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by burgelkat
-
I want to create smoke effect like this
burgelkat replied to tipforeveryone's topic in General Discussion
-
I want to create smoke effect like this
burgelkat replied to tipforeveryone's topic in General Discussion
ok looks with that nice. at the moment only single-shot looks good .. i have to build a spritesheet without a bullet shell so thats my solution for the moment FPSGun.lua -
I want to create smoke effect like this
burgelkat replied to tipforeveryone's topic in General Discussion
ok something like this .. (its not perfekt) https://www.dropbox.com/s/atjdn8xc7ef5os8/BehindEnemyLines 2018-03-16 09-19-46-90.avi?dl=0 -
I want to create smoke effect like this
burgelkat replied to tipforeveryone's topic in General Discussion
mhm or the problem is because we create the sprite and hide it .. so the material on the sprite is set and run the spritesheet pictures in the backround .. if i now show the sprite and at this moment the 4th picture is displayed, then it looks bad -
I want to create smoke effect like this
burgelkat replied to tipforeveryone's topic in General Discussion
thats a good video .. but how can i control the pictures in a sprite sheet? the spritesheet shader like the "firepit" shader from shadmar starts random in the individual pictures of a sprite sheets. In the case of fire this is not a problem, with explosions or with Gun Effects it should begin however with the first picture. I have such a spritesheet (muzzleflash .. a bullet and smokes but it does not start on the first picture. And creating an effect with maybe 20 seperatly bictures is a bit exhausting (I hope you understand my english ) -
i read this post https://www.leadwerks.com/community/topic/9862-small-entities-fall-through-terrain/ buit if i use force i have to add a Mass so rey cast for this not work
-
Hi , i will share my solution for the Mortar. Mortar = a Pivot put there this script in (MortarTracking.lua) import "Scripts/Functions/ReleaseTableObjects.lua" import "Scripts/Functions/GetEntityNeighbors.lua" Script.enabled=true--bool "Enabled" Script.trackingrange = 10 Script.tracking=false function Script:Enable()--in if self.enabled==false then self.enabled=true self.component:CallOutputs("Enable") end end function Script:Disable()--in if self.enabled then self.enabled=false self.component:CallOutputs("Disable") end end function Script:UpdatePhysics() if self.enabled then -- load entities within range (5000) of self.entity into "entities", only load entities that have scripts attached local entities = GetEntityNeighbors(self.entity,5000,true) local k,entity -- loop thrrough the result of "entities". k = key, entity = result for k,entity in pairs(entities) do -- only select entities with teamid == 1 ("good") if entity.script.teamid == 1 then -- and if the entity has at least 1 health remaining if entity.script.health>0 then local d = self.entity:GetDistance(entity) self.target = entity end local pos = self.entity:GetPosition() local targetpos = self.target:GetPosition() --if math.abs(targetpos.y-pos.y)<1.5 then if pos:xz():DistanceToPoint(targetpos:xz())<self.trackingrange then self.tracking=false else self.tracking=true end end end if self.tracking==true then self.entity:Point(self.target,2,Time:GetSpeed()*1.5); end end end in Mortar Body = the Model put in the script (Mortar.lua) import "Scripts/Functions/ReleaseTableObjects.lua" import "Scripts/Functions/GetEntityNeighbors.lua" Script.enabled=true--bool "Enabled" --Public Script.target = nil--enemy to shoot Script.teamid=3--choice "Team" "Neutral,Good,Bad" Script.range = 5000 Script.health=100 Script.projectilepath = "Prefabs/projectiles/MortarAmmo.pfb" Script.shoot1sound=""--path "File" "All Supported Files:ogg,wav;Waveform Audio File Format (*.wav):wav;Ogg Vorbis (*.ogg):ogg|Sound" Script.shoot2sound=""--path "File" "All Supported Files:ogg,wav;Waveform Audio File Format (*.wav):wav;Ogg Vorbis (*.ogg):ogg|Sound" Script.shoot3sound=""--path "File" "All Supported Files:ogg,wav;Waveform Audio File Format (*.wav):wav;Ogg Vorbis (*.ogg):ogg|Sound" --Private Script.lastfiretime=0 Script.mode = "idle" Script.lastsearchtime = 0 Script.searchfrequency = 500 Script.firefrequency = 4000 Script.Force1 = Vec3(0,1500,0) Script.Force2 = Vec3(0,2500,0) Script.Force3 = Vec3(0,3000,0) Script.Force4 = Vec3(0,3500,0) Script.range0 = 20 Script.range1 = 30 Script.range2 = 60 Script.range3 = 90 Script.range4 = 110 function Script:Start() --Load sounds self.sound = {} self.sound.shoot = {} if self.shoot1sound~="" then self.sound.shoot[1] = Sound:Load(self.shoot1sound) end if self.shoot2sound~="" then self.sound.shoot[2] = Sound:Load(self.shoot2sound) end if self.shoot3sound~="" then self.sound.shoot[3] = Sound:Load(self.shoot3sound) end self.projectile = Prefab:Load(self.projectilepath) if self.projectile~=nil then self.projectile:Hide() end self.Mortar = self.entity:FindChild("Mortar") --Add muzzleflash to gun self.muzzle = self.entity:FindChild("muzzle") if self.muzzle~=nil then local mtl=Material:Create() mtl:SetBlendMode(5) self.muzzle:SetMaterial(mtl) mtl:Release() self.muzzleflash = Sprite:Create() self.muzzleflash:SetSize(0.35,0.35) local pos=self.muzzle:GetPosition(true) self.muzzleflash:SetPosition(pos,true) self.muzzleflash:SetParent(self.muzzle,true) mtl = Material:Load("Materials/Effects/muzzleflash.mat") if mtl then self.muzzleflash:SetMaterial(mtl) mtl:Release() mtl=nil end local light = PointLight:Create() light:SetRange(5) light:SetColor(1,0.75,0) light:SetParent(self.muzzleflash,flash) if light.world:GetLightQuality()<2 then light:SetShadowMode(0) end self.muzzleflash:Hide() end end function Script:Release() if self.projectile~=nil then self.projectile:Release() self.projectile = nil end end function MortarSearchHook(entity,extra) if entity~=extra then if entity.script~=nil then if entity.script.teamid == 1 then if type(entity.script.health)=="number" then if entity.script.health>0 then local d = extra:GetDistance(entity) if d<extra.script.range then if extra.script.target~=nil then if extra.script:GetDistance(extra.script.target)>d then if extra.script:GetTargetVisible(entity.script) then extra.script.target = entity.script end end else if extra.script:GetTargetVisible(entity.script) then extra.script.target = entity.script end end end end end end end end end function Script:GetTargetVisible(target) if target==nil then target = self.target end if target==nil then return false end local pickinfo = PickInfo() local p0 = self.entity:GetAABB().center local p1 = target.entity:GetAABB().center local pickmode0 = self.entity:GetPickMode() local pickmode1 = target.entity:GetPickMode() self.entity:SetPickMode(0) target.entity:SetPickMode(0) local result = not self.entity.world:Pick(p0,p1,pickinfo,0,false,Collision.LineOfSight) self.entity:SetPickMode(pickmode0) target.entity:SetPickMode(pickmode1) return result end function Script:UpdateWorld() if self.enabled==true then if self.health>=0 then self.component:CallOutputs("Online") local currenttime = Time:GetCurrent() --Stop shooting if target is dead if self.target~=nil then if self.target.health<=0 then self.component:CallOutputs("Idle") self.target = nil end end --Search for target if self.enabled==true then if self.target==nil then if currenttime - self.lastsearchtime > self.searchfrequency then self.lastsearchtime = currenttime local pos = self.entity:GetPosition(true) local aabb = AABB(pos - Vec3(self.range), pos + Vec3(self.range)) self.entity.world:ForEachEntityInAABBDo(aabb,"MortarSearchHook",self.entity) end end end ---------------------deactivated because the Mortar should fire if vegetation hides you----------------- --Continuous visibility test --[[ if self.target~=nil then if currenttime - self.lastsearchtime > self.searchfrequency then self.lastsearchtime = currenttime if self:GetTargetVisible(self.target)==false then self.target = nil return end end end]] ---------------------------------------------------------------------------------------------------------- if self.target~=nil then ---------------------------no need for this (i think)--------------------------------------------------------------- --[[Motion tracking if self.Mortar~=nil then local p0 = self.Mortar:GetPosition(true) local p1 = self.target.entity:GetAABB().center local yplane = p1 - p0 yplane.y=0 self.Mortar:AlignToVector(yplane,1,0.1 / Time:GetSpeed(),0) end]] ---------------------------------------------------------------------------------------------------------- --Shoot if self.muzzle~=nil and self.projectile~=nil then if currenttime - self.lastfiretime > self.firefrequency then self.lastfiretime = currenttime local bullet = self.projectile:Instance() self.muzzleflash:Show() self.muzzleflash:EmitSound(self.sound.shoot[#self.sound.shoot]) self.muzzleflash:SetAngle(math.random(0,360)) self.muzzleflashtime=currenttime if bullet~=nil then bullet:Show() bullet:SetFriction(1000,1000) bullet:SetCollisionType(Collision.Projectile) bullet:SetPosition(self.muzzle:GetPosition(true),true) bullet:SetRotation(self.muzzle:GetRotation(true),true) targetpos = self.target.entity:GetPosition() pos1 = self.entity:GetPosition(true) --if math.abs(targetpos.y-pos1.y)<1.5 then -------------------------------------------------Fire Range--------------------------------------------------------------------- if pos1:xz():DistanceToPoint(targetpos:xz())<self.range1 then System:Print("1") bullet:AddForce(self.Force1) else if pos1:xz():DistanceToPoint(targetpos:xz())<self.range2 then System:Print("2") bullet:AddForce(self.Force2) else if pos1:xz():DistanceToPoint(targetpos:xz())<self.range3 then System:Print("3") bullet:AddForce(self.Force4) else if pos1:xz():DistanceToPoint(targetpos:xz())<self.range4 then System:Print("4") bullet:AddForce(self.Force4) else return 100000 end end end end -------------------------------------------------------------------------------------------------------------------------------- bullet:SetMass(0.4) if bullet.script~=nil then bullet.script.owner = self if type(bullet.script.Enable)=="function" then bullet.script:Enable() end bullet:Turn(Math:Random(-4,4),Math:Random(-4,4),0) end end end end end end if self.health<=0 then self.component:CallOutputs("Offline") end self:UpdateMuzzleFlash() end end function Script:UpdateMuzzleFlash() if self.muzzleflashtime then if Time:GetCurrent()-self.muzzleflashtime<30 then self.muzzleflash:Show() else self.muzzleflash:Hide() end end end function Script:Online()--in if self.enabled==false then self.component:CallOutputs("Online") self.enabled=true end end function Script:Offline()--in if self.enabled==true then self.component:CallOutputs("Offline") self.enabled=false end end for the Ammo search a model like my on http://www.cadnav.com/3d-models/model-42383.html and put the script "MortarAmmo" in Script.movespeed=1000 Script.pickradius=0 Script.damage=10 Script.lifetime=20000 Script.enabled=false--bool "Enabled" function Script:Start() self.sound={} self.sound.ricochet={} self.sound.ricochet[1]=Sound:Load("Sound/Weapons/Explosion.wav") self.sound.ricochet[2]=Sound:Load("Sound/Weapons/Explosion.wav") self.sound.ricochet[3]=Sound:Load("Sound/Weapons/Explosion.wav") self.starttime=Time:GetCurrent() self.emitter={} --Debris emitter - This will throw chunks off of walls and make it look like they are breaking self.emitter[0]=Emitter:Create() self.emitter[0]:SetCollisionType(Collision.Prop)--Enables particle bouncing self.emitter[0]:SetMaterial("Materials/Effects/smoke.mat") self.emitter[0]:SetEmissionVolume(0.05,0.05,0.05) self.emitter[0]:SetColor(0.1,0.1,0.1,1) self.emitter[0]:SetVelocity(5.5,15,5.5,1) self.emitter[0]:SetParticleCount(20) self.emitter[0]:SetReleaseQuantity(20) self.emitter[0]:SetMaxScale(0.9) self.emitter[0]:SetDuration(1500) self.emitter[0]:SetAcceleration(0,-12,0) self.emitter[0]:SetLoopMode(false) self.emitter[0]:Hide() --Smoke emitter - This will provide a soft dust effect around bullet impacts self.emitter[1]=Emitter:Create() self.emitter[1]:SetColor(1,1,1,0.25) self.emitter[1]:SetMaterial("Materials/Effects/smoke.mat") self.emitter[1]:SetEmissionVolume(0.1,0.1,0.1) self.emitter[1]:SetVelocity(0.3,0.3,0.3,1) self.emitter[1]:SetParticleCount(8) self.emitter[1]:SetReleaseQuantity(3) self.emitter[1]:SetMaxScale(15) self.emitter[1]:SetDuration(3800) self.emitter[1]:AddScaleControlPoint(0,0.5) self.emitter[1]:AddScaleControlPoint(1,1) self.emitter[1]:SetRotationSpeed(10) self.emitter[1]:SetLoopMode(false) self.emitter[1]:Hide() --Smoke emitter - This will provide a soft dust effect around bullet impacts self.emitter[2]=Emitter:Create() self.emitter[2]:SetColor(1,1,1,0.25) self.emitter[2]:SetMaterial("Prefabs/Effects/Explosion/explosion.mat") self.emitter[2]:SetEmissionVolume(0.1,0.1,0.1) self.emitter[2]:SetVelocity(0.3,0.3,0.3,1) self.emitter[2]:SetParticleCount(1) self.emitter[2]:SetReleaseQuantity(1) self.emitter[2]:SetMaxScale(25) self.emitter[2]:SetDuration(2500) self.emitter[2]:AddScaleControlPoint(0,0.5) self.emitter[2]:AddScaleControlPoint(1,1) self.emitter[2]:SetRotationSpeed(10) self.emitter[2]:SetLoopMode(false) self.emitter[2]:Hide() end function Script:Enable() if self.enabled==false then self.enabled=true end end function Script:FindScriptedParent(entity,func) while entity~=nil do if entity.script then if type(entity.script[func])=="function" then return entity end end entity = entity:GetParent() end return nil end function Script:UpdateWorld() if self.enabled==false then return end if self.entity:Hidden() then return end local pickinfo=PickInfo() local pos = self.entity:GetPosition(true) local targetpos = Transform:Point(0,0,self.movespeed/60.0 * Time:GetSpeed(),self.entity,nil) local result = self.entity.world:Pick(pos,targetpos,pickinfo,self.pickradius,true,Collision.Projectile) if result then local enemy = self:FindScriptedParent(pickinfo.entity,"Hurt") if enemy then if self.owner then --if self.owner.teamid==enemy.script.teamid then -- result=false --end end if result then if enemy.script.health>0 then enemy.script:Hurt(self.damage,self.owner) end end end if result then self:Explode() --Bullet mark decal local mtl local scale = 2 if enemy~=nil then mtl = Material:Load("Materials/Decals/wound.mat") scale = 0.1 else if pickinfo.surface~=nil then local pickedmaterial = pickinfo.surface:GetMaterial() if pickedmaterial~=nil then rendermode = pickedmaterial:GetDecalMode() end end mtl = Material:Load("Materials/Decals/BombCrater.mat") end local decal = Decal:Create(mtl) decal:AlignToVector(pickinfo.normal,2) decal:Turn(0,0,Math:Random(0,360)) decal:SetScript("Scripts/Objects/Effects/BulletMark.lua") if mtl~=nil then mtl:Release() end decal:SetPosition(pickinfo.position) decal:SetParent(pickinfo.entity) --Apply global scaling local mat = decal:GetMatrix() mat[0] = mat[0]:Normalize() * scale mat[1] = mat[1]:Normalize() * scale mat[2] = mat[2]:Normalize() * scale decal:SetMatrix(mat) decal:EmitSound(self.sound.ricochet[math.random(#self.sound.ricochet)],30) self.entity:Release() else self.entity:SetPosition(targetpos) end else self.entity:SetPosition(targetpos) end if Time:GetCurrent()-self.starttime>self.lifetime then self.entity:Release() end end function Script:Explode() self.entity:EmitSound(self.sound.ricochet[math.random(#self.sound.ricochet)],30) self.emitter[0]:Show() self.emitter[0]:SetPosition(self.entity:GetPosition(true)) self.emitter[0]:Reset() self.emitter[0]:Play() self.emitter[1]:Show() self.emitter[1]:Reset() self.emitter[1]:SetPosition(self.entity:GetPosition(true)) self.emitter[1]:Play() self.emitter[2]:Show() self.emitter[2]:Reset() self.emitter[2]:SetPosition(self.entity:GetPosition(true)) self.emitter[2]:Play() end function Script:Collision(entity, position, normal, speed) self:Explode() end ok so far so good i hope you have fun. at the moment i think the scripts can be better written... for sure the Ammo script because it use the raycast to detect impact. i build in a collision line additional but this is not a perfect solution because the decal works only on pick ok changes from you are welcome in this post
- 1 reply
-
- 2
-
Sorry for the question in this old post this script search every near entity is this right? If i use this on my mortar then it shoots also the merc soldier and not only enemy (player) so i have to change the „turretSearchHook“ is this right?
-
How did. you import it? Maybe a dump question
-
thanks Aggror for this hint i think i know where i can do this in the script. by the way thats the prjectile script: Script.movespeed=1000 Script.pickradius=0 Script.damage=10 Script.lifetime=20000 Script.enabled=false--bool "Enabled" function Script:Start() self.sound={} self.sound.ricochet={} self.sound.ricochet[1]=Sound:Load("Sound/Weapons/Explosion.wav") self.sound.ricochet[2]=Sound:Load("Sound/Weapons/Explosion.wav") self.sound.ricochet[3]=Sound:Load("Sound/Weapons/Explosion.wav") self.starttime=Time:GetCurrent() self.emitter={} --Debris emitter - This will throw chunks off of walls and make it look like they are breaking self.emitter[0]=Emitter:Create() self.emitter[0]:SetCollisionType(Collision.Prop)--Enables particle bouncing self.emitter[0]:SetMaterial("Materials/Effects/smoke.mat") self.emitter[0]:SetEmissionVolume(0.05,0.05,0.05) self.emitter[0]:SetColor(0.1,0.1,0.1,1) self.emitter[0]:SetVelocity(5.5,15,5.5,1) self.emitter[0]:SetParticleCount(5) self.emitter[0]:SetReleaseQuantity(5) self.emitter[0]:SetMaxScale(0.9) self.emitter[0]:SetDuration(1500) self.emitter[0]:SetAcceleration(0,-12,0) self.emitter[0]:SetLoopMode(false) self.emitter[0]:Hide() --Smoke emitter - This will provide a soft dust effect around bullet impacts self.emitter[1]=Emitter:Create() self.emitter[1]:SetColor(1,1,1,0.25) self.emitter[1]:SetMaterial("Materials/Effects/smoke.mat") self.emitter[1]:SetEmissionVolume(0.1,0.1,0.1) self.emitter[1]:SetVelocity(0.3,0.3,0.3,1) self.emitter[1]:SetParticleCount(8) self.emitter[1]:SetReleaseQuantity(3) self.emitter[1]:SetMaxScale(15) self.emitter[1]:SetDuration(3800) self.emitter[1]:AddScaleControlPoint(0,0.5) self.emitter[1]:AddScaleControlPoint(1,1) self.emitter[1]:SetRotationSpeed(10) self.emitter[1]:SetLoopMode(false) self.emitter[1]:Hide() --Smoke emitter - This will provide a soft dust effect around bullet impacts self.emitter[2]=Emitter:Create() self.emitter[2]:SetColor(1,1,1,0.25) self.emitter[2]:SetMaterial("Prefabs/Effects/Explosion/explosion.mat") self.emitter[2]:SetEmissionVolume(0.1,0.1,0.1) self.emitter[2]:SetVelocity(0.3,0.3,0.3,1) self.emitter[2]:SetParticleCount(1) self.emitter[2]:SetReleaseQuantity(1) self.emitter[2]:SetMaxScale(25) self.emitter[2]:SetDuration(2500) self.emitter[2]:AddScaleControlPoint(0,0.5) self.emitter[2]:AddScaleControlPoint(1,1) --self.emitter[2]:SetRotationSpeed(10) self.emitter[2]:SetLoopMode(false) self.emitter[2]:Hide() end function Script:Enable()--in if self.enabled==false then self.enabled=true end end function Script:FindScriptedParent(entity,func) while entity~=nil do if entity.script then if type(entity.script[func])=="function" then return entity end end entity = entity:GetParent() end return nil end function Script:UpdateWorld() if self.enabled==false then return end if self.entity:Hidden() then return end local pickinfo=PickInfo() local pos = self.entity:GetPosition(true) local targetpos = Transform:Point(0,0,self.movespeed/60.0 * Time:GetSpeed(),self.entity,nil) local result = self.entity.world:Pick(pos,targetpos,pickinfo,self.pickradius,true,Collision.Projectile) if result then local enemy = self:FindScriptedParent(pickinfo.entity,"Hurt") if enemy then if self.owner then --if self.owner.teamid==enemy.script.teamid then -- result=false --end end if result then if enemy.script.health>0 then enemy.script:Hurt(self.damage,self.owner) end end end if result then self:Explode() --Bullet mark decal local mtl local scale = 2 if enemy~=nil then mtl = Material:Load("Materials/Decals/wound.mat") scale = 0.1 else if pickinfo.surface~=nil then local pickedmaterial = pickinfo.surface:GetMaterial() if pickedmaterial~=nil then rendermode = pickedmaterial:GetDecalMode() end end mtl = Material:Load("Materials/Decals/BombCrater.mat") end local decal = Decal:Create(mtl) decal:AlignToVector(pickinfo.normal,2) decal:Turn(0,0,Math:Random(0,360)) decal:SetScript("Scripts/Objects/Effects/BulletMark.lua") if mtl~=nil then mtl:Release() end decal:SetPosition(pickinfo.position) decal:SetParent(pickinfo.entity) --Apply global scaling local mat = decal:GetMatrix() mat[0] = mat[0]:Normalize() * scale mat[1] = mat[1]:Normalize() * scale mat[2] = mat[2]:Normalize() * scale decal:SetMatrix(mat) decal:EmitSound(self.sound.ricochet[math.random(#self.sound.ricochet)],30) self.entity:Release() else self.entity:SetPosition(targetpos) end else self.entity:SetPosition(targetpos) end if Time:GetCurrent()-self.starttime>self.lifetime then self.entity:Release() end end function Script:Explode() self.emitter[0]:Show() self.emitter[0]:SetPosition(self.entity:GetPosition(true)) self.emitter[0]:Reset() self.emitter[0]:Play() self.emitter[1]:Show() self.emitter[1]:Reset() self.emitter[1]:SetPosition(self.entity:GetPosition(true)) self.emitter[1]:Play() self.emitter[2]:Show() self.emitter[2]:Reset() self.emitter[2]:SetPosition(self.entity:GetPosition(true)) self.emitter[2]:Play() end
-
Hi, the last weeks in office are very bussy. But today i have some time to work on my project. In Akt 3 i would imlement a Mortar. I found a nice free model that i rework in blender and exported as mdl file also i searched for some sounds and mixed them together. For the sound i use "Audacity" becaus i get some errors in leadwerks with this sound i converted sounds with "Audio online converter" then i work on the scirpts. i use some parts from einlanders grenade script. and changed the projectile script and saved it to Mortal Ammo script. at the moment it is a little buggy and i dont know what i have to chage. i think the problem is in this part: if bullet~=nil then bullet:Show() bullet:SetFriction(10000,10000) bullet:SetCollisionType(Collision.Projectile) bullet:SetPosition(self.muzzle:GetPosition(true),true) bullet:SetRotation(self.muzzle:GetRotation(true),true) bullet:SetMass(1) Force = Vec3(0,3000,0) bullet:AddForce(Force) if bullet.script~=nil then bullet.script.owner = self if type(bullet.script.Enable)=="function" then bullet.script:Enable() end bullet:Turn(Math:Random(-3,3),Math:Random(-3,3),0) the bullet is not always transformed into an explosion when it hits the ground. If it hits the player, then it always works. here is the result. Sometimes it is funny how crazy the bullet goes. But now i have to look video with my daughter so i will work later on it. if anyone knows how i align the force at the distance of the player, about help or hints i would be glad. Also on a note why the bullet does not always explode on the ground, I would be glad. As always sorry for my english. By the way Act 3 is progressing. Below are a few pictures.
-
Creating a river with the Spline Tool from Aggror. I love this feature. Too bad that there is no possibility to see the result in the editor Edit: and many thanks for shadmars great shader sorry forget this
-
-
mhm i geht now this error in steam and leadwerks will not run.. i dont know if bitdefender deleted a file? for 2 days everythins funktion fine
-
Yes, at the moment i make some fine tunig in the Map "intro" (--> now if the Helicopter lift up the C4 explode) . Looks really nice in my eyes ) and Akt1 Part 2 i will first finish clean with the journal text. After that i can upload it to this
-
[solved] Need Help showing difuse texture using cheapwater.lua script
burgelkat replied to burgelkat's topic in Programming
-
i have a fx-explosion animation converted in 54 pictures now i would use the cheap water lua to display the explosion. this is the Script (edited) from the cheap Water.lua (Workshop) but this script use the normals. What can i do that it use the difuse texture ? -- Make this the material you used on your face. Script.Material = ""--path function Script:Start() self.textures = { } --(old) Fetch workshop animated water normals(old) for x=0,9,1 do local name = "footagecrate-simpleexplosion22_"..x..".tex" self.textures[x] = Texture:Load("Materials/Effects/Explosion/"..name) end for x=0,54,1 do local name = "footagecrate-simpleexplosion22_"..x..".tex" self.textures[x] = Texture:Load("Materials/Effects/Explosion/"..name) end -- Load material --self.mat = Material:Load(self.Material) self.mat = self.entity:GetMaterial() self.entity:SetMaterial(self.mat) self.model = self.entity self.index=0 end function Script:UpdateWorld() -- Animate normals for texture1 for material if self.index > 54 then self.index=0 end local count = 0 self.index=self.index+Time:GetSpeed()*0.25 count=math.floor(self.index) if self.mat ~= nil then self.mat:SetTexture(self.textures[count],1) end end i have build a spirtesheet too but i have no control over the start picture. iIf I load the material over a script, then it may happen that the explosion starts in the middle. Therefore I can not use the firepit shader. or an ermitter does not work that way. So I had the idea to try the single pictures. sorry for the english i hope you understand what i mean and someone can help by the way this is a nice webside: https://vfx.productioncrate.com/explosion-vfx-categories.html#_ga=2.63300844.238680612.1515842131-1939002152.1515230501
-
It may be a stupid question, but what is better for the performance: opening and closing a door with animation or using open close script?
-
Really well done. I like it.
-
Hi , Currently I'm planning the next level for Behind Enemy Lines. Since the player has to do part of the level with a sniper rifle, a little preliminary work had to be done. So, Here's my way to tackle this topic with the Addon "FPS Weapon Pack": The tutorial from tipforeveryone was very helpful to me. You can find it here https://www.leadwerks.com/community/blogs/entry/1775-realistic-sniper-rifle-scope-in-lua/ i downloaded a Scope frome here :http://www.cadnav.com/3d-models/model-36647.html and put it as a child to the "vwep m4" and saved it as a prefab "vwep m4_sniper" it should be look like this Now you have to ajust the scope But for the scope script to work, an empty script must be inserted in the following places. Thanks to Macklebee for this hint! Now you have to change 2 scripts 1. fpsgun.lua 2. fpsplayer.lua 1. fpsgun.lua this script i saved under "FPSGun_Sniper.lua" then this video helps a lot :https://www.youtube.com/watch?time_continue=628&v=3OqwQSP-2FU thanks to BluHornet place this in your fpsgun_sniper.lua Script.offsetNor=Vec3(0,0,0) Script.offsetADS=Vec3(0,0,0)--Vec3 "Offset ADS" the next line put after the function Script:Start() self.offsetNor = self.offset self.hasZoom=true self.hasZoom=true (or false) has been inserted because the ironsight will be active in every weapon, but at Grenade or something else i did not want this. Since I have difficulty with the sway of the weapon and I have no solution for it currently, I commented under function Script: Draw () the following lines out: --self.swayspeed = Math:Curve(speed,self.swayspeed,20) --self.swayspeed = math.max(0.5,self.swayspeed) --self.amplitude = math.max(2,Math:Curve(speed,self.amplitude,20)) now its time to change the fpsplayer.lua 2. fpsplayer.lua this line put in at the beginning Script.ADSmode=false next place the following lines under the function Script:UpdateWorld() if self.weapons[self.currentweaponindex]~=nil and self.weapons[self.currentweaponindex].hasZoom then if self.ADSmode == false then self.camera:SetFOV(70) self.weapons[self.currentweaponindex ].offset = self.weapons[self.currentweaponindex ].offsetNor end if self.ADSmode == true then self.camera:SetFOV(20) self.weapons[self.currentweaponindex ].offset = self.weapons[self.currentweaponindex ].offsetADS end end and this also in this function (i put this after a lince called "--fire weapon" if window:MouseHit(2) then if self.weapons[self.currentweaponindex]~= nil then if self.ADSmode == false then self.ADSmode=true else self.ADSmode=false end if self.sound.pickupweapon~=nil then self.sound.pickupweapon:Play() end end end if you do not want the ironsight by jump, reload, or carry an item, then paste those lines at the right places self.ADSmode=false Since the original crosshair disturbs me in the ironsight, I have inserted "and self.ADSmode==false then" in the function Script:PostRender(context) it should looks like this if self.health>0 then if self.canUse==true and self.carryingEntity == nil then local pickUpX = math.floor((context:GetWidth() - self.image.hand:GetWidth()))/2 local pickUpY = math.floor((context:GetHeight() - self.image.hand:GetHeight()))/2 context:SetBlendMode(Blend.Alpha) context:DrawImage(self.image.hand, pickUpX, pickUpY) else if self.carryingEntity==nil then if self.weapons[self.currentweaponindex]~=nil then if self.image.crosshair and self.ADSmode==false then local crossHairX = math.floor((context:GetWidth() - self.image.crosshair:GetWidth()))/2 local crossHairY = math.floor((context:GetHeight() - self.image.crosshair:GetHeight()))/2 context:SetBlendMode(Blend.Alpha) context:DrawImage(self.image.crosshair, crossHairX, crossHairY) end end end end What follows now are the individual settings for each weapon to get an Ironsight. M4 Sniper: in the script: the sniper M4 looks now like this the m4 without scope in the script: it should look like this the shotgun in the script the shotgun look like this the pistol in the script the pistol look now like this So, that was my solution. But if you have even better settings, feel free to write in this blog. I hope that this blog helped a bit. Especially to save time to find the settings for the Ironsight. Have fun. Greetings burgelkat
-
thanks josh .. thats true i am not great at 2D design. I should better stay with the simple one.
-
Hi, Hello everybody, here is a little blogg. Due to some feedback, I'm thinking about how a better HUD could look like. Below is the Old HUD, and then the new HUD. What do you think? Or how can a HUD look more appealing to this game?
-
The new look (Galery picture) look good. It would be interesting to draw the hole thing (tree and decal) with the vegetation tool. Is this possible?
-
After the uploading the new version to the GameLauncher this Version not function. The exe ist updated the project is updated too. There is the "GetStyle" Error. It seems that ohter creators have the same problem. Please use the Dropbox link for the Standalone Version. https://www.dropbox.com/s/b6a9hc5hf5jgygs/BehindEnemyLines.zip?dl=0 The Game Launcher Version now function