Jump to content

GetEntityKey("classname") in 2.3?


L B
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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++...

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

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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

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. :lol:

 

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...

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...