Jump to content

Scripting Questions


AxlDave

Recommended Posts

 

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

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 player
set InvPos to pCont.GetNumItems;sets the position of the checker to the last item spot in the inventory
if InvPos
set InvPos to (InvPos - 1)
set pInvObj to (pCont.GetInventoryObject InvPos)

;check etc

 

i have tried several varations but untill now only breaks

generally it breaks easily - also its possible to change containers-

EDIT

Also a question

Does fquestdelaytime works in objectsripts?

Edited by kastano
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...