-
Posts
517 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Genebris
-
-
Recalculate normals to completely remove smoothing.
http://www.leadwerks.com/werkspace/page/tutorials/_/models-and-animation-r8#section4
And I suppose you can import one 1x1 pixel white texture and change color for each material in material editor.
-
Well, I guess you have to add variable in all your scripts that will be true when the game is on pause. For example in enemy script you should check this variable each update and move enemy only if it's false. There is no automatic way to stop time for all entities and scripts.
Or you can stop calling World:Update? Maybe it's a proper way.
-
I remember I had to only add like two lines into drawimage shader and then through the scrip I could send this shader a parameter to cut this image by 50% when I have 50% health. But I guess after update this shader was replaced and I can't find it now. Just do what macklebee told in this thread.
-
Are you looking for this? http://www.leadwerks.com/werkspace/topic/10809-lua-drawing-a-tiled-image/page__hl__drawtexture
-
To variables in App.lua script you can refer in any other script like this:
App.ammo_amount=self.ammo_count
- 1
-
Is it possible to make Steamworks work in Lua? This would be perfect. I wouldn't need any default netcoding solutions in Leadwerks then.
-
It will, but I don't know when. For now you can use Steamworks if you want. I was able to synchronize basic players data pretty easily using this example: http://www.leadwerks.com/werkspace/topic/9663-introduction-to-steam-code-in-leadwerks/
- 1
-
I was able to generate navmesh on my cave models with polymesh collider without any problems.
- 1
-
Attach a model file, I'll try.
-
I was looping through all entities in the world each update in my map script and didn't notice any fps drops, so I think it's good enough.
Something like this:
for i=0,App.world:CountEntities()-1 do
local entity = App.world:GetEntity(i)
if entity:GetKeyValue("name") == "Crate" then
--this is your crate entity, can count it or delete
end
end
Strange that CountEntities and GetEntity aren't in documentation, they are very important.
- 2
-
How will you find a position where you need to place your weapon relatively to bone without editor?
-
Maybe I'm missing something, but how can most basic and most important function (parenting one object to another) not work in 3.5?
-
Attach it as a child to his arm bone.
-
You can us calculate normals function in Leadwerks model editor, it's described here: http://www.leadwerks.com/werkspace/page/documentation/_/user-guide/model-editor-r16
If you want to make your normals in Blender you can use Edge split modifier. It has angle option (the same as leadwerks) and you also can mark some edges as sharp manually: select edges, press Ctrl+e, then select "mark sharp". Then you won't need to correct normals in Leadwerks.
-
One more thing. If you want to save a list of different points into a file you can make it like this:
first points=12
second points=25
another points=72
And then when you read the files to get points you can find equal sign and split string by it. Use default Lua functions like this one for that: http://www.lua.org/manual/5.3/manual.html#pdf-string.sub
It will be like this: you open a file, read a first string, get this value: "first points=12". Then you loop through all symbols in the string looking for "=" and take everything after it. And it will be your first points value.
I do it like this for stats of weapons stored in a file.
-
Yes, or with the same result you can make a global table like this:
stats={}
stats.points=0
For files you use FileSystem and Source classes. It's simple and convenient as everything in Leadwerks.
Example that you need is already in documentation:
-
I think global values won't be deleted when you change the level as they are not tied to any entity in the world. So what I wrote should work across levels. If you want to store points between game launches, then you can write it to a file. Do you want that?
-
what's the problem?
Script.points=1 --int "points"
function Script:Use()
points=points+self.points
end
-
I guess it's again something wrong with the map file. Try deleteing last map file you were using from your project folder.
-
I thought that same model file can never have different materials. They are always instances.
No, sorry. Now I see they are always instanced only in the editor.
-
I guess you can make a billboard with a transparent yellow circle texture on it.
-
Make a table and write your items in it like this:
self.inventory[#self.inventory+1]={} self.inventory[#self.inventory].name="Sword" self.inventory[#self.inventory].amount=3
This will add 3 swords into your inventory. Then in PostRender you check if inventory menu is opened, and if it is you loop through inventory and draw items icons:
for i=1, #self.inventory do context:DrawImage(Texture:Load("folderWithIcons/"..self.inventory[i].name), 100, 100+i*50) context:DrawText(self.inventory[i].amount, 120, 100+i*50) end
-
I think that it's related to the problem that I had few times before. I think that sometimes things just don't get saved. Even if you press save 10 times and launch the game several times (which also should save the map), it can be that something isn't saved on the map. It can be properties in script settings or objects placed on the map. I'm not sure, but I THINK that that happened to me few times beofre. And I also had to delete an object and make it again. And it seems like you have just got the same problem.
Sadly I don't know how to reproduce this and I can't corfirm that it's not just my imagination.
-
FindChild works correctly for me. The mistake must be somewhere else.
Flat shading
in General Discussion
Posted
Or use your own mesh instead of terrain. If you don't use textures and have low poly models this shouldn't be a problem for performance.