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 → Move 3do in MP
Move 3do in MP
2001-03-17, 11:14 AM #1
Hi all!

Sorry for asking dumb questions... [http://forums.massassi.net/html/wink.gif]

I need a (probably pretty simple) COG to have a 3do loop through 3 or 4 frames permanently in Multiplayer. There's probably a COG around to do it, but since I'm such a COG-dumbo, I thought I'd ask first - so: Any ideas or (even better [http://forums.massassi.net/html/wink.gif] ) code bits? It's a very simple 3do, no keys, pups or anything, btw.

Thanks a lot for your help!

Cheers,
Goofz
2001-03-17, 12:59 PM #2
here i made a cog for ya. I just took the generic doors cog and added a single line. After it calls CloseDoors i made it call OpenDoors so after each time it finishes its frames it starts over again. To use it just set it as a door but add more frames to the 3do, and remember to change numframes. It should work but if not i will try again. Here is the cog:

Code:
# Jedi Knight Cog Script
#
# The cog for you.
#
# took generic door and after it finishes its frames it calls open doors again
#
# [Han5678]
#
# ========================================================================================

symbols
	message	startup		
	message	activate	
	message	arrived		
	message	timer		
	message	blocked		

	thing		door0		linkid=0 mask=0x405
	thing		door1		linkid=1 mask=0x405
	thing		door2		linkid=2 mask=0x405
	thing		door3		linkid=3 mask=0x405

	float		moveSpeed=8.0
	float		sleepTime=2.0
	float		lightValue=0.5

	sector	doorSector	local
	int		numDoors=0	local
	int		doorStatus	local
	int		moveStatus	local
	int		i				local
end

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

code

startup:
	for (i=0; i<=3; i=i+1)
		if (door0 >= 0) numDoors = numDoors + 1;

	doorSector = GetThingSector(door0);
	SetSectorAdjoins(doorSector, 0);
	SetSectorLight(doorSector, lightValue, 0.0);		// add some light to door sector
	return;

# ........................................................................................

activate:
	call CheckStatus;
	if (moveStatus) return;
	if (doorStatus == 0) {					// all pieces are at frame 0
		SetSectorAdjoins(doorSector, 1);
		call OpenDoors;
	}
	return;

# ........................................................................................

arrived:
	call CheckStatus;
	if (moveStatus) return;
	if (doorStatus == numDoors) {				// all pieces are at frame 1
		SetTimer(sleepTime);
	} else if (doorStatus == 0) {				// all pieces are at frame 0
		SetSectorAdjoins(doorSector, 0);
	}
	return;

# ........................................................................................

blocked:
	call OpenDoors;
	return;

# ........................................................................................

timer:
	call CloseDoors;
	return;

# ........................................................................................

OpenDoors:
	for (i=0; i<=3; i=i+1)
		if (door0 >= 0) MoveToFrame(door0, 1, moveSpeed);
	return;

# ........................................................................................

CloseDoors:
	for (i=0; i<=3; i=i+1)
		if (door0 >= 0) MoveToFrame(door0, 0, moveSpeed);
call OpenDoors;	
return;

# ........................................................................................

CheckStatus:
	moveStatus = 0;
	doorStatus = 0;

	for (i=0; i<=3; i=i+1) {
		if (door0 >= 0) {
			moveStatus = moveStatus + IsThingMoving(door0);
			doorStatus = doorStatus + GetCurFrame(door0);
		}
	}
	return;

end


hope it works
[edit] i just thought of something u want it to start moving when the level is started right? Because u have to activate this for t to start moving. [/edit]

[This message has been edited by Han5678 (edited March 17, 2001).]
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-03-17, 11:53 PM #3
Hi.

Thanks a lot!

I'll try that and tell you if it works [http://forums.massassi.net/html/smile.gif] You'll be in the readme, of course [http://forums.massassi.net/html/wink.gif]

Cheers,
Goofz

[This message has been edited by Goofz (edited March 18, 2001).]

↑ Up to the top!