defeated by cogs again....


[ Follow Ups ] [ Post Followup ] [ Jed Messages ]

Posted by GMS_SLUG on February 15, 1998 at 18:09:17:

Having trouble with this cog.....

# Jedi Knight Cog Script
# Slows down sector thrust with flip of a switch
# [SLUG]

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

symbols

message startup
message activated

surface switch linkid=1 mask=0x448

vector vec0 desc=thrust_direction
float speed0=1.0 desc=thrust_speed
float speed1=1.0 desc=thrust_speed

sector sector0
sector sector1
sector sector2
end

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

code
startup:
SetWallCel(switch,0); //on
if (sector0 >= 0) SectorThrust(sector0, vec0, speed0);
if (sector1 >= 0) SectorThrust(sector1, vec0, speed0);
if (sector2 >= 0) SectorThrust(sector2, vec0, speed0);
return;

activated:
if (GetSenderID() != 1) return;

if (GetWallCel(switch) == 0)
{
SetWallCel(switch,1); //off
if (sector0 >= 0) SectorThrust(sector0, vec0, speed1);
if (sector0 >= 0) SectorThrust(sector1, vec0, speed1);
if (sector0 >= 0) SectorThrust(sector2, vec0, speed1);
}
else if (GetWallCel(switch) == 1)
{
SetWallCel(switch,0); //on
if (sector0 >= 0) SectorThrust(sector0, vec0, speed0);
if (sector0 >= 0) SectorThrust(sector1, vec0, speed0);
if (sector0 >= 0) SectorThrust(sector2, vec0, speed0);
end



Follow Ups:



Post a Followup

Name:
E-Mail:
Subject:
Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ Jed Messages ]