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 → Problem with conveyor style cogs
Problem with conveyor style cogs
2005-04-10, 7:43 PM #1
When I've recently gone to make a rounded waterfall (i.e., the trajectory of the waterfall is protrusive, so as to seem realistic), I've noticed that basic conveyer cogs seem to animate the surfaces at different speeds (basically, the larger surfaces are slower than those small). So, to cut to the chase, I'm having trouble manipulating the cogs to make the surfaces animate in concordance.
2005-04-10, 9:10 PM #2
I vaguely recall Halucid/SniperWolf working on a cog that dealt with conveyors on sloped surfaces. I may be misunderstanding you, but ask one of them. I'll look around a bit for the thread.
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2005-04-10, 9:11 PM #3
Scroll down to SniperWolf's last few posts.

click
2005-04-10, 9:13 PM #4
Here it is!

http://forums.massassi.net/vb/showthread.php?s=&threadid=11993&highlight=conveyor


Curse you CavEmaN, I'll get you !!!!
My JK Level Design | 2005 JK Hub Level Pack (Plexus) | Massassi Levels
2005-04-10, 11:10 PM #5
I noticed that scrolling surfaces never seem to properly line up, even though I line them up in Jed =\ *goes to link*
ORJ / My Level: ORJ Temple Tournament I
2005-04-11, 5:32 AM #6
That's exactly what I was looking for, thanks! I had actually come to the same conclusion as halucid and had tried the same method he suggested where each surface had their own vector, but, strangely, it didn't work. I’d put it down to the fact that my math -> cog skills are, shall we say, unrefined.
2005-04-11, 6:10 PM #7
Weird, I finally got the chance to use it, and it doesn't work.

Code:
# Jedi Knight Cog Script
# Jedi Knight Cog Script
#
# 00_conveyor.cog
#
# generic conveyor belt script
#
# This script will control 1-8 conveyor belts moving in the same direction
# and with the same velocity.  The conveyors run continuously.
#
# [IS]
#
# LKOH_SniperWolf
# 07/2004
# Updated to slide selected surfaces the X & Y, in relation to the surface itself.
# Same effect as changing position of texture in 2d relations.
# Positive X is to the right, positive Y is up.  These act as vector components, and so an
# amount.  IE, X:5 Y:5 will have a greater effect than X:1 Y:1
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
#  ========================================================================================

symbols
	message	startup

        float		X			desc=conveyor_x_direction
        float		Y			desc=conveyor_y_direction
	vector	vec0              local
	vector	newVec		local
	vector	tempVec		local
	vector	tempVec2		local

	float		speed=2.0	      desc=conveyor_speed

	surface	convey0		nolink
	surface	convey1		nolink
	surface	convey2		nolink
	surface	convey3		nolink
	surface	convey4		nolink
	surface	convey5		nolink
	surface	convey6		nolink
	surface	convey7		nolink

	int		garbage		local
	int		cnt			local
end

#  ========================================================================================

code
startup:
	for (cnt = 0; cnt<=7; cnt=cnt+1){
		if (convey0[cnt] >= 0){
                // The following uses various calculations to create a new vector appropriate for the surface
                // Basically, it just creates a new vector already aligned to the conveyor surface, and uses it to slide
                // the surface the X and Y in the inputted vector relative to the surface.


                tempVec = VectorCross(GetSurfaceNormal(convey0[cnt]), '0 0 -1');
                if ((VectorX(GetSurfaceNormal(convey0[cnt]) == 0)  && (VectorY(GetSurfaceNormal(convey0[cnt]) == 0)){
                    tempVec = VectorCross(GetSurfaceNormal(convey0[cnt]), '0 -1 0');
                }

                tempVec = VectorNorm(tempVec);
                vec0 = VectorSet(X*VectorX(tempVec), X*VectorY(tempVec), X*VectorZ(tempVec));
                tempVec = vec0;

                tempVec2 = VectorCross(GetSurfaceNormal(convey0[cnt]), tempVec);
                tempVec2 = VectorNorm(tempVec2);
                vec0 = VectorSet(Y*VectorX(tempVec2), Y*VectorY(tempVec2), Y*VectorZ(tempVec2));
                tempVec2 = vec0;

                newVec = VectorAdd(tempVec, tempVec2);
                garbage=slidewall(convey0[cnt], newVec, speed);
            }
	}
	return;
end
2005-04-11, 9:15 PM #8
Looks like you didn't copy correctly. From the looks of it, the forums messed up one of the lines...
# ==================================================
======================================

That all needs to go on one line. Otherwise, the === aren't properly commented out, and the cog won't work.
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2005-04-12, 6:48 AM #9
Actually, I corrected that in the final cog file. It's just something it does everytime you subject it to
Code:
 brackets. 

But maybe there's something else eluding me  that was screwed up by the forums. Help? :\
2005-04-12, 10:27 AM #10
Yeah, it messed up your <> signs on code line two and three.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2005-04-12, 10:57 AM #11
Er.. I don't see what you're talking about. Would ya mind editing it in Notepad or whatever and attaching it?
2005-04-12, 2:37 PM #12
Try this. It should work. I think I got all the forum stupidities out...
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2005-04-12, 2:48 PM #13
Just change the extension, and it SHOULD work, unless I'm missing something...
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2005-04-12, 6:27 PM #14
Still doesn't work. :\ I'll probably just end up doing away with the curved waterfall if I can't figure out the problem.
2005-04-12, 8:05 PM #15
Fixed... Apparently after halucid got it, I modified it slightly. Because of the way the vectors were done, this left an error if the X chosen was 0. This has been fixed. The appropriate file is attached below. You should have no problems whatsoever. (This has gone through several more tests. (I should note, I don't think in original testing, 0 was ever used for X...))
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2005-04-12, 9:30 PM #16
I gotta say, I really appreciate your persistence. It works bootifully.

↑ Up to the top!