Jump to content

burgelkat

Members
  • Posts

    203
  • Joined

  • Last visited

Everything posted by burgelkat

  1. My new helicopter flight path in a test map . It will be an event in the Project Mortifer. The Flightpath is now smooth https://www.dropbox.com/s/zgxm9az2uk3cr9u/TestScripts%202016-10-18%2022-19-05-61.avi?dl=0
  2. it looks that i have to change the model direction .... it is wrong
  3. Hallo, i need help with a script. Base is the platform lua. I use it with a helicopter. The Helicopter should flight the path and always change the rotation to the next target. the flight path function. (not yet smooth but this later on , at this time i dont know how to start, so that have to wait) Now the helicopter flight the pass, look at the next target... but the helicopter turns themself 180 degrees. so it looks he flight back what i do wrong? i hope someone can help me this is the code Script.enabled = true --bool "Enabled" Script.speed = 10 --float "Speed" Script.target = "" --entity "Target waypoint" Script.originPosition = nil Script.targetPosition = nil Script.currentPosition = nil Script.currentRotation = nil Script.moving = nil Script.oldMass = nil Script.pointtarget = nil--entity "Point target at" function Script:Start() self.oldMass = self.entity:GetMass() if self.enabled then if self.entity:GetMass()==0 then Debug:Error("Entity mass must be greater than zero.") end else self.entity:SetMass(0) end self.entity:SetGravityMode(false) self.entity:SetCollisionType(Collision.Scene) if self.target == nil then Debug:Error("No target assigned") end self:SetTarget(self.target) end function Script:SetTarget(newTarget) self.currentPosition = self.entity:GetPosition() self.originPosition = self.entity:GetPosition() self.targetPosition = newTarget:GetPosition() if self.pointtarget ~= nil then self.entity:Point(self.pointtarget) else self.target:GetRotation(nextStepRot.x, nextStepRot.y, nextStepRot.z, true) end self.distance = self.originPosition:DistanceToPoint(self.targetPosition) self.target = newTarget local pos = self.entity:GetPosition(true) local targetpos = self.target:GetPosition(true) local pin = pos - targetpos self.distance = pin:Length() pin = pin:Normalize() if self.joint then self.joint:DisableMotor() self.joint:Release() end self.joint=Joint:Slider(targetpos.x,targetpos.y,targetpos.z,pin.x,pin.y,pin.z,self.entity,nil) self.joint:EnableMotor() self.joint:SetMotorSpeed(self.speed) self.joint:SetAngle(-self.distance) end function Script:UpdatePhysics() if self.enabled then --Calculate movement local currentpos = self.entity:GetPosition(true) local targetpos = self.target:GetPosition(true) local d = currentpos:DistanceToPoint(targetpos) if d<0.1 then --When the target has been reached --self.entity:PhysicsSetPosition(self.targetPosition.x, self.targetPosition.y, self.targetPosition.z) --self.enabled = false self.component:CallOutputs("WaypointReached") --Check if the target that we have reached also has a target, which is then our new target/waypoint if self.target.script.target ~= nil then self:SetTarget(self.target.script.target) end end end end ----------------------------------------------------------------------------------- function Script:Enable()--in self.enabled = true self.entity:SetMass(self.oldMass) -- this line was missing [einlander] self.entity:AddForce(0,0.001,0) -- give it a tiny push to get it moving [einlander] end function Script:Disable()--in self.enabled = false self.entity:SetMass(0) end
  4. burgelkat

    The Garden

    Hello, The Garden V0.8 (Game Launcher) http://steamcommunity.com/sharedfiles/filedetails/?id=777488505 It´s not a Game You're stressed? You have no garden to relax? You have no time to get out ...Well, then take the chance and make a little walk. Have fun! I have fun to build this Minor updates regarding optics will surely come also a chance to toggle to night Feedback is appreciated and welcome Greetings Wolfgang
  5. Ok, how I did this. 1. I made a sprite sheet 6x6 Images ( if you have 36 different images they simulate the flow) there are two good programs search for texturepacker, or spritesheetpacker pay attention that the sprites have all the same position in the spritesheet. Only then it function 2. Use the plane from Fire pit (thanks to shadmar at this point) and the sprite-sheet shader in the material. change the images numbers in the shader. I see no fps losses. so you can use a lots of it to make a really nice looking scene. Look how the water flows. i like this scene. like in the real nature i can looking into a fire or waterfall for hours https://www.dropbox.com/s/umi4dm9fj87san1/Mortifer%202016-10-02%2014-50-47-42.avi?dl=0 https://www.dropbox.com/s/9d3a4tld93ojnoi/Mortifer%202016-10-02%2014-31-22-78.avi?dl=0 only one question i have: What is if i have a sprite sheet with 6x4. is there a chance to change the script that this sprite sheet can run ? (Edit: solved, thanks to macklebee) this is my end looking:
  6. My first Waterfall and here a small video https://www.dropbox.com/s/toc3ur3lc9h0siv/Mortifer%202016-10-01%2014-35-22-87.avi?dl=0
  7. I tried to work a little on the perfomance . I think it has become a little better . Moreover, worked on Akt2 on. The stay in the fishing village is close to completion . Then it's on to the military complex . Feel free to give me konstruktive feedback . I would be happy about that. Greetings Burgelkat
  8. Hi, after the Update with the betabuild i get now this error ? self.curResolution = Vec2(FG_window:GetWidth(), FG_window:GetHeight()) "fg_manager.lua" : 45 : attempt to call method 'GetWidth' (a nil value)" I haven't had a problem before the update. Is there something i have to change? Script.curResolution = Vec2(0,0) Script.scalar = Vec2(0,0) Script.engineFont = nil FG_window = nil FG_context = nil FG_LDown = false FG_LHit = false FG_DRAGITEMSLOT = nil FG_activeDropdown = nil FG_guiElements = {} FG_Types = { button = 1, label = 2, checkbox = 3, slider = 4, panel = 5, radio = 6, textbox = 7, dropdown = 8, image = 9, itemslot = 10, panel = 11, arealabel = 12 } FG_Layer = { background = 3, default = 10, front = 20 } function Script:Start() if FG_loadedTexts == nil then FG_loadedTexts = {} end FG_window = Window:GetCurrent() FG_context = Context:GetCurrent() self.engineFont = FG_context:GetFont() self.curResolution = Vec2(FG_window:GetWidth(), FG_window:GetHeight()) self:CalculateScalar() end function Script:GetResolution() return self.curResolution end function Script:SetResolution(res, changeScreenResolution) if changeScreenResolution then FG_window:SetLayout(0,0,res.x, res.y) end self.curResolution = Vec2(res.x, res.y) self:CalculateScalar() self:ApplyScalarToElements() end function Script:CalculateScalar() self.scalar = Vec2(self.curResolution.x / 1920, self.curResolution.y / 1080) end function Script:ApplyScalarToElements() for key, guiElement in pairs(FG_guiElements) do if guiElement:GetResolutionScaling()then guiElement:ApplyScalar(self.scalar) end end end function Script:AddElement(guiElement) local newLayer = guiElement:GetLayer() local guiCount = 0 for _ in pairs(FG_guiElements) do guiCount = guiCount + 1 end if guiCount > 0 then for i = 1, guiCount do if newLayer < FG_guiElements[i]:GetLayer() then table.insert(FG_guiElements, i, guiElement) break end if i == guiCount then table.insert(FG_guiElements, guiElement) end end else table.insert(FG_guiElements, guiElement) end end function Script:RemoveElement(guiElement) for i = 1, #FG_guiElements do if FG_guiElements[i] == guiElement then FG_guiElements[i]:Release() table.remove(FG_guiElements, i) break end end end function GetGuiElements(guiType) local elementsOfType = {} for key, guiElement in pairs(FG_guiElements) do if guiElement.type == guiType then table.insert(elementsOfType, guiElement) end --look through the panel items if guiElement.type == FG_Types.panel then for key, panelGUIElement in pairs(guiElement.children) do if panelGUIElement.type == guiType then table.insert(elementsOfType, panelGUIElement) end end end end return elementsOfType end function Script:UpdateWorld() FG_LDown = false FG_LHit = false if FG_window:MouseHit(1) then FG_LHit = true end if FG_window:MouseDown(1) then FG_LDown = true end for key, guiElement in pairs(FG_guiElements) do if guiElement.enabled then guiElement:Update() end end --You can incomment these code lines for quick testing of resolution swapping --SetLayout will change the window but not the guielements --SetResolution will change the window and the guielements if FG_window:KeyHit(Key.Q) then --FG_window:SetLayout(0,0,1920, 1080); self:SetResolution(Vec2(1920, 1080)) elseif FG_window:KeyHit(Key.E) then --FG_window:SetLayout(0,0,1440, 900); self:SetResolution(Vec2(1440, 900)) end end function Script:PostRender(context) for key, guiElement in ipairs(FG_guiElements) do if guiElement.enabled then guiElement:Draw() end end FG_context:SetFont(self.engineFont) end function Script:HideGroup(group) for key, guiElement in pairs(FG_guiElements) do if guiElement.group == group then guiElement.enabled = false end end end function Script:ShowGroup(group) for key, guiElement in pairs(FG_guiElements) do if guiElement.group == group then guiElement.enabled = true end end end function Script:Detach() for key, guiElement in ipairs(FG_guiElements) do guiElement:Release() end end
  9. Would it be possible that listeners pivot get a visuell distance /range indicator analogous to lights?
  10. Mortifer in Game Launcher: 2016-06-15 17:05:54 - Mortifer Akt1 Frames: 18042 - Time: 607515ms - Avg: 29.698 - Min: 0 - Max: 150 2016-06-15 17:19:55 - Mortifer Akt2 Frames: 20014 - Time: 614171ms - Avg: 32.587 - Min: 14 - Max: 86 If i play it through. I think its not so bad. Ok i will look if i can do something.
  11. mhm lt. fraps: 2016-06-13 21:57:43 -Mortifer Frames: 4138 - Time: 148437ms - Avg: 27.877 - Min: 15 - Max: 41
  12. I have learned much in Scripting and some Lua function as i worked on Akt2. So i implemented a primitive Loading Screen (not realy one but i looks in my eyes nice). Also the performance is better now because i released some entitys if they not longer used. Feedback is welcome. Also if something not function.
  13. i will try this with the next upload http://www.leadwerks.com/werkspace/topic/13944-error-map-file-version-40/
  14. Yes it is. World:SetTerrainQuality((System:GetProperty("terrainquality","2"))) if i change in the editor the settings from high to middle then it look like the game.
  15. This morning I wanted to try my updated version of Mortifer . Now I get this error ? My Project is updated. Initializing Lua... Lua sandboxing enabled. Executing file "D:/games/Steam/steamapps/common/Leadwerks Game Launcher/Scripts/Error.lua" Executing file "D:/games/Steam/steamapps/common/Leadwerks Game Launcher/Scripts/Main.lua" Executing file "D:/games/Steam/steamapps/common/Leadwerks Game Launcher/Scripts/GameRules.lua" Executing file "D:/games/Steam/steamapps/common/Leadwerks Game Launcher/Scripts/Specials/WidgetSprite.lua" Executing file "D:/games/Steam/steamapps/common/Leadwerks Game Launcher/Scripts/Specials/WidgetVolume.lua" Initializing OpenGL4 graphics driver... OpenGL version 451 GLSL version 450 Device: AMD Radeon R9 200 Series Loading map "D:/games/Steam/steamapps/common/Leadwerks Game Launcher/Maps/start.map"... Error: Map file version 42 not supported. Update this project in the project manager to get the latest executable, or recompile your game. Process complete. (Stand alone Game function without error)
  16. Hallo, in the Leadwerks Editor --> Perspective View the texture Looks Picture 1 if i start the Game it looks like Picture 2 What I have to adjust , so that the textures look like in the editor ? in my FPSPlayer Scritpt i added this codes so the game looks better but the terraintexture has pixels self.camera:SetMultisampleMode((System:GetProperty("multisample","4"))) World:SetTerrainQuality((System:GetProperty("terrainquality","2"))) World:SetWaterQuality((System:GetProberty("waterquality","2"))) World:SetLightQuality((System:GetProperty("lightquality","3"))) World:SetTessellationQuality(4) Camera:SetHDRMode(1) Texture:SetTrilinearFilterMode(3) Can someone help? It must be something with the terrainresolution. thanks and greetings Edit: It seems i can´t use Terrain Qualitiy high in game?
  17. Mortifer V0.2 Akt1_V1.0 WASD - Move E - Use Space - Jump It is not finished by far . Akt1_V1.0 - After you get all Quest-Items, you can use the black car for end Akt1 or the blue car for Akt2 (still under construction) Akt2_V0.2 For enter Akt 2 use the blue car. (i enabeld it at start so you don´t play akt 1 through) for changing the sky to night then use the ground of the tend (its enabled after using the fishing rod) follow the small road then you came to the fishing town.
  18. Ok.. now it function in the game-launcher in my player-script i put in: --Create a camera self.camera = Camera:Create() self.skybox = Texture:Load("Materials/Sky/TropicakSunnyDay.tex") self.camera:SetSkybox(self.skybox) self.camera:SetFOV(70) self.camera:SetRange(0.05,1000) self.camera:SetMultisampleMode((System:GetProperty("multisample","1"))) and i changed this in my script with that i will change the sky-texture (instead of: local player = self:FindEntity("fpsplayer") i use local player = self:GetPlayer("fpsplayer") ______________________________________________________________________ function Script:GetPlayer() for i = 0, world:CountEntities()-1 do if world:GetEntity(i):GetKeyValue("type", "") == "player" then return world:GetEntity(i) end end end function Script:Change()--in self.skybox = Texture:Load("Materials/Sky/SunSet.tex") local player = self:GetPlayer("fpsplayer") --"fpsplayer" in this case would have to be the name of the player in the editor. if player ~= nil then player.script.camera:SetSkybox(self.skybox) end directionallight = DirectionalLight:Create() directionallight:SetRotation(-18.83,-54.375,-118.364) directionallight:SetColor(1.68,0.67,0) world:SetAmbientLight(0.02,0.02,0.02) return true end A upload of the correct version is now published. thank you so much
  19. @Crazycarpet: Wow ...first, thank you very much for your feedback . Learned something again. I will try it. Your feedback definitely makes sense . Feedback later. @Macklebee: Thanks for your Feedback too. You are right, because my entry with "world-Command" function in the stand alone version of the game and in the game engine without an error.... i did not thought about it to define world. (I hope you understand what i wrote). I will try your booth solution. By the way I am glad that there are someone like you who gives the right "food for thought" (Denkanstoß) . Whenever I think I understand something with Lua I notice that I know nothing
  20. After some problems with the Game.exe ( crash ) I have at least a couple of solutions found . None good solutions at the end but still the game works. On the one hand I had the collision system in the vegetation system off (if i activate the collision with paintet rocks and put a prefab (barrel with shape) in it, the game crashed. if i delete the barrel the collision function in the vegetation system but then i can´t implement my quest idea. So i deactivated the collsion in the vegetation system and now the barrel with shape (so i can take it in my hand) function in my map (Akt2) The other Problem is my idea with the skybox. If i try the code from some threads i found or with your help (look at this post: http://www.leadwerks.com/werkspace/topic/14518-problem-with-skybox/ ) in my game engine and in the stand-alone-game everything function fine but not in the game launcher. Because my upload time is very long i cant try my solutions (uploadtime 4 hours i have to wait until november then i get a faster DSL) so i uploaded in dropbox the stand-alone-game from Mortifer (i hope it function for you). So you can see my idea. https://www.dropbox.com/sh/0njw2ysdoz56qi4/AAClrSNmf6S0WoR6bVkXhrpSa?dl=0 (Use the blue car to go directly to Akt2) About prepares another thing to worry me is wy in game-launcher the "fps" are good in the stand alone game its slower. If someone has an explanation, I would be glad about. So thats my entry for now (and as always, sorry for my english) . greetings burgelkat Edit: i forgot something, one thing that make me cracy is the ermitter. Sometimes the placed ermitter has no flow (i dont know how i can describe it ... the ermitter "puffs like a train" .. if i change the duration with another number and change it back, the ermitter function right.
  21. Mortifer V0.2 Akt1_V1.0 WASD - Move E - Use Space - Jump It is not finished by far . Akt1_V1.0 - Use the Scoreboard for the first instruction - After you get the certificate, you can use the car or you can play around at the shooting-range Akt2_V0.1 For enter Akt 2 use the blue car. (i enabeld it at start so you don´t play akt 1 through) At the camping place: follow the instructions. for changing the sky use first the fishing rod for changing the sky to night then use the ground of the tend follow the small road then you came to the fishing town.
  22. Mhm, in the game engine everything seems ok and the skybox changes the texture. But in the game launcher if i play it then i get a error Lua Error: [string "xxxxxxxxevening.lua"]:17: attempt to call method 'SetSkybox' (a nil value) what i do wrong? (Edit: It seems i cant work with world:SetSkybox(self.skybox) in the game launcher.) I build a test-scene. in this scene the script function. Wy not in the game-launcher? i hope someone can help me https://www.dropbox.com/s/lvat7payk7spd9f/TestSky.zip?dl=0
  23. ok . And this is the other script function Script:Show()--in self.skybox = Texture:Load("Materials/Sky/SunSet.tex") world:SetSkybox(self.skybox) directionallight = DirectionalLight:Create() directionallight:SetRotation(-18.83,-54.375,-118.364) directionallight:SetColor(1.68,0.67,0) world:SetAmbientLight(0.02,0.02,0.02) return true end
  24. That was the only thing that worked well with the scripts. I know the link you postet. But I did not know how to start here. I get error here. Do I need to install this line of code in the Script FPSPlayer ? Edit: ups my mistake!! The Texture has different Name as my Material. !!Thanks a lot!! --------------------------------------------- In the FpsPlayer- Script: --Create a camera self.camera = Camera:Create() self.skybox = Texture:Load("Materials/Sky/TropicakSunnyDay.tex") self.camera:SetSkybox(self.skybox) self.camera:SetFOV(70) self.camera:SetRange(0.05,1000) self.camera:SetMultisampleMode((System:GetProperty("multisample","1"))) ________________________________ so far so good. Now I just have to change the additional load of a new texture in another script
  25. I have a problem with my skybox. After I was not satisfied with a created sphere with a sky texture (and then change it with show and hide) I wanted to create a skybox in the fpsplayer script . This works well so far . If I activate another script then the sky texture changes . but as you recognize the pictures I have now a problem with the reflection . What am I doing wrong? If i look straight to the horiziont then it looks ok (1. picture) If i look down or in the sky then the mirrow effect is away (2. picture) This is the Code i put in the fpsPlayer Script --Create skybox sky = Model:Create() --just render a plane and project cubemap onto it local surface = sky:AddSurface() surface:AddVertex(-0.5,-0.5,0, 0,0,-1) surface:AddVertex(0.5,-0.5,0, 0,0,-1) surface:AddVertex(0.5,0.5,0, 0,0,-1) surface:AddVertex(-0.5,0.5,0, 0,0,-1) surface:AddTriangle(2,1,0) surface:AddTriangle(0,3,2) --position in front of camera but far out to near camera clip plane sky:SetPosition(self.camera:GetPosition()) sky:SetRotation(self.camera:GetRotation()) sky:Move(0,0,self.camera:GetRange().y-50) sky:SetScale(self.camera:GetRange().y*10) sky:SetParent(self.camera) -- and paint it skymat=Material:Load("Materials/Sky/Tropical.mat") sky:SetMaterial(skymat) And this is my script with this i change the (directional light, skytexture and ambientelight) function Script:Show()--in skymat=Material:Load("Materials/Sky/SunSet.mat") sky:SetMaterial(skymat) directionallight = DirectionalLight:Create() directionallight:SetRotation(-18.83,-54.375,-118.364) directionallight:SetColor(1.68,0.67,0) world:SetAmbientLight(0.02,0.02,0.02) return true end If you have a different solution especially how I change the texture of the scene-root ( skybox ) I would be very happy . thanks for your help
×
×
  • Create New...