Code:
# RVTCS - Ranged Vector Thing Culling System
#
# Visibility controller - 10 objects.
#
# Version 0.3
#
# 06/2002 GBK
# Cog used to supliment as a primitive object culling system for JK. Good for up to 10 objects.
# Must be used with the JK.EXE Patch.
Flags=0x240
Symbols
Message Startup
Message Pulse
Thing Player Local
Int Used=0 #How many objects you've used. (count 0 as 1).
Flex Min_range=0 #Distance to/from player in which an object is visible.
Flex Max_range=2
Flex Pulserate=0.1 #How often the cog checks for distance.
Thing Object0
Thing Object1
Thing Object2
Thing Object3
Thing Object4
Thing Object5
Thing Object6
Thing Object7
Thing Object8
Thing Object9
Int I=0 Local
Vector Pos_T Local
End
Code
Startup:
Sleep(Getselfcog()/10);
Player = JKgetlocalplayer();
Setpulse(Pulserate);
Stop;
Pulse:
Pos_t = Getthingpos(Player);
For(I=0;I<=Used;I=I+1)
{
If(Vectordist(Getthingpos(Object0), Pos_t) <= Max_range && Vectordist(Getthingpos(Object0), Pos_t) >= Min_range)
Setthinggeomode(Object, 3);
# Set the object visible...
Else
Setthinggeomode(Object, 0);
# Set the object invisible...
}
Stop;
End
It doesn't seem to work at all. For one object, I tried both 0 and 1 for the Int number. I entered the things number in the first appropriate value space for it. Set the min to 0 and the max to 2. I left the pulse at 0.1. It never switches to Geo 0 like it's supposed to.

"The solution is simple."


