For some reason, all the resistors randomly jumped into the water in the harbour, and killing one had no effect whatsoever on the others.
I'm thinking it's a problem with my For command? should I call a message (see the annotated 'call evil' that I cut out)??? Help, please!
Code:
# Rites of Xanthus TC Cog Script # # NOTREASON.COG # 5.24.02 # -by Lord_Grismath (GrismathDynasty@Hotmail.com) # # Description # # The Resistor AI has been modified to, when killed # by the player, send a message to this COG, which will # in turn cause up to 9 other rebels in the defined area # to turn on the player. # # Especially realistic because only people who are present # will react. # # This Cog is Not supported by LucasArts Entertainment Co symbols message startup message killed thing res00 thing res01 thing res02 thing res03 thing res04 thing res05 thing res06 thing res07 thing res08 thing res09 thing player local flex rval local int traitor=0 local int I=1 local AI peace AI hostile sound manaSnd=ForceFieldHit01.WAV local sound evil01 sound evil02 sound evil03 end # ======================================================================================== code startup: player = GetLocalPlayerThing(); return; # ........................................................................................ killed: killer = GetSourceRef(); For(I=0;I<10;I=I+1) { if(GetSenderRef=res0) { // Player killed a FRIENDLY resistor. >:[ if (player == killer) { PlaySoundLocal(manaSnd, 1, 0, 4); ChangeInv( player, 72, 1.0 ); SetInv(player, 14, 0); // *GASP* You murderer! if(traitor = 0) { traitor = 1; rval = Rand(); if (rval < 0.05) { print("What? I shall avenge thee!"); PlaySoundLocal(evil1, 1, 0.0, 0x0); } else if (rval <0.10) { print("Fiend! How darest thou kill thy allies!"); PlaySoundLocal(evil2, 1, 0.0, 0x0); } else if (rval <0.15) { print("Traitor! Thou shalt pay for this!"); PlaySoundLocal(evil3, 1, 0.0, 0x0); } // Chaaaaaaarge!!!! // Call evil; AISetClass(res0, hostile); AISetMoveThing(res0, player); } } } return; # ........................................................................................ # ........................................................................................ end