Author Topic: Determine Perception Range of Creature  (Read 756 times)

Legacy_Axe_Murderer

  • Full Member
  • ***
  • Posts: 199
  • Karma: +0/-0
Determine Perception Range of Creature
« Reply #15 on: August 24, 2013, 03:10:24 am »


               Perception range is one of the things laid out in ranges.2da (lines 8-10 & maybe 13), so you can use Get2DAString to look it up if you know the index it's using. Though you'd need a plugin to change it on the fly. If you aren't gonna go that route, and simply knowing what it is will be sufficient, then you ought to know ahead of time what the blueprint is going to be set to and then hard code it into that blueprint's scripts...or you could simply add a variable to the blueprint that specifies what the blueprint is set up to use and look it up that way @ runtime (since it won't be changing).

And naturally, if you do use a plugin to set it, I would imagine the plugin ought to also have an associated Get function for it as well and then your prob is solved. Don't know for sure, but I'm guessing/nearly certain the value carried on instances of the creature is merely an index into the 2DA and not the actual distance value, so you would be limited to those discrete values supported in ranges.2da (Short, Normal, Long). Unless, of course, you append new lines to it with custom values.

Perception is also a 2 layer deal. There is a primary and a secondary range (which only differ when set to long range by default, the two are identical for short and normal). I have no idea what each is used for or when each kicks in. Maybe audible range and visual range? Or direct LOS and obstructed LOS? Shouldn't be too difficult to discover through testing because you know what the distances must be limited to and OnPerception tells you why it fired via the GetLastPerception* family. I seem to recall Bioware guys saying they had some performance problems with audible perception being tracked independently of visual, so they ditched it and combined it in with visual such that the two events always fire at the same time. Thus you might not see any differences (i.e. either primary or secondary range might be unused).
               
               

               


                     Modifié par Axe_Murderer, 24 août 2013 - 02:52 .