The_Lost_One
04-16-2002, 02:09 PM
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?
zagibu
04-16-2002, 02:31 PM
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)
The_Lost_One
04-16-2002, 02:34 PM
# 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).]
MikeC
04-16-2002, 04:40 PM
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 (http://mikec.massassi.net/) JK Editing tips, troubleshooting information, resources and more.
www.swgalaxies.net (http://www.swgalaxies.net/) For all your Star Wars Galaxies needs
The Massassi (http://www.swgalaxies.net/guilds/guild.php3?id=4) A SW Galaxies Player Association
The_Lost_One
04-17-2002, 01:22 PM
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.
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.