Jump to content

Daimour

Members
  • Posts

    191
  • Joined

  • Last visited

Everything posted by Daimour

  1. Yes. table.insert() works with arrays only. It increases array length by 1. It doesn't do anything with no-number indexes. table.insert(array, object) is the same (if you have no nil values inside array) as array[#array + 1] = object For sorting table you can use table.sort() function.
  2. Yes. You can use SetEntityKey() and GetEntityKey().
  3. Try to use CameraPick() command. There is an example of using CameraPick() in fpscontroller.lua script (when pressing E key).
  4. Try to not kill framework and all worlds. But use a ClearWorld() command for clearing all worlds.
  5. You can use different 3D models for mesh and for physics body. So it can still look like a stairways but use ramp for physics.
  6. If you blend layers in manual mode, did you check your algorithm for finding blending places?
  7. Wiki: http://www.leadwerks...ies#EntityColor "A light's intensity is controllable with it's color by multiplying the components: EntityColor(light,Vec4(2)); makes the light twice as bright as EntityColor(light,Vec4(1));" EntityColor(light, Vec4(r * intensity, g * intensity, b * intensity, a), 1)
  8. Just few topics earlier: http://www.leadwerks.com/werkspace/topic/4752-light-intensive/page__fromsearch__1
  9. Use SetEntityKey() function to se tup the time. Or GetEntityKey() function to get the time from script. This script (entity) has 3 keys: "hour", "minutes" and "seconds". So use these keys. hour = GetEntityKey(daynight, "hour") SetEntityKey(daynight, "hour", hour)
  10. Since I love Lua in Leadwerks I would advice to start making your main loop with Lua. Because of (I wrote it before here): And when you will see that Lua is not enough for you can rewrite your code to C++ or BlitzMax or whatever you want.
  11. Firefox. All works fine. Except that little annoying thing with shrinking frame when it loads noncached pictures. But it's quite acceptable for me. Video here: Good job! I like screenshots especially that one with cat-man and gun. You need to post them here. They motivate very much.
  12. Yes. It's good idea. May be the best. If you have access to vertices of course.
  13. Rendering something to buffers every frame is not the best idea. Do it only if your picture changes every frame (for post-effects, mirrors, picture in picture etc.). In other cases render picture only once to get desired texture. And then use this texture multiple times where you need to draw it. I think you can use such approach for GUI.
  14. I think they are the same. They different only in getting small texture (grabbing it from the big one vs loading from separate file). Since it happens only once at starting game the difference has no matter. If you are looking for the fastest way, I think it would be fastest to use one big texture and special shader to change UV coordinates.
  15. And a little explosions. Just for fun.
  16. You can draw a little piece of big texture to little texture. Then you can use that little texture as you want. Code from the video: --preparations local cbst = LoadTexture("abstract::cobblestones.dds") local buf = CreateBuffer(128, 128, BUFFER_COLOR) local tex = CreateTexture(128, 128, TEXTURE_RGB) SetColorBuffer(buf, tex, 0, 0) --render image to custom buffer SetBuffer(buf) DrawImage(cbst, MouseX() - 512, -(MouseY() - 512), 1024, -1024) SetBuffer(BackBuffer()) --draw custom buffer to back buffer DrawImage(tex, 100, 100, 128, 128)
  17. Yeah. So step by step we will write working code. Now you can easily debug client side code.
  18. Hi. What red light are you talking about? I can't see any red lights in video. It's too hard to guess what you expect from light and what techniques you use... Try to make your light less intensive if it will help.
  19. I've learned a little about GNet. And I like it very much. It's the simplest thing for networking I've ever seeing. In your case you don't need all that code on the server side. Because all work is going on the client side. Simplify your code as much as possible for debugging purposes. Try to replace server side code with this: Local port = 80 ' users would normally choose one allowed through their firewall Local servername$ = "Freezing_world_server"+Rand(1000, 9999) Local success success = GNetListen( host, port ) If Not success Then RuntimeError "Cannot create server!" Repeat Delay 10 ' allow other apps some cycles to minimize CPU use PollEvent GNetSync host Until EventID() = EVENT_WINDOWCLOSE So since nothing happens on the server side you can easier debug your client side code.
  20. Did you fix already that two cycles?
  21. For remoteObj = EachIn objList For Local p:PLAYERS = EachIn playerList Why two cycles?
×
×
  • Create New...