Rick Posted October 24, 2010 Share Posted October 24, 2010 What is the PROPERTY_ constant that returns the string and not the index again? I've used PROPERTY_CHOICE and PROPERTY_CHOICEEDIT and they both seem to return "0" instead of the string that I put in the drop down list. Quote Link to comment Share on other sites More sharing options...
macklebee Posted October 24, 2010 Share Posted October 24, 2010 CHOICEEDIT returns the string... you may need to update though... 2.4 at one point had a bug with CHOICEEDIT...http://leadwerks.com/werkspace/index.php?/tracker/issue-132-script-issue-with-latest-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...
Rick Posted October 24, 2010 Author Share Posted October 24, 2010 That didn't seem to help. Maybe I'm doing something wrong in my Lua file. Here is what I have. When I find this entity in code and have: string cls = GetEntityKey(ent, "class", ""); it's returning "0" require("scripts/class") local class=CreateClass(...) function class:InitDialog(grid) self.super:InitDialog(grid) group=grid:FindGroup( "Class" ) group:AddProperty("class",PROPERTY_CHOICEEDIT,"Assassin,Paladin,Knight,Wizard","Class Type") end function class:CreateObject(model) local object=self.super:CreateObject(model) function object:SetKey(key,value) if key=="" then else return self.super:SetKey(key,value) end return 1 end function object:GetKey(key,value) if key=="" then else return self.super:GetKey(key,value) end return value end end 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.