tag:blogger.com,1999:blog-4740038019232623478.post941883927777392116..comments2023-10-31T07:51:27.779-07:00Comments on Daisy_Strike's SDK: Furniture 2, New YearDaisy_Strikehttp://www.blogger.com/profile/04943903869046211819noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-4740038019232623478.post-20806925240582673752011-01-03T17:43:07.824-08:002011-01-03T17:43:07.824-08:00code is theoretically sound in the last 2 posts bu...code is theoretically sound in the last 2 posts but 2 things<br /><br />while (furnitureImageArray.length > 0)<br />{<br />if (furnitureImageArray[i] != null {<br />removeChild(furnitureImageArray[0]);<br />}<br />furnitureImageArray.splice(0,1);<br />} <br /><br />may be more efficient for computer to perform<br />as it will remove a step on null objects instead of adding it also whats with<br />the <br /><br />i=-1;<br /><br />i don't understand why you are setting i to negative 1. perhaps you meant<br /><br />i-=1;<br /><br />which decrements by 1. aka shorter way for decrementing by 1.<br /><br />i--;<br /><br />if i remember correctly anyway.<br /><br /> by The pheonixAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4740038019232623478.post-68178827043598744492011-01-02T09:10:47.981-08:002011-01-02T09:10:47.981-08:00ah, if you cant remove a null, then you just have ...ah, if you cant remove a null, then you just have to make it not null just before applying the remove.<br />something like this:<br /><br />while (furnitureImageArray.length > 0)<br />{<br />if (furnitureImageArray[i] = null {<br />furnitureImageArray[i] = something;<br />}<br />removeChild(furnitureImageArray[0]);<br />furnitureImageArray.splice(0,1);<br />}Samunoreply@blogger.comtag:blogger.com,1999:blog-4740038019232623478.post-19371294033276541272011-01-01T20:43:08.173-08:002011-01-01T20:43:08.173-08:00some other problem: i experienced a problem with g...some other problem: i experienced a problem with getting girls pierced. in about 50% of the cases i try to pierce a girl, i get her pierced but i still can't apply piercings (especially ears and clit).<br />i have no idea if there's a connection between this problem and my much more severe problem. i now can't load my saved game any more. after experiencing the piercing problem i saved and started the game again, to see if something changes, but i can only start a new game now. if i click on options or continue first i can't even do this any more.hessi_jameshttps://www.blogger.com/profile/08473023573504084367noreply@blogger.comtag:blogger.com,1999:blog-4740038019232623478.post-65750866017648327172011-01-01T20:25:47.345-08:002011-01-01T20:25:47.345-08:00how about instead of deleting you fill every posit...how about instead of deleting you fill every position of the array with empty or null objects (objects that contain nothing)?Samunoreply@blogger.comtag:blogger.com,1999:blog-4740038019232623478.post-84188368874853432382011-01-01T19:20:13.655-08:002011-01-01T19:20:13.655-08:00Obviously the second one didn't work like I sa...Obviously the second one didn't work like I said.<br /><br />But<br /><br />for (var i:Number = 0; i < furnitureImageArray.length; i++)<br />{<br />removeChild(furnitureImageArray[i]);<br />} <br /><br />will crash because you cant remove child on a null.<br /><br />ie <br /><br />[object furnitureHousePlant],,,,[object furnitureBed],,,,[object furniturepiano]<br /><br />all the little ,, are nulls and removing something that doesn't exist crashes flash.<br /><br />also I'm lazy its a global array because its passed into dozens of functions. Don't want to really remove just want it to be empty so its not taking up space when not used.<br /><br />Though I think your while code is probably cleaner then my version.<br /><br />DaisyDaisy_Strikehttps://www.blogger.com/profile/04943903869046211819noreply@blogger.comtag:blogger.com,1999:blog-4740038019232623478.post-84823589443240541142011-01-01T19:02:42.437-08:002011-01-01T19:02:42.437-08:00I think the second code has a typo in it, I'm ...I think the second code has a typo in it, I'm not exactly sure what it's supposed to do...it's easy to get things confused when you make loops like this.<br /><br />So, the point is to delete everything from the array, but make sure that you call removeChild on it first?<br /><br />It might be easier to use a while loop:<br /><br />while (furnitureImageArray.length > 0)<br />{<br />removeChild(furnitureImageArray[0]);<br />furnitureImageArray.splice(0,1);<br />}<br /><br />Or, you could go through and call removeChild on every element in the array. Then you can just delete the array.<br /><br />for (var i:Number = 0; i < furnitureImageArray.length; i++)<br />{<br />removeChild(furnitureImageArray[i]);<br />}<br />furnitureImageArray = new Array(); // just delete/recreate it<br /><br />I think those bits should work...good luck!John Evanshttps://www.blogger.com/profile/17813593224618572349noreply@blogger.com