Jump to content

macklebee

Members
  • Posts

    3,946
  • Joined

  • Last visited

Everything posted by macklebee

  1. ??So you are actually going to change the command syntax after all this time? Literally invalidating every existing line of code that has been currently written with the current command syntax? So where is the new command syntax going to be kept at? The wiki? So that means every command will have a listing for LE3.0 syntax and LE2.XX syntax?
  2. Great stuff, Flexman... fantastic as always.
  3. CopperCircle, theres a tutorial for this that shows how its done via lua.
  4. Naming Army Installations Naming Air Force Bases
  5. Thanks Andy... Your HUD example has always come in handy.
  6. Ok it looks like CopyEntityKeys() doesn't overwrite existing keys, but it will write keys to an entity if it doesn't have that key... like the corona's radius is being written to the firepit. But since a material key exists already for the firepit, it will not overwrite it. But it looks like you can use SetKeys to overwrite the copied entity' keys. I guess it depends on how much the lua script is really controlling and whether or not the original entity is the exact same entity as the copied entity or is it just a placeholder for keys? I am assuming its just a placeholder for the keys since you are loading the AH64D model instead of actually just doing a CopyEntity(). I also notice when I do a CopyEntity() instead of a LoadModel() then then it appears to work just fine and I don't need to use a CopyEntityKeys()...
  7. I trimmed down your code and converted it to something I could try to reproduce, but as you can see its basically your code. I still get the keys from the copied entity using getkeys... which makes me think that maybe its an issue with the script? Framework leadwerks.engine Import "c:\program files\leadwerks engine sdk\bmx\framework\framework.bmx" Include "lua-gluefunctions.bmx" GCSetMode(2) RegisterAbstractPath ("c:\program files\leadwerks engine sdk") Graphics(800, 600) Global fw:TFramework = CreateFramework() If Not fw RuntimeError "Failed to initialize engine." SetScriptObject("fw", fw) MoveEntity(fw.Main.camera, Vec3(1.5, 0, - 2)) Global light:TLight = CreateDirectionalLight() RotateEntity(light, Vec3(45, 45, 45), 1) Global e:TModel = LoadModel("abstract::environment_corona.gmf") Global done:Int = 0 HideMouse() Repeat If KeyHit(KEY_ESCAPE) Exit If AppTerminate() Exit fw.Update() fw.Render() If KeyHit(KEY_SPACE) If done = 0 done = 1 CreateApacheEntity(EntityPosition(e), EntityRotation(e), e) FreeEntity(e) GCCollect() End If End If Flip(0) Forever GCCollect() End Function CreateApacheEntity(loc:TVec3 = Null, rot:TVec3 = Null, srcent:TEntity = Null) Local helo:THelicopter = New THelicopter helo.Load3DModels(srcent) PositionEntity(helo.entity, Vec3(2, 0, 0), 1) If Not helo.entity AppLog(" *** CreateApacheEntity:NO ENTITY:") Else If srcent Then CopyEntityKeys(srcent, helo.entity) helo.entity.SetKey("fcr", GetEntityKey(srcent, "fcr", "1").ToString()) End If End If AppLog(" *** CreateApacheEntity:FCR:" + GetEntityKey(helo.entity, "fcr") + " *** ") AppLog(" *** CreateApacheEntity:Material:" + GetEntityKey(helo.entity, "material") + " *** ") AppLog(" *** CreateApacheEntity:Radius:" + helo.entity.GetKey("radius") + " *** ") End Function Type THelicopter Field model:TModel Field entity:TEntity Method Load3DModels(srcEntity:TEntity) 'Self.model = LoadModel("abstract::environment_corona.gmf")' Self.model = LoadModel("abstract::firepit.gmf") Self.entity = Self.model End Method End Type Function SetScriptObject(name:String, o:Object) Local size:Int = GetStackSize() lua_pushbmaxobject(luastate.L, o) lua_setglobal(luastate.L, name) SetStackSize(size) EndFunction Function GetStackSize:Int() Return lua_gettop(luastate.L) EndFunction Function SetStackSize(size:Int) Local currentsize:Int = GetStackSize() If size < currentsize lua_pop(luastate.L, currentsize - size) EndIf EndFunction EDIT---i take it back... if you run this code, you will see that it doesn't get the value for the material... it gets the radius from GetKey and it gets the FCR value from SetKey... but not the material.... hmmm...
  8. I think I must be missing something from what you are trying to do, Flexman, because I can use GetKeys on a copied entity and get all of its keys. I must be missing something from what you are trying to do... Framework leadwerks.engine Import "c:\program files\leadwerks engine sdk 2.31\bmx\framework\framework.bmx" Include "lua-gluefunctions.bmx" GCSetMode(2) RegisterAbstractPath ("c:\program files\leadwerks engine sdk 2.31") Graphics(800, 600) Global fw:TFramework = CreateFramework() If Not fw RuntimeError "Failed to initialize engine." SetScriptObject("fw", fw) MoveEntity(fw.Main.camera, Vec3(1.5, 0, - 2)) Global model:TEntity = LoadModel("abstract::environment_corona.gmf") Global modelcopy:TEntity[3] Global count:Int = 0 HideMouse() Repeat If KeyHit(KEY_ESCAPE) Exit If AppTerminate() Exit fw.Update() fw.Render() If KeyHit(KEY_SPACE) And count < 3 modelcopy[count] = CopyEntity(model, 1) CopyEntityKeys(model, modelcopy[count]) PositionEntity(modelcopy[count], Vec3(1 + count, 0, 0), 1) FreeEntity(model) model = modelcopy[count] count = count + 1 GCCollect() End If GetAllCopiedKeys(model) Flip(0) Forever GCCollect() End Function GetAllCopiedKeys(entity:TEntity) SetBlend(1) Local i:Int = 0 Local mcpos:TVec3 = CameraUnproject(fw.Main.camera, EntityPosition(entity, 1)) For key:String = EachIn entity.keys.keys() i = i + 20 DrawText(key + ": " + GetEntityKey(entity, key), mcpos.x, mcpos.y + i) Next SetBlend(0) End Function Function SetScriptObject(name:String, o:Object) Local size:Int=GetStackSize() lua_pushbmaxobject(luastate.L, o) lua_setglobal(luastate.L,name) SetStackSize(size) EndFunction Function GetStackSize:Int() Return lua_gettop(luastate.L) EndFunction Function SetStackSize(size:Int) Local currentsize:Int=GetStackSize() If size<currentsize lua_pop(luastate.L,currentsize-size) EndIf EndFunction
  9. Sorry for your loss. You should send Josh your cousin's information and maybe he can transfer the license to you so you can get onto the developers forum's private boards. Perhaps if you can find the Updater on your cousin's computer, you can also supply Josh with the registration number for the SDK as well.
  10. It looks like you are missing the Class.lua script. Did you copy the Scripts folder to your game's working directory?
  11. its in stage 2 for LE3.0 RoadMap
  12. So what does this mean for future use of newton? That's the workaround for all high poly meshes that could possibly be ever hit with a raycast? To create invisible meshes around them... I guess. Out of curiosity what version of Newton are we using with LE 2.4?
  13. i think he was suggesting that you change the origin of the model itself...
  14. Is there really that many hidden or dummy meshes in a scene to even worry about it or make the claim that it increases the fps by 20 by taking them out? Most objects in a scene do not have these dummy meshes, only things like lights, emitters, coronas and the occasional thing like the atmosphere object. And they can easily be added to the object that they are emanating from... so personally do not even see the need. Of course there is always the person who apparently is making a scene with 1000 individual pointlights objects in one scene where all the lights can be seen at one time and are not emanating from an obvious light source like a lamp or bulb, where it might be helpful to remove the dummy meshes... But smartly build your scene in the first place then you shouldn't have these problems.
  15. Try "painting" the trees by hand... the align to slope appears to work then. I can see from the screenshot you selected the Distribute button. For some reason, the align to slope option doesn't work very good with the mass distribution. I would just use the Distribute for the entire scene and then just go back and clean up the areas that would be part of the normal game play area with the hand painted trees--- and possibly even hand placed trees from the Models section of the editor.
  16. Are you setting them with the vegetation option in the terrain section? If so then, just use the "Align to Slope" option.
  17. Have to agree Icare... this is an extremely nice tool and has made making materials an enjoyable experience... which is weird to say about a tool, but your app is actually fun to use!
  18. It does work in bmax... and lua.
  19. The soldier.lua file is using function object:Render() This has been replaced in 2.32 to use function object:Draw()
  20. Your best bet is to post a model on the forums here and ask someone that has the SDK to convert it for you. Assuming that you just want to see your model converted to GMF to see what it looks like in the Editor.
  21. I wasn't suggesting that you try to use the viperscout in your own project, but rather you look at the viperscout's lua file to see how the vehicle commands were used.
  22. macklebee

    phy-files

    The "collisiontype"="2" only works when you are using the model's lua object script. It doesn't do anything if it doesn't have the script. If you do not use the script, then you have to set the collisiontype by using the normal command: EntityType(<entity>, 2, 1)
  23. The PHY file auto created by the engine is for static objects. You would have to use phygen or obj2phy. Now the viperscout is working just fine. If its not for you, then I suspect you have done something strange. What version are you using? When you download a new version, do you overwrite or do you do a fresh install? You didn't delete the PHy file for the viperscout did you?
  24. i actually get the exact opposite using that same scene... i have ~110 fps when looking at just the wall and ~95 when looking down the long corridors... I dont know what could be causing you to have the opposite effect...
×
×
  • Create New...