Jump to content

Josh

Staff
  • Posts

    24,591
  • Joined

  • Last visited

Everything posted by Josh

  1. I think the time is past where making the GUI fit in the same space is a good idea. People have different monitor ratios and multiple monitors. Valve's windowed GUI is the best approach, I think.
  2. Josh

    I Just Found Out!!!

    What folder is your program located in?
  3. Name meaning the field set for "Name" in the property dialog? It would show up as "name" in the keys. You can open the .sbx file in a text editor to verify this.
  4. The way you are looping through all the entities to find the target is kind of backwards. You know you want your plane to have a propeller. You don't need to place it in the editor every time you want a plane. It's far easier just to do this in the spawn function: Function Spawn(model) entity=base_Spawn(model) entity.propeller = LoadModel( "abstract::propeller.gmf" ) If entity.propeller~=nil then attachmentposition=TFormPoint(Vec3(1,0,1),model,nil) entity.propeller:SetPosition( attachmentposition ) CreateJointHinge( model, entity.propeller, attachmentposition, Vec3(0,0,1) ) End End Make sure you get rid of the propeller in the Kill function: Function Kill( model ) entity=entitytable[ model ] If entity~=nil then If entity.propeller~=nil then entity.propeller:Free() entity.propeller=nil End End base_Kill(model) End I used this kind of automatic subobjects in the train cars to attach wheels to the car.
  5. Can you give an example of what you are trying to do?
  6. The pin is the vector around which the joint rotates. Do not confuse this directional vector with a position.
  7. AppTerminate is a variable you are initializing in the loop. It would not have any effect. Try Notify("Hit!"). Make sure you are including the keycodes script that defines all the key constants.
  8. entity:SetCollisionType(type,recursive=0)
  9. You should never parent one body to another. Why are you trying to do this?
  10. Now that we have Lua, these kind of tutorials are more feasible.
  11. 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.
  12. Why are you using a non-normalized vector for the pin?
  13. 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.
  14. The Lua commands match the BlitzMax methods, but you are right they are not completely documented yet.
  15. 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
  16. Without a demo, I can only guess what you might be doing.
  17. 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.
  18. I don't know how that would be done.
  19. Looks like I need to turn on the swear filters.
  20. 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.
  21. Is that code meant for realtime use, or is it for precalculating navigation waypoints? It's very interesting.
  22. 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?
  23. Are Pascal and Delphi the same thing?
×
×
  • Create New...