Is there anyway to take the RVTCS and alter it such that it instead of placing the thing number you simply put in a template and then the cog creates and destroys all things of that template relative to the player?
Code:
# RVTCS - Ranged Vector Thing Culling System
#
# Visibility controller - 10 objects.
#
# Version 0.3.1
#
# 6/02,5/05 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 youve used. (Just put the number of the last object)
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)
SetThingCurGeoMode(Object0, 4);
# Set the object visible...
Else
SetThingCurGeoMode(Object0, 0);
# Set the object invisible...
}
Stop;
End
"The solution is simple."



