ParaToxic Posted February 4, 2013 Share Posted February 4, 2013 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 Quote Link to comment Share on other sites More sharing options...
ParaToxic Posted February 4, 2013 Author Share Posted February 4, 2013 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 Quote Link to comment Share on other sites More sharing options...
ParaToxic Posted February 4, 2013 Author Share Posted February 4, 2013 Okey I got it !! The count of the children goes from 1 to CountChildren() + 1 , so I missed the last child .... Quote 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.