Hub Site >> Tests >> Code test...     (Moderator: Admins) Previous Topic | Next Topic
Page 1 of 1
 Author 
 Post 
Hell Raiser
Site Developer
Post 26-Feb-2005 07:11        

Those other forums make the # ==== line have a line break, so when you copy and paste, it's fubard. Lets see if phpBB does the same thing...


# Jedi Knight Cog Script
#
# SM_Trige's light puzzle
#
# [darthslaw]
#
# This Cog is Not supported by LucasArts Entertainment Co

symbols
int      active_switches=0      local

int      surf            local

int      active0=0         local
int      active1=0         local
int      active2=0         local
int      active3=0         local
int      active4=0         local
int      active5=0         local
int      active6=0         local

surface      switch0            linkid=0
surface      switch1            linkid=1
surface      switch2            linkid=2
surface      switch3            linkid=3
surface      switch4            linkid=4
surface      switch5            linkid=5
surface      switch6            linkid=6

#linked to switch0
sector      sec0
sector      sec1
#linked to switch1
sector      sec2
sector      sec3
#linked to switch2
sector      sec4
sector      sec5
#linked to switch3
sector      sec6
sector      sec7
#linked to switch4
sector      sec8
sector      sec9
#linked to switch5
sector      sec10
sector      sec11
#linked to switch6
sector      sec12
sector      sec13
#lit when any switch is activated
sector      sector0
sector      sector1

thing      object=-1
flex      obj_speed=1.0

sound      sound0

message      activated

end

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

code
activated:
   if(GetSenderRef() == object) return;
   surf = GetSenderID();
   active0[surf] = 1 - active0[surf];
   SetWallCel(switch0[surf], active0[surf]);
   if(active0[surf])         //turned on
   {
      active_switches = active_switches + 1;
      //turn on sector lights
      SetSectorLight(sec0[surf * 2], 1, 0.0);
      SetSectorLight(sec0[surf * 2 + 1], 1, 0.0);
   }
   else
   {
      active_switches = active_switches - 1;
      //turn off sector lights
      SetSectorLight(sec0[surf * 2], 0, 0.0);
      SetSectorLight(sec0[surf * 2 + 1], 0, 0.0);
   }

   if(active_switches > 0)
   {
      SetSectorLight(sector0, 1, 0.0);
      SetSectorLight(sector1, 1, 0.0);
   }

   if(active_switches == 7)
   {
      if(GetCurFrame(object) != 1)
      {
         MoveToFrame(object, 1, obj_speed);
         PlaySoundGlobal(sound0, 1.0, 0.0, 0x0);
      }
   }
   else
   {
      if(GetCurFrame(object) != 0)
      {
         MoveToFrame(object, 0, obj_speed);
      }
   }

stop;
# ........................................................................................

end


It probably doesn't. Vbulliten is crap.

Last edited by Hell Raiser on 26-Feb-2005 21:54; edited 1 time in total
Hell Raiser
Site Developer
Post 26-Feb-2005 07:12        

Are the replied cells scrolling all the way?
Hell Raiser
Site Developer
Post 26-Feb-2005 07:14        

Yes, they are.

phpBB: 1
vbulletin: 1
Zeq: 2,147,483,647

Hell Raiser
Site Developer
Post 05-Mar-2005 08:06        

This isn't good, if I keep typing, without pressing enter, this post just scrolls on and on and on... This isn't good, if I keep typing, without pressing enter, this post just scrolls on and on and on... This isn't good, if I keep typing, without pressing enter, this post just scrolls on and on and on... This isn't good, if I keep typing, without pressing enter, this post just scrolls on and on and on... This isn't good, if I keep typing, without pressing enter, this post just scrolls on and on and on...
*** Post commands are unavailable for guests. ***