L B Posted December 31, 2009 Share Posted December 31, 2009 This key seems to be gone (returns blank), and since we still need to manually parse the SBX for some reasons, it would be needed. I tried GetEntityKey("path"), but path isn't a key, it's a built-in property. Without this function, I can't make an automatic framework loading of SBX with atmosphere and waterplanes. Quote Link to comment Share on other sites More sharing options...
Rick Posted December 31, 2009 Share Posted December 31, 2009 Maybe it's a different language you are talking about but don't you have to pass in the entity to GetEntityKey(ent, string)? Quote Link to comment Share on other sites More sharing options...
L B Posted December 31, 2009 Author Share Posted December 31, 2009 I'm in C#, so it's actually "Entity.GetKey(string key);" Quote Link to comment Share on other sites More sharing options...
Rick Posted December 31, 2009 Share Posted December 31, 2009 Oh, this being in General Programming I was confused. Should probably put this in C# forum to avoid confusion. Quote Link to comment Share on other sites More sharing options...
L B Posted December 31, 2009 Author Share Posted December 31, 2009 I'm putting it in General Programming because it isn't language specific. I can't get any value in C++ either. Quote Link to comment Share on other sites More sharing options...
Rick Posted December 31, 2009 Share Posted December 31, 2009 I can't try it atm from where I am, but I can't see how it would be gone. Keys are a big part of storing info in entities, and it works for lua. Quote Link to comment Share on other sites More sharing options...
L B Posted December 31, 2009 Author Share Posted December 31, 2009 Keys work perfectly. "classname" doesn't. It used to be a key in 2.28 sandbox files, but it's not anymore in 2.3. It was there in 2.28 because of the need of a ProcessScene, but since Lua has been implemented, it must have been removed. My suggestion would be to add a function called "string GetEntityClass(TEntity entity);", which basically returns the "path" property from the SBX file without the filename extension. Quote Link to comment Share on other sites More sharing options...
Niosop Posted December 31, 2009 Share Posted December 31, 2009 Have you tried just "class" instead of "classname"? Quote Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX ZBrush - Blender Link to comment Share on other sites More sharing options...
macklebee Posted December 31, 2009 Share Posted December 31, 2009 it works... it just doesn't for certain things in the sbx... you can pull the camera position and rotation but you cant pull the model's position/rotation/path/id/scale using getkey... if you look at the sbx in notepad, you will see for example: Model { path="environment_atmosphere.gmf" position=7.00000000,0.000000000,6.00000000 rotation=-0.000000000,-0.000000000,0.000000000 scale=1.00000000,1.00000000,1.00000000 id=413927720 "brightness"="1.0" "camerarange"="0.1,1000.0" "class"="Model" "contrast"="1.0" "intensity"="0.5" "name"="atmosphere_4" "range"="10" "saturation"="1.0" "skymaterial"="FullskiesBlueClear0016_2_L.mat" "volume"="1" } you can use getkey to grab all of the keys that have " " around them, like "skymaterial" for example which is what i used to originally parse the code to set the skybox, camera range, etc... same can be done with the waterplane... but since all of the framewOrk stuff is in the dll now, do you need to even parse the sbx anymore to get the framewOrk stuff? Does not appear that you have to for c++... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Rick Posted December 31, 2009 Share Posted December 31, 2009 lol oh. Your original post was confusing This function seems to be gone (returns blank) I view that as meaning the function seems to be gone. As in the GetEntityKey() function, because that's the function. Really the function isn't gone, that specific key is. So what you are saying is the key name "classname" seems to be gone. OK, now I understand. Quote Link to comment Share on other sites More sharing options...
L B Posted December 31, 2009 Author Share Posted December 31, 2009 Have you tried just "class" instead of "classname"? Will return either "Model" or "Terrain", not "environment_atmosphere", for instance. Quote Link to comment Share on other sites More sharing options...
L B Posted December 31, 2009 Author Share Posted December 31, 2009 it works... it just doesn't for certain things in the sbx... you can pull the camera position and rotation but you cant pull the model's position/rotation/path/id/scale using getkey... if you look at the sbx in notepad, you will see for example: Model { path="environment_atmosphere.gmf" position=7.00000000,0.000000000,6.00000000 rotation=-0.000000000,-0.000000000,0.000000000 scale=1.00000000,1.00000000,1.00000000 id=413927720 "brightness"="1.0" "camerarange"="0.1,1000.0" "class"="Model" "contrast"="1.0" "intensity"="0.5" "name"="atmosphere_4" "range"="10" "saturation"="1.0" "skymaterial"="FullskiesBlueClear0016_2_L.mat" "volume"="1" } you can use getkey to grab all of the keys that have " " around them, like "skymaterial" for example which is what i used to originally parse the code to set the skybox, camera range, etc... same can be done with the waterplane... but since all of the framewOrk stuff is in the dll now, do you need to even parse the sbx anymore to get the framewOrk stuff? Does not appear that you have to for c++... I have no problem getting keys, I need the class name, which is the "path" property (not key) without the extension. Quote Link to comment Share on other sites More sharing options...
L B Posted December 31, 2009 Author Share Posted December 31, 2009 lol oh. Your original post was confusing I view that as meaning the function seems to be gone. As in the GetEntityKey() function, because that's the function. Really the function isn't gone, that specific key is. So what you are saying is the key name "classname" seems to be gone. OK, now I understand. Changed post, sorry, it was indeed confusing. Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 31, 2009 Share Posted December 31, 2009 I have no problem getting keys, I need the class name, which is the "path" property (not key) without the extension. then make a new property called "classname" for all of your lua scripted objects so it will write that info to the sbx... still do not understand why this is needed if LoadScene does this for you already and the framewOrk stuff is inside the dll now... but i assume i am missing some critical info Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
L B Posted December 31, 2009 Author Share Posted December 31, 2009 Macklebee, does LoadScene set your Distance Fog settings? Your water settings? If so, I have missed something obvious. I had indeed missed Josh's post. Everything is working fine and automatically now. Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 31, 2009 Share Posted December 31, 2009 Macklebee, does LoadScene set your Distance Fog settings? Your water settings? If so, I have missed something obvious. I had indeed missed Josh's post. Everything is working fine and automatically now. ok... i had thought this was the case... yeah, everything appears to be working "automagically" now... except for some issues here and there where the lua scripts need to be modified to get to work outside of the editor... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.