Home   Help Search Login Register  

Author Topic: Basic Unit Pointers  (Read 4614 times)

0 Members and 1 Guest are viewing this topic.

UNN

  • Guest
Re:Basic Unit Pointers
« Reply #15 on: 10 Sep 2005, 08:35:32 »
Quote
with 100 instances of the script running

If thats for what I think it is for :) You probably dont need to. Although you might be able to use it to help clean up the array, by nulling out then deleting, anything that does not need to be checked again?

Or if you were doing more than one check, and some of those checks can be handled by events? You could combine them into one boolean check, as part of your array. Using the events to update the array, via the pointer functions.

It would be interesting to see if it could reduce that 5-10 fps hit, by a bit more.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Basic Unit Pointers
« Reply #16 on: 10 Sep 2005, 10:02:27 »
Well, what I meant with 100 instances of the script was that there were hundred different objects running a distance check to objects in the array...

When a match based on certain criteria is found the loop is exited and the rest of the script is run and terminated...

5-10 FPS drop is not bad because probably that many objects would never be used in one mission...

In this case there would not be any use for the pointer stuff as in any case you would need to scan through the array element by element, with or withot pointers... You don't know the objects beforehand, and any of them can fit the certain criteria at any point in time...

This was just premilinary test because that array to be scanned can easily be like 100 elements big, probably usually even 200-300 elements, so a loop going through all those elements is way too slow method and it kills the whole purpose of the script in question...

Of course like I said this pointer stuff is highly strange venue for me so I may have misunderstood some possibilities for it's usage... :P ::)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

UNN

  • Guest
Re:Basic Unit Pointers
« Reply #17 on: 10 Sep 2005, 11:42:32 »
I was thinking of those land mine scripts you mentioned a while back, and some other stuff. But, yeah, I was sticking my neck out. There not a necessity, just a handy way to bookmark something in an array.

Quote
Of course like I said this pointer stuff is highly strange venue for me so I may have misunderstood some possibilities for it's usage

There not really pointers as such, not like array pointers. But I could not think of a better way of describing them. But arrays full stop, are to handy, to not end up finding a use for something like this, at some point.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Basic Unit Pointers
« Reply #18 on: 19 Oct 2005, 17:42:40 »
Btw, could there be some sort of check implemented that could be used to give a warning msg if there was this method already in use in say some mission or in some other Addon in the mission when an addon using this is initialised..?

That same check (globa varib?) could be then used in the addon scripts to go to secondary method if this one is in use already...

Just a thought :P

Oh, and when/if you consider these final and haven't done it yet, feel free to submit these in the function library ;)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

UNN

  • Guest
Re:Basic Unit Pointers
« Reply #19 on: 20 Oct 2005, 18:14:10 »
Quote
Btw, could there be some sort of check implemented that could be used to give a warning msg if there was this method already in use in say some mission or in some other Addon in the mission when an addon using this is initialised..?

I was going to say, I believe these type of pointers are built into VBS? So there could be a chance they will be in AA, and make these functions redundant.

But that got me thinking, you will still have the same problem, different addons\scripts all wanting to use the same pointer. I can update the functions to automatically accommodate different addons, that all use the same function. That way you won't get people overwriting each other's values.

So back to the drawing board :)
« Last Edit: 20 Oct 2005, 18:14:54 by UNN »