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 → reactor thrust problem....
reactor thrust problem....
2002-04-16, 11:09 AM #1
It's not REALLY a cog problem...or is it?

well, anyways....HOW do i get the thrust to turn OFF after so many seconds???

I'm using a little switch thing for it, the thrust doesn't go on til i press the switch, but then after i turn it on, it does NOT stop.

What do i do?
Peace is a lie
There is only passion
Through passion I gain strength
Through strength I gain power
Through power I gain victory
Through victory my chains are broken
The Force shall set me free
2002-04-16, 11:31 AM #2
This is a cog problem. Post it and we'll see.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-04-16, 11:34 AM #3
Code:
# Jedi Knight Cog Script
#
# 00_reactorthrust.cog
#
# Multiplayer sectorthrust trap.
#
# This script will control 2 sector thrust sectors thrusting in the same direction
# and with the same velocity.  The thrusts activate with a switch.
#
# [IS/JS]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved		
# ========================================================================================

symbols

message		startup	
message		activate	
message		arrived
message		entered
message		timer	

int			currentThing		local
int			i						local

vector		playerVec			local
vector		vec0					desc=thrust_direction

float			thrustspeed=1.0	desc=thrust_speed
float			doorspeed=2.0 		desc=speed of the doors
float			sleeptime=2.0		desc=seconds that the doors pause

thing			door0					linkid=2
thing			door1					nolink
thing			door2					nolink
thing			door3					nolink

surface		Switch				linkid=1

sector		sector0	
sector		sector1	

thing			light0				nolink
float			lspeed=4.0			desc=light_speed
sound			wav0
sound			wav1
thing			thing0
float			fadetime=4.0
end

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

code
startup:
	SetTimer(0.1);
	channel=PlaySoundThing(wav0, thing0, 0.01, -1, -1, 1);
	return;
	
# ........................................................................................

activate:
	if (GetSenderID() != 1) return;
	if (GetWallCel(switch) == 1) return; 

	SetWallCel(Switch, 1);
	PlaySoundPos(wav1, SurfaceCenter(switch), 1, -1, -1, 0);
	ChangeSoundVol(channel, 1.5, fadetime/2); 
	ChangeSoundPitch(channel, 1, fadetime/2); 
	MoveToFrame(door0, 1, doorspeed);
	MoveToFrame(door1, 1, doorspeed);
	MoveToFrame(door2, 1, doorspeed);
	MoveToFrame(door3, 1, doorspeed);
	SectorThrust(sector0, vec0, thrustspeed);
	SectorThrust(sector1, vec0, thrustspeed);
	MoveToFrame(light0, 1, lspeed);

	// unattach all players in sectors
	currentThing = FirstThingInSector(sector0);
	while (currentThing != -1) {
		call reactorpull;
		currentThing = NextThingInSector(currentThing);
	}
	
	currentThing = FirstThingInSector(sector1);
	while (currentThing != -1) {
		call reactorpull;
		currentThing = NextThingInSector(currentThing);
	}	
	return;

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

arrived:  
	if (GetCurFrame(GetSenderRef()) == 0) {
		SetWallCel(switch, 0);
		PlaySoundPos(wav1, SurfaceCenter(switch), 1, -1, -1, 0);
		SectorThrust(sector0, vec0, 0.0);
		SectorThrust(sector1, vec0, 0.0);
	} else {
		MoveToFrame(door0, 0, doorspeed);
		MoveToFrame(door1, 0, doorspeed);
		MoveToFrame(door2, 0, doorspeed);
		MoveToFrame(door3, 0, doorspeed);
		MoveToFrame(light0, 0, lspeed);
		ChangeSoundVol(channel, 0.1, fadetime); 
		ChangeSoundPitch(channel, 0.1, fadetime); 
	}
	
	return;

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

timer:
	ChangeSoundPitch(channel, 0.1, 0.1); 
	return;
		
# ........................................................................................

entered:
	if (GetSenderId() !=0) return;
	if (GetWallCel(switch) !=1) return;
	currentThing = GetSourceRef();
	// fall through
	
# ........................................................................................

reactorpull:
	if (GetThingType(currentThing) == 10) {
		DetachThing(currentThing);
		playerVec = GetThingVel(currentThing);
		playerVec = VectorAdd(vec0, playerVec);
		SetThingVel(currentThing, playerVec);
	}
	return;

end


edited to make it smaller...


[This message has been edited by The_Lost_One (edited April 16, 2002).]
Peace is a lie
There is only passion
Through passion I gain strength
Through strength I gain power
Through power I gain victory
Through victory my chains are broken
The Force shall set me free
2002-04-16, 1:40 PM #4
Most definately a cog problem. It should be in the cog forum. We try not to have lots of cog script listed in the main editing forum. I'll move it to the cog forum for you.

------------------
Have Lightsaber Will Travel JK Editing tips, troubleshooting information, resources and more.
www.swgalaxies.net For all your Star Wars Galaxies needs
The Massassi A SW Galaxies Player Association
Have Lightsaber Will Travel JK Editing tips, troubleshooting information, resources and more.
www.swgalaxies.net For all your Star Wars Galaxies needs
The Massassi A SW Galaxies Player Association
2002-04-17, 9:24 AM #5
oops.
Peace is a lie
There is only passion
Through passion I gain strength
Through strength I gain power
Through power I gain victory
Through victory my chains are broken
The Force shall set me free
2002-04-17, 10:22 AM #6
ok, i got it fixed, the problem was i wasn't using a door with it. thanks for nothing.

[http://forums.massassi.net/html/smile.gif]

------------------
And with this post, a little Aresenian Insanity infects the thread.
Peace is a lie
There is only passion
Through passion I gain strength
Through strength I gain power
Through power I gain victory
Through victory my chains are broken
The Force shall set me free

↑ Up to the top!