Posted by Stealth on February 08, 1998 at 04:37:31:
In Reply to: Activating SectorThrust with a switch posted by Pele on February 07, 1998 at 19:46:43:
> I am trying to get a switch to activate sector thrust, but I can't seem to get it to work...many people who are 'fluent' in cog have looked at this script and nobody can see what is wrong. I hope somewhere here can see what is wrong ...thanx in advance! :-)
> #
> #
> #
>
> symbols
>
> message activate
> vector vec0 desc=thrust_direction
> flex speed=1.0 desc=thrust_speed // I also tried float here...
> sector sector0
> sector sector1
> sector sector2
> sector sector3
> sector sector4
> sector sector5
> sector sector6
> sector sector7
> surface Switch linkid=1
>
> end
>
> code
> //-----------------------------------------------------------------------------
>
> activate:
> if (GetSenderID() != 1) Return;
> if (GetWallCel(Switch) == 1) Return;
> SetWallCel(Switch, 1);
> if (sector0 >= 0) SectorThrust(sector0, vec0, speed);
> if (sector1 >= 0) SectorThrust(sector1, vec0, speed);
> if (sector2 >= 0) SectorThrust(sector2, vec0, speed);
> if (sector3 >= 0) SectorThrust(sector3, vec0, speed);
> if (sector4 >= 0) SectorThrust(sector4, vec0, speed);
> if (sector5 >= 0) SectorThrust(sector5, vec0, speed);
> if (sector6 >= 0) SectorThrust(sector6, vec0, speed);
> if (sector7 >= 0) SectorThrust(sector7, vec0, speed);
>
> Return;
> end
A few notes..
1. should use activated: verses activate:
2. should use SetSectorThrust verses SectorThrust
3. what value are you using for the vector variable ?