Page 1 of 1

Far-sighted Friendlies

PostPosted: Thu Jul 29, 2021 11:24 am
by Daryn
Hello all, again.

I'm working on something with a friend, and I'm building a turret for an emplacement he wants in the map. It's mostly working, I just used a friendly monster that doesn't move, and adjsted its Missile cycle to taste. But we're finding it doesn't see far enough.

I'm using A_LookEx to set the max units it can see, but he wiki notes that there is a hard cap of 1280 units for friendly monsters. Is there another method I could use for sight checking that ould let my turret see further? Or is the friendly monster approach not what I want to use for this?

Thanks.

Re: Far-sighted Friendlies

PostPosted: Thu Jul 29, 2021 7:42 pm
by Blue Shadow
Daryn wrote:I'm using A_LookEx to set the max units it can see, but he wiki notes that there is a hard cap of 1280 units for friendly monsters.

There isn't anymore, as you can use the FriendlySeeBlocks actor property to adjust the max distance.

Re: Far-sighted Friendlies

PostPosted: Thu Jul 29, 2021 7:48 pm
by inkoalawetrust
The range in which friendly actors can see is actually determined by the FriendlySeeBlocks property, which is 10 by default, or 1280 map units like you mentioned.

Unfortunately this property is read-only, so it cannot be changed on the fly with ZScript and custom functions, otherwise I'd have also put some code here for an A_SetSeeBlocks() function that allows you to change the property in DECORATE as well.

Edit: Fuck, BlueShadow responded before me because I wasted my time making the function above before realizing that the property is read-only.

Code: Select allExpand view
   Void A_SetSeeBlocks (Int Blocks = 10, Int Pointer = AAPTR_DEFAULT)
   {
      Actor AAPTR = GetPointer (Pointer)
      If (AAPTR) {AAPTR.FriendlySeeBlocks = Blocks;}
   }

Re: Far-sighted Friendlies

PostPosted: Thu Jul 29, 2021 10:00 pm
by Daryn
I appreciate the help, nonetheless. If the property can't be modified on-the-fly, that's fine. The wiki implies it can be changed/set initially, though. I'll mess around with it in the morning and see what happens. If it doesn't work, it doesn't work. At least I have something I can try.