| Hub Site >> Tests >> Code test... (Moderator: Admins) | Previous Topic | Next Topic |
| Page 1 of 1 |
|
# 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 |
| Page 1 of 1 | |
| Hub Site >> Tests >> Code test... (Moderator: Admins) | Previous Topic | Next Topic |