Jump to content

Josh

Staff
  • Posts

    24,155
  • Joined

  • Last visited

Everything posted by Josh

  1. Josh

    I Just Found Out!!!

    What folder is your program located in?
  2. 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.
  3. 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.
  4. Can you give an example of what you are trying to do?
  5. The pin is the vector around which the joint rotates. Do not confuse this directional vector with a position.
  6. 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.
  7. entity:SetCollisionType(type,recursive=0)
  8. You should never parent one body to another. Why are you trying to do this?
  9. Now that we have Lua, these kind of tutorials are more feasible.
  10. 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.
  11. Why are you using a non-normalized vector for the pin?
  12. 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.
  13. The Lua commands match the BlitzMax methods, but you are right they are not completely documented yet.
  14. 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
  15. Without a demo, I can only guess what you might be doing.
  16. 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.
  17. I don't know how that would be done.
  18. Looks like I need to turn on the swear filters.
  19. 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.
  20. Is that code meant for realtime use, or is it for precalculating navigation waypoints? It's very interesting.
  21. 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?
  22. Are Pascal and Delphi the same thing?
  23. No, it should all be automatic, and if it isn't it means something is wrong.
×
×
  • Create New...