Jump to content

Rick

Members
  • Posts

    7,936
  • Joined

  • Last visited

Everything posted by Rick

  1. You should be able to create 1 material per character and change the underlying texture to that material over time in code to the frame you want to show. For always facing you'd want to rotate the plane to always face the camera entity. Check out: http://leadwerks.wikidot.com/wiki:face-entity
  2. Wow, that's old school How many frames are we talking about with each animation? You could probably create a material and change it's texture for each frame in code. Each frame would then be it's own texture. http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/material/materialsettexture-r184 When you load your plane model in from code (I assume) you'll want to make sure the 2nd parameter (asset load params) is one that tells the model to use it's own material instance, otherwise the same models share materials and changing a material on 1 would change it on all other instances of that model. http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/model/modelload-r352 The memers at the top are the values you'd use for the 2nd param for the Model:Load function http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/asset/ something like Asset.CreateNew I believe
  3. The exe will be in your templates dir E:\Steam\steamapps\common\Leadwerks Indie Edition\Templates\Lua Just copy the 2 exe's to your projects directory and rename with your project name
  4. I would think it's more of a suggestion than a bug. Also, I wouldn't do that. I seem to remember a bug where that breaks navmesh creation. Something to test out. You can put other csg as children to other csg but once it's a child to a non csg entity it didn't work before.
  5. I couldn't figure out how to actually make one of these. Am I missing an add button or something? The thing is this is more than just Steam :-/. I think (hope) most of those people eventually come here instead of the Steam forums once they get into Leadwerks more. Nevermind I see it in the Steam app now.
  6. Putting this code on the wiki, because it's gold really
  7. This was just added today by an old member so it was in my head We are trying to get that wiki established as a place we can all go and contribute whatever we can.
  8. http://leadwerks.wikidot.com/wiki:entityindexer
  9. 1. Yes, but it would take some setting up on your end, but scripts could be created to play out in-game cut scenes that move entities around including the camera. It's not something that Leadwerks has directly just for this though. 2. You make the weapons with code and 3D models. The engine gives you the functions in order to make the logic for weapons. 3. It could, but you'd have to bring in your own networking library at the moment. Like RakNet. It's a more advanced topic. All multiplayer really is. 4. Possibly? You'd have to be more specific. 5. Possibly? You'd have to be more specific.
  10. I have a zombie spawner for my little demo. "Invisible cubes" would be pivots in Leadwerks. It's just a point in space (entity). Create one in the editor under the Objects tab. Select Misc then pivot and then click in the view windows. What you would want to do then is to take an enemy model and place it in the scene. Set it's physics so it's a controller/character and give it mass. Now you need a script that controls your enemy. You can probably look in the AI script folder and assign one of them. Then right click and select "Save as Prefab". Then what I did is make a spawning script that I place on the pivot and it looks like: Script.Target = nil --Entity Script.SpawnRate = 5.5 --float Script.MaxZombies = 5 --int function Script:Start() self.lastSpawnTime = 0 self.counter = 0 end --[[ function Script:UpdateWorld() end ]]-- function Script:UpdatePhysics() if self.counter >= self.MaxZombies then return end if Time:GetCurrent() > self.lastSpawnTime + (self.SpawnRate * 1000) then self.counter = self.counter + 1 self.lastSpawnTime = Time:GetCurrent() -- create a zombie and set location, speed, and target to the player local zombie = Prefab:Load("Prefabs/Characters/zombie.pfb") zombie.script:Start() zombie:SetPosition(self.entity:GetPosition()) zombie.script:Enable() --zombie.script.Speed = 2 zombie.script.Player = self.Target end end --[[ function Script:Collision(entity, position, normal, speed) end ]]-- --[[ function Script:Draw() end ]]-- --[[ function Script:DrawEach(camera) end ]]-- --[[ --This function will be called after the world is rendered, before the screen is refreshed. --Use this to perform any 2D drawing you want the entity to display. function Script:PostRender(context) end ]]-- --[[ function Script:Release() end ]]-- --[[ function Script:Cleanup() end ]]-- I have my own zombie ai script though so it'll be slightly different but you can probably work it out. Basically on a timed basis I create a prefab, call it's Start() function, set it's position to the pivots position, call a function I defined (Enable) in the zombie script and set it's target to the player. Something like that should get you going.
  11. self.world = World:Create() -- load the starting map local mapfile = System:GetProperty("map", "Maps/start.map") if Map:Load(mapfile) == false then return false end Nothing will work if you don't load a map
  12. Rick

    Lua math library

    You are correct. I swear it was giving me an error but it must have been whatever I was passing into it. Thanks
  13. math.floor() failed on me in the Steam version. Does it not expose Lua's math library? http://lua-users.org/wiki/MathLibraryTutorial I ask because I need to seed the random numbers
  14. That's an older thread but dang. I would be pissed if I made a game and was being put through that. The term "indie" is so wide open these days. I'm going to start calling myself a "Garage Developer"
  15. If you select the top level folder it shows all files in all sub folders. I don't think it did this before. Is it by design because I don't like it
  16. For the most part you are always exporting to C methods. If your library is C++ you generally (I have anyway) make a C wrapper around the C++ library that you want to expose. For example when I did this with RakNet, I didn't expose all of RakNet. I just made some functions for the most important things I needed to make a basic multiplayer game. Like I created a Connect(...), Disconnect(...), Send(...) ect. I even did Lua callbacks for received network data. This is for sure an advanced topic and not directly supported by the engine though.
  17. That idea is a general Lua idea so you can google for it. http://lua-users.org/wiki/BindingCodeToLua You just need to adopt it to your C++ library you are using then.
  18. Was trying to say with the 99.9% comment
  19. The API is 100% the same between Lua and C++. All features are the same also. You can load DLL's from Lua so you can make C++ logic and access it via lua if you want.
  20. Every command is Lua compatible. The official API is 99.9% (might be something missed) the same between both languages.
  21. Oh, you aren't a developer yet on these forums. Did you buy the engine? It's possible Josh just didn't change your forum status. If you did I can post the code here.
  22. Thanks to shadmar for the code to make the skybox. I just wrapped it up in a nice entity script. http://www.leadwerks.com/werkspace/files/file/463-skybox/
  23. Here you go: http://www.leadwerks.com/werkspace/files/file/463-skybox/ Easy peasy now Note this uses a camera that you add to your scene via the editor and not code.
×
×
  • Create New...