Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → RVTCS v3 Cog Problems...
RVTCS v3 Cog Problems...
2005-05-13, 7:23 AM #1
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."
2005-05-13, 10:52 AM #2
Why are you still using that? The thing limit has been removed via a patch. The only thing you'd need RVTCS for is distance culling for video performance reasons.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2005-05-13, 11:42 AM #3
Which is exactly what it is, Emon, if you actually take the time to read it.

As for the cog, I actually see a few errors.
One, you wouldn't want SetThingGeoMode(object, 3);

3 is the geomode for solid colored objects, of which, I have no idea what it might do. I'd suggest 4.

The next is the verb he wants to use is SetThingCurGeoMode, not SetThingGeoMode. Things apparently have two GeoMode values. GeoMode, is (I'm assuming...) basically the default value, what by default the mode should be. CurGeoMode, is the geo mode used for rendering. It's the current rendering geo mode.

The other, is apparently he forgot how to use arrays for a minute or two...

SetThingCurGeoMode(Object0, 4);

and

SetThingCurGeoMode(Object0, 0);

Those are the lines you'll want to use for setting the thing visible and invisible.
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2005-05-13, 1:35 PM #4
Quote:
Originally posted by LKOH_SniperWolf
Which is exactly what it is, Emon, if you actually take the time to read it.

No, it was designed to get around the thing limit, video performance is secondary. I don't see where in his post he specifies what it's for. If it's for thing limit, then he shouldn't bother.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2005-05-13, 3:10 PM #5
Geeze, I must have been on crack. Here is the new version...
And when the moment is right, I'm gonna fly a kite.
2005-05-13, 3:18 PM #6
The version Bevil has wasn't for getting around the thing limit, but simply to not render things outside of a certain range.

# RVTCS - Ranged Vector Thing Culling System
#
# Visibility controller - 10 objects.

It never switches to Geo 0 like it's supposed to.

That was enough for me to know it wasn't about the thing limit.
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2005-05-13, 3:28 PM #7
Well it was GBK's COG...I mean GBK wrote it...I can't trust what it says! ;)

Heh, actually I didn't look much at the COG. I didn't know RVTCS v3 was new. Though I should have noticed th length at least.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2005-05-14, 4:34 AM #8
Thanks GBK and SniperWolf!

You guys are da mad bombs! :em321:

[edit:] Woops, GBK forgot the SetThingCurGeo again..
Code:
# RVTCS - Ranged Vector Thing Creation System
#
# Visibility controller - 10 objects.
#
# Version 0.3.1
#
# 6/02,5/05 gbk
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


Now it works. :cool:
"The solution is simple."

↑ Up to the top!