CrazyM Posted September 15, 2014 Share Posted September 15, 2014 I have a Lua script that has the following exposed property. Script.pawns = nil --entity "Pawns" The Pawns entity is a pivot used as a parent to several other entities. Inside the script, I use this reference to iterate through the children. childCount = self.pawns:CountChildren() for i=0, i<childCount-1, 1 do --Some action end This normally works great, but I've had three occurances of this reference suddenly reading as nil when no change occurred in the script, and the UI for the exposed property still shows the Pawns entity being linked. Once this nil error occurs, nothing short of deleting the Pawns pivot, creating a new pivot and re-parenting all my child entities, and re-linking the Pawns property corrects the problem. I have tried un-linking and re-linking the reference, removing and re-adding the script, nothing else seems to work, and I've made no change to warrent reference failure. CrazyMinnowStudio.com Youtube, Twitter, Facebook, G+ Link to comment Share on other sites More sharing options...
AggrorJorn Posted September 15, 2014 Share Posted September 15, 2014 Are you opt in for the Beta? Link to comment Share on other sites More sharing options...
Rick Posted September 15, 2014 Share Posted September 15, 2014 I have seen this also in my training sessions I do with this one person where we are making a chess game. It happens weekly. CrazyM, Josh is going to ask for a map file so once it happens attach the map file to this post for him to check out. Link to comment Share on other sites More sharing options...
CrazyM Posted September 15, 2014 Author Share Posted September 15, 2014 Yes beta, I should have mentioned that. CrazyMinnowStudio.com Youtube, Twitter, Facebook, G+ Link to comment Share on other sites More sharing options...
AggrorJorn Posted September 15, 2014 Share Posted September 15, 2014 This is what happens in the beta: You create items or duplicate items. As soon as you make them a child of some other entity, it looks like everything is okay. However, save your scene and reopen it. Your child items are now no longer in your scene. That is also the reason the scripts are failing. Those entities are actually nil. Link to comment Share on other sites More sharing options...
CrazyM Posted September 15, 2014 Author Share Posted September 15, 2014 Thanks, I'll opt out of the beta for now and see if the problem persists. CrazyMinnowStudio.com Youtube, Twitter, Facebook, G+ Link to comment Share on other sites More sharing options...
Josh Posted December 20, 2014 Share Posted December 20, 2014 If you still have this problem please create another thread and attach a map file I can investigate. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts