Jump to content

What determines how much "lag" a script will cause?


unknownhero2827

Recommended Posts

Is length the biggest factor? I might need to make a lengthy one, which would contain a lot of lines of checking type functions, to see what has been activated already, and what can be activated that hasn't already been.

 

Could be well over 1000 lines of script. If that would slow down or crash the game though, I'll have to rethink things...

Link to comment
Share on other sites

The length is not the factor for overhead - the logic is.

 

Consider...

begin gamemode
  myObject.setPos x 0
  myObject.setPos y 0
end

...this has to be processed every time.

 

Consider

short iSet

begin gameMode
  if iSet == 0
    set iSet to 1
    myObject.setPos x 0
    myObject.setPos y 0
  endif
end

...this means the complex processing will only run once.

 

When you suggest that your program could be over 1000 lines I have to question.

Even back in the days of Modular Progamming we considered that excessive.

 

If I could suggest using a more modular and/or structured view.

Link to comment
Share on other sites

Or an array, if you just need to keep track of some references that have been activated. Makes things infinitely easier if it is possible to just check if that reference has been activated (added to the array). OBSE gives you

 

ar_Append (adds to the end of array)

ar_Find (finds in array, returns index)

ar_Erase (delete single index)

ar_Null (set array to this and it is destroyed)

 

They are all in the OBSE Command Documentation. Definitely recommended.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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