AxlDave Posted July 30, 2014 Author Share Posted July 30, 2014 For what it's worth, using the iteration via "foreach" in the way posted above is definitely bound to run into game delays increasing with the size of your inventory, as foreach "stops" the game until the loop is completely done. I for one prefer constructing loops in 'cooperation' with the game's main loop instead of delaying it by my own loops.A GameMode script is already a 'loop' by design, but this one returns control to the game each frame and thus the game never freezes up like it does during "foreach". So it might be best if I run with the "while equipped" method, then? Link to comment Share on other sites More sharing options...
kastano Posted July 31, 2014 Share Posted July 31, 2014 (edited) i think he means to construct a loop like that isolated at the end of a script with a short to control it set pCont to Player;Sets the inventory ref to the playerset InvPos to pCont.GetNumItems;sets the position of the checker to the last item spot in the inventoryif InvPosset InvPos to (InvPos - 1)set pInvObj to (pCont.GetInventoryObject InvPos);check etc i have tried several varations but untill now only breaksgenerally it breaks easily - also its possible to change containers-EDITAlso a questionDoes fquestdelaytime works in objectsripts? Edited August 1, 2014 by kastano Link to comment Share on other sites More sharing options...
Recommended Posts