Jump to content

Josh

Staff
  • Posts

    24,629
  • Joined

  • Last visited

Everything posted by Josh

  1. I just tried Print() and it worked. I added a hook so this command will automatically write to the log file, though AppLog() was left for compatibility with existing code.
  2. Why are you using a non-normalized vector for the pin?
  3. SetGlobalNumber() sets a value in the engine. GetGlobalNumber() retrieves it. I don't have any plans to change the way the states are set up. It would require all the scripts to have their functions renamed like "light_directional_Update()" and who knows how else the scripts would interfere with one another.
  4. The Lua commands match the BlitzMax methods, but you are right they are not completely documented yet.
  5. The Lua command set exposure is a little tricky when you get into multiple levels of command sets, like when you have the engine command set, and you want to expose something else beyond that, like the Framewerk commands. The attached example shows how Lua command set generation works. To expose types, all you have to do is add an "expose" tag in the meta data. To expose procedural functions, you add the functions as a method in a type with the "noclass" setting. To generate your command set file, do this: generateGlueCode("lua-gluefunctions.bmx") End To run your program with the command set, do this: Include "lua-gluefunctions.bmx" I just include all three lines together, and comment them out depending on what I am doing: Include "lua-gluefunctions.bmx" 'generateGlueCode("lua-gluefunctions.bmx") 'End 'Include "lua-gluefunctions.bmx" generateGlueCode("lua-gluefunctions.bmx") End Any time you make changes to any of your exposed class commands, you have to generate a new lua command set file. Otherwise your program might not even compile, because it will have function declarations that don't match the commands you changed. Does this make sense? I could pull the Lua commands out of the engine and make this a requirement of any BlitzMax program that uses Lua. It's a little more complicated, but it allows you to change the commands I have exposed, add ones that may be missing, or expose your own types. For example, if you imported the framewerk module and generated the command set, you would have access to all the framewerk commands in Lua. This is how the editor and interpreter do it. MyGame.zip
  6. Without a demo, I can only guess what you might be doing.
  7. The Lua command dofile() does not use the abstract system. LE commands work as they normally do. Please post a demo, otherwise we are just speculating.
  8. I don't know how that would be done.
  9. Looks like I need to turn on the swear filters.
  10. Whatever behavior you are enabling, do it in the SetTarget() function. Then it will just be performed when the target is set. When the Spawn() function is called, the targets haven't even been set yet.
  11. Is that code meant for realtime use, or is it for precalculating navigation waypoints? It's very interesting.
  12. I think lower-case vec3() feels nicer, but what is the rule that makes it so? All other commands are capitalized. Should math constructors be lower-case?
  13. Are Pascal and Delphi the same thing?
  14. No, it should all be automatic, and if it isn't it means something is wrong.
  15. Yeah, there are a couple simple ones in the main folder. Just open example01.lua in the script editor and press F5 to run it. http://leadwerks.com/wiki/index.php?title=Script#Script_Editor
  16. Inquiring minds want to know.
  17. Use looping particles and let them fill up before you start rendering.
  18. I'm looking more for stuff that's written as a standalone app, not necessarily something that has to run in the editor. The Lua script editor lets you write and run programs. The scene editor is fun, but I think serious programming needs to be done in the standalone script editor. I picture the demo having an html page that shows you the different games you can play, and for each one, a link to play it and a link to open the script and look at it.
  19. Print("Hello!") will do it.
  20. http://www.lua.org It's probably easiest just to look at my examples.
  21. I want to include a few simple "mini-game" examples in the public demo. Andy's ActionSnake game is a great example. Some other ideas could be a monster truck rally or a fantasy RPG example with a character running around in 3/4 "Zelda" perspective. It doesn't have to be a complete game, but having some kind of playable goal makes it much more engaging. Here are the parameters: -Coded in uncompiled Lua script. -Performance is more important than graphics. You don't get any points for having twice as many polygons on screen. Most people don't even understand the idea that more polygons = slower performance. -Playability is the most important factor. I can include some good-looking scenes, but what people really want is to see an example in script and tinker around with it. -I recommend just using pre-made media packs from Dexsoft. If you are interested in having your example included in the public demo, keep us informed on your progress. I would like to post the demo at the end of December. You can include any information on your game to get a little exposure from this. Thanks. Ideas:
  22. Each model class uses its own Lua state. This allows one script to be edited at a time, but interstate communication is a little more difficult. You can use SetGlobalNumber() to communicate in this situation.
  23. Is KEY_ESCAPE defined anywhere?
  24. Josh

    tree[d]

    The triangle counts in that program seem astronomical.
  25. That's normal. It takes a certain amount of force to get the bodies to adhere to the constraint, and joints always have some ability to stretch, especially when you have lots of them linked together like this.
×
×
  • Create New...