Einlander
-
Posts
778 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Einlander
-
-
Could be related to this bug http://www.leadwerks.com/werkspace/topic/9580-memory-allocation-error/ . If i run my game in the editor it's fine, If it's run from command line it crashes. I had to lower the resolution of EVERY single texture to make this go away. That's not really the solution I really wanted to do. Hopefully there is a way to fix both the out of video memory and mem alloc issues.
-
Sorry to necropost, but i still have this issue even on the newer beta builds. Project I use to test it. https://mega.co.nz/#!QNkH0BzR!I_ZSzLwc_YxCXUaUflnp_AA9msSF6fR4i3D_HQ9j31w
To be Exact my cpu is a Radeon R7 260x
-
I mad a motel room and made the entire room a child of a pivot. When I add a script to one of the csg's the physics and sometimes the light rendering gets misplaced.
Here is a Video of it's creation and it happening. :
-
Reading through this thread I realized the most obvious question has not been asked. Are you actually setting the keyvalue to the entities you want to find? The leadwerks does not actually set this for you, it needs to be set in script. The fpsplayer already has this in the script.
-
Any chance we can get the buffer class out in the documentation? Can we use this to draw pixels directly to the screen?
-
@ gamecreator understood.
-
I haven't looked at nor do I know how it's done with the steam API, but please do your steam checks exhaustively. I have many games on steam that simply will not run because the steam network went down or the steamworks API is undergoing maintenance. 7 Days to Die is one such game. You can have steam running, be online, but the game will not run because steam was having problems.
-
Multiplayer on lua, you'll be forging new ground for Leadwerks. I can point you in the general direction of how to get the libraries loaded but not much else. http://www.leadwerks.com/werkspace/blog/120/entry-1182-luajit-awesome-luajit-enet-loaded/
I'll be revisiting the topic of multiplayer when my game nears functional stability.
-
Then right click on stairs and click save as prefab.
-
Some questions about your project:
Is it lua based or c++?
Single player or multiplayer?
Will level design be done in Leadwerks using prefabs and csf/brushes, or will it need to be done in a 3d modeler?
You say it's modern but not futuristic, will it be real life gritty, or real life cartoony like team fortress 2.
Is there a time of completion goal date?
I have more questions but i can't think of the rest of them currently.
- 1
-
Lol, it resolved itself. But I now get the unsupported map version error, so I'll wait till there is a solution for that.
-
He said that he made his level smaller so he could use 1 spotlight to light his level. He can get the Sam effect on a larger level with 1 directional light instead. I didn't say spotlights were useless. In his usage case there was a simpler more efficient method to accomplish the same thin. Spotlights are good for small areas, but not to light your entire level.
- 1
-
Couldn't you use a directional light to light up your scene with shadows, instead of one spotlight? Or changing the color of the scene roots ambient light? I too want to see the return of selective light mapping and some more optimizations in engine performance, but sometimes its a good idea to start from the beginning optimizing your level.
- 1
-
Any chance we can create our own converters for the editor and register file formats for the editor to handle?
-
SOMEONE THINK OF THE CHILDREN!!! BAN THIS SICK FILTH!!! Oh yeah, some one should add this.
-
This might be of help, http://www.leadwerks.com/werkspace/topic/7958-navigation-without-physics/ they find a have mesh function in the c++ API that gives you points.
-
There was an update within the last few hours, and since then i have not been able to launch nor install leadwerks.
-
Its there,
Debug:Error(tostring(math.abs(-5)))
Pops up with 5
- 1
-
You can use Delgine/Deled http://www.delgine.com/index.php?filename=product_deled or QuArk http://quark.sourceforge.net/ (both opensource) to create you're level and light map it. Then you can export your map and texture (once you download the proper exporter, neither of them export to fbx but obj is an option) with the lights pre-baked.
-
I wrote this exact thing last week in lua, I needed to generate some mesh terrains that I could modify in real time. To make the faces/triangles, I did some linear calculations I use to use on my graphics calculator to turn a 1*X matrix into a simulated 3d matrix
Script.null = 0 -- choice "Terrain Generator" "By Einlander"
-- The size of the terrain in squares, so an extra vertex will be added in both directions, so a 10x10 square will have 11x11 vertices
Script.TerrainSize = 10 -- int "Terrain Size"
-- 100 is the sweet spot
-- 1 is the size the leadwerks edior measurment
Script.TerrainSquareSize = 10 -- int "Terrain Square Size"
function Script:Start()
-- measure performance
local timer= Time:Millisecs()
local timer2= Time:Millisecs()
-- terrain size squared
System:Print("Starting ")
timer2 = Time:Millisecs()
System:Print("Generating terrain ")
self.terrain = self:MakeTerrain(self.TerrainSize)
System:Print("Done "..(Time:Millisecs()-timer2)/1000)
timer2 = Time:Millisecs()
System:Print("Modify terrain ")
self.terrain = self:ModifyTerrainVertex(self.terrain, 2,2,15)
self.terrain = self:ModifyTerrainVertex(self.terrain, 2,3,15)
System:Print("Done "..(Time:Millisecs()-timer2)/1000)
timer2 = Time:Millisecs()
System:Print("Generating Collision Mesh ") -- this is where all the time goes
local shape = Shape:PolyMesh(self.terrain:GetSurface(0)) -- has to be a poly mesh, unless it's perfectly flat.
System:Print("Done "..(Time:Millisecs()-timer2)/1000)
self.terrain:SetShape(shape)
self.terrain:SetCollisionType(Collision.Scene)
self.terrain:SetPosition(0,0,0)
System:Print("Loading Complete "..(Time:Millisecs()-timer)/1000)
end
function Script:UpdateWorld()
end
function Script:MakeTerrain(TerrainSize) -- capable of creating non square terrain with slight modification
local terrain = nil
terrain = Model:Create()
terrain:SetColor(0.5,0.5,0.5)
local surface = terrain:AddSurface()
-- add vertexes
System:Print("Generating Vertices")
for TerrainWidth=0 , TerrainSize do
for TerrainDepth=0 , TerrainSize do
surface:AddVertex(TerrainWidth*self.TerrainSquareSize,0,TerrainDepth*self.TerrainSquareSize, 0,1,0)
end
end
-- add triangles
local currentrow = 0
System:Print("Generating faces")
for trinaglestrip=0 , ((TerrainSize)^2)+(TerrainSize-1) do
surface:AddTriangle(trinaglestrip,trinaglestrip+1,trinaglestrip+TerrainSize+1)
surface:AddTriangle(trinaglestrip,trinaglestrip+TerrainSize+1,trinaglestrip+TerrainSize)
end
-- This is where you would add the uv's
System:Print("")
return terrain
end
function Script:ModifyTerrainVertex(terrain, X,Y,Elevation) -- Raises individual vertices remeber there is one extra vertex in both directions.
local tempterrain = terrain
local tempsurface=tempterrain:GetSurface(0)
--!!!GET THE VERTEX POSITION FIRST, THEN MODIFY THE VALUES!!!
--(X*(self.TerrainSize+1))+(Y)) the linear index
tempvertexposition = tempsurface:GetVertexPosition((X*(self.TerrainSize+1))+(Y))
tempsurface:SetVertexPosition((X*(self.TerrainSize+1))+(Y),tempvertexposition[0],Elevation,tempvertexposition[2])
return tempterrain
end
Attach it to a pivot and run. It generates a collision polymesh, that's where the slowdown is. Otherwise, if you don't need to generate a collision mesh, it goes so much faster. It even has a method to manipulate the vertex elevation.
-
I am trying to implement a molotov cocktail ala Left 4 Dead in lua for Leadwerks. I think I have most of it figured out, but i'm having some issues with the collisions. I would like to be able to throw one at my feet and not have the particles interact with the player.
Pardon my spaghetti code:
function Script:Start()
self.enabled = true
self.exploded=false
self.particlelist={}
self.particalspawntime=.03
self.collisonpoint = Vec3()
self.particlecount=15
self.particlecounter=0
self.particlecounter2=0
self.timer=0
self.settle = true
self.settletimer = 0
self.settletime = .05
self.burn=false
self.burntime=10
self.burntimer=0
self.burnout=false
self.burnouttime=.1
self.burnouttimer=0
--self.burnaoutparticlecounter=self.particlecount
end
function Script:UpdateWorld()
end
function Script:UpdatePhysics()
if (self.exploded==true) and (self.enabled==true) and (self.particlecounter < self.particlecount) then
local timer2 = Time:Millisecs()
if ((timer2 -self.timer)/1000)>self.particalspawntime then
--Debug:Error("Times Up")
-- create box
local model = Model:Box()
-- add to particle list
table.insert(self.particlelist,model)
--model:SetPosition(self.entity:GetPosition())
model:SetPosition(self.collisonpoint.x,self.collisonpoint.y,self.collisonpoint.z)
model:SetColor(0.0,0.0,1.0)
model:SetScale(.5,.1,.5)
model:SetFriction(0,.3)
-- create collision
local shape = Shape:ConvexHull(model:GetSurface(0))
--local shape = Shape:PolyMesh(model:GetSurface(0))
model:SetShape(shape)
model:SetCollisionType(Collision.Prop)
--set mass
model:SetMass(5)
model:AddForce(math.random(300,500),0,math.random(300,500),false)
--model:PhysicsSetPosition(self.collisonpoint.x,self.collisonpoint.y+1,self.collisonpoint.z,.2)
self.particlecounter = self.particlecounter + 1
if self.particlecounter == self.particlecount then
self.settle = true
self.settletimer = Time:Millisecs()
self.particlecounter2=#self.particlelist
--self.enabled = false
end
self.timer = Time:Millisecs()
end
end
if (self.enabled == true) and (self.burnout == true) then
--Debug:Error("burnout begin")
end
if (self.enabled == true) and (self.exploded==true) and (self.settle == true) and (self.particlecounter2 > 0) then
local timer2 = Time:Millisecs()
if ((timer2 -self.settletimer)/1000)>self.settletime then
--Debug:Error(((timer2-self.settletimer)/1000))
local mdl= self.particlelist[self.particlecounter2]
--mdl:SetCollisionType(Collision.Prop)
--mdl:SetRotation(0,mdl:GetRotation().y,0)
--mdl:AddForce(math.random(1,1),math.random(1,1),math.random(1,1),false)
mdl:PhysicsSetPosition(mdl:GetPosition().x,mdl:GetPosition().y+.5,mdl:GetPosition().z,.1)
mdl:SetCollisionType(Collision.Debris)
--mdl:Release()
--table.remove(self.particlelist,self.particlecounter2)
self.settletimer = Time:Millisecs()
self.particlecounter2 = self.particlecounter2-1
end
end
if (self.enabled == true) and (self.exploded==true) and (self.burn == true) and (#self.particlelist > 0) then
local timer2 = Time:Millisecs()
if ((timer2 -self.burntimer)/1000)>self.burntime then
--local mdl= self.particlelist[#self.particlelist]
--table.remove(self.particlelist,#self.particlelist)
--mdl:Release()
--self.burntimer = Time:Millisecs()
self.burnout=true
self.burn=false
self.burnouttimer = Time:Millisecs()
end
end
if (self.enabled == true) and (self.burnout == true) and (self.exploded==true) and (self.burn == false) and (#self.particlelist > 0) then
local timer2 = Time:Millisecs()
if ((timer2 -self.burnouttimer)/1000)>self.burnouttime then
local mdl= self.particlelist[#self.particlelist]
table.remove(self.particlelist,#self.particlelist)
mdl:Release()
self.burnouttimer = Time:Millisecs()
end
end
if (self.enabled == true) and (self.burnout == true) and (self.exploded==true) and (self.burn == false) and (#self.particlelist <= 0) then
self.enabled=false
collectgarbage()
self.entity:Release()
end
if (self.enabled == true) and (self.exploded==true) and (self.settle == true) and (self.particlecounter2 <1) and (self.burn==false)then
self.settle =false
self.burn=true
self.burntimer = Time:Millisecs()
end
end
function Script:Collision(entity, position, normal, speed)
if (self.exploded==false) and (self.enabled == true) and (speed > 8) then
--Debug:Error("break "..tostring(speed))
self.collisonpoint = self.entity:GetPosition()
self.entity:SetCollisionType(Collision.Debris)
self:Detonate()
end
end
function Script:Detonate() --in
if self.exploded==false and (self.enabled == true) then
self.exploded=true
self.timer = Time:Millisecs()
self.entity:Hide()
end
end
--This function will be called when the entity is deleted.
function Script:Delete()
collectgarbage()
end
--This function will be called when the last instance of this script is deleted.
function Script:Cleanup()
collectgarbage()
end
This was designed to be used with the fpsplayer.
Instructions:
- Attach the script to an object with a collision type of prop.
- Set the mass to something between 1 and 5 so you can pick it up.
- The object needs to hit an object at a speed greater than 8
The object on impact will on impact dissapear and blocks will explode out of it.
It will "burn" for 10 seconds, then it will clean up, removing the particles oldest to newest.
When there are no more molotovs in the scene it will clean up after itself.
It also attempts to flow down slopes for a little distance to simulate liquids.
THE REQUEST:
Got to bold it for the TL;DR crowd.
Is there a way to make it interact with the world but not interact with the character controller?
ToDo: Replace blocks with Emitters to similate fire, create trigger areas to hurt player when inside.
- Attach the script to an object with a collision type of prop.
-
Just don't initialize steam in the init of the game and remove the steam.dll. Tada: steam independance..
Not possible in the lua version. The game doesn't even attempt to run. In windows, the console version immediately terminates.
-
I have modular rooms repeated throughout my map, I would like to move some sub rooms in the prefab and then run through the level, experiment with the placement of destructible walls and see how it changes the flow of my game. It does help when you can see the change in the prefab within the context of the level instead of in a map by itself, then having to load your level then making sure its set correctly.
-
@Scrotie, You saw it right. That is the fpsplayer prefab. Nothing has been changed other than disabling fall damage, and the teleporting.
Update indy version
in General Discussion
Posted
There has been at least 4 updates since the steam indie release. One happened within the past week. In the steam community page, there are announcements for many of the beta releases.