Jump to content

Genebris

Members
  • Posts

    517
  • Joined

  • Last visited

Everything posted by Genebris

  1. Are you looking for this? http://www.leadwerks.com/werkspace/topic/10809-lua-drawing-a-tiled-image/page__hl__drawtexture
  2. To variables in App.lua script you can refer in any other script like this: App.ammo_amount=self.ammo_count
  3. Is it possible to make Steamworks work in Lua? This would be perfect. I wouldn't need any default netcoding solutions in Leadwerks then.
  4. 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/
  5. I was able to generate navmesh on my cave models with polymesh collider without any problems.
  6. Attach a model file, I'll try.
  7. 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.
  8. How will you find a position where you need to place your weapon relatively to bone without editor?
  9. Maybe I'm missing something, but how can most basic and most important function (parenting one object to another) not work in 3.5?
  10. Attach it as a child to his arm bone.
  11. 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.
  12. 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.
  13. 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: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/filesystem/filesystemwritefile-r650
  14. 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?
  15. what's the problem? Script.points=1 --int "points" function Script:Use() points=points+self.points end
  16. Sorry, what the point of hitboxes if picking anyway works on visible geometry?
  17. I guess it's again something wrong with the map file. Try deleteing last map file you were using from your project folder.
  18. 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.
  19. I guess you can make a billboard with a transparent yellow circle texture on it.
  20. 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
  21. 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.
  22. FindChild works correctly for me. The mistake must be somewhere else.
  23. No, it was 100 MB for a single mod limit for Skyrim. 50 mod limit was only for a few weeks after Skyrim workshop opened (in 2012).
  24. I don't think that's possbile, but if you want you can create a pivot point with a script, save as prefab and parent it to entities you want to add script to. Obviously you will need to use self.entity:GetParent() in this script instead of self.entity.
×
×
  • Create New...