Jump to content

EntityKey problem with lua


ParaToxic
 Share

Recommended Posts

Hey ya, I made a new entity with a script with the name gameobject_actor.Then I added a property with the name "actortype" with a dropdown box "player,npc0"

 

So I placed one actor in the scene and gave him "player" as actortype.

Then I saved it and saw the following code in the scene file;

[/size]
Model {
path="gameobject_actor.gmf"
position=-2.88000011,1.30999994,-6.30000019
rotation=-0.000000000,0.000000000,0.000000000
scale=1.00000000,1.00000000,1.00000000
id=236444968
"actortype"="0"
"class"="Model"
"intensity"="1.0"
"name"="player_spawn0"
}

 

But now when I go through the scene entity ( for( int i = 1; i < CountChildren(entity); i++)) and get with GetChild(entity,i) each child of the scene. Then I get the Key from each entity with: GetEntityKey(GetChild(entity,i),"actortype")) and print that out in a console.

But I don't get a result, no values with the key "actortype" ....

 

Well I don't realy know what to do now....maybe somebody has an idea.

Thanks

Link to comment
Share on other sites

My script:

[/size]
require("scripts/class")
local class=CreateClass(...)
function class:InitDialog(propertygrid)
self.super:InitDialog(propertygrid)
local group=propertygrid:AddGroup("GameObject")
group:AddProperty("Actortype",PROPERTY_CHOICE,"Player,NPC0")
end
function class:CreateObject(model)
    local object=self.super:CreateObject(model)


end

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