Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → JO like set room light off - freeze Imperials in it.
JO like set room light off - freeze Imperials in it.
2003-01-16, 2:39 AM #1
This is strange cog, i have idea for freeze all enemies (something like JK aisleep.cog) in room and set light (of 5 lamps (setthinglight)) but i havent got idea for unfreeze (do some noisy action, jump, set saber, fire etc)


ENY idea??
2003-01-16, 2:41 AM #2
ahh - Game platform = JK DF II
2003-01-17, 11:59 AM #3
Show us how you would do the freezing, it might help.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2003-01-17, 10:24 PM #4
freezing part:
Code:
# Jedi Knight Cog Script
#
# ailightroom.cog
#
# 
# [EH_AceCSF]
#
# Not supported by LEC.   
#=========================================================================

symbols
message	    startup
message     activated
message	    user0


surface      switch1                            linkid=1  

	thing		enemy0		nolink
	thing		enemy1		nolink
	thing		enemy2		nolink
	thing		enemy3		nolink
	thing		enemy4		nolink
	thing		enemy5		nolink
	thing		enemy6		nolink
	thing		enemy7		nolink
	thing			Light0		nolink
	thing			Light1		nolink
	thing			Light2		nolink
	thing			Light3		nolink
	thing			Light4		nolink
	thing			Light5		nolink

int             done=0                            local                         
int             startlight=3.0

end

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

code
startup:
	SetThingLight(Light0, startlight, 0.0);
	SetThingLight(Light1, startlight, 0.0);	
	SetThingLight(Light2, startlight, 0.0);
	SetThingLight(Light3, startlight, 0.0);	
	SetThingLight(Light4, startlight, 0.0);
	SetThingLight(Light5, startlight, 0.0);
	return;

# ........................................................................................

activated:
 if ((GetSenderID() == 1) && (done == 0))	
	{
	SetThingLight(Light0, 0.0, 0.0);
	SetThingLight(Light1, 0.0, 0.0);	
	SetThingLight(Light2, 0.0, 0.0);
	SetThingLight(Light3, 0.0, 0.0);	
	SetThingLight(Light4, 0.0, 0.0);
	SetThingLight(Light5, 0.0, 0.0);        
	AISetMode(enemy0, 0x2000);
	AISetMode(enemy1, 0x2000);
	AISetMode(enemy2, 0x2000);
	AISetMode(enemy3, 0x2000);
	AISetMode(enemy4, 0x2000);
	AISetMode(enemy5, 0x2000);
	AISetMode(enemy6, 0x2000);
	AISetMode(enemy7, 0x2000);
        Sleep(2.0);
	Print("ahh, this must be another light demage, hold your position");
        done=1;
	}
	return;
	
# ........................................................................................

user0:
	activated;
	return;

end



[This message has been edited by EH_AceCSF (edited January 18, 2003).]

[This message has been edited by GBK (edited January 23, 2003).]
2003-01-20, 4:33 AM #5
eny idea NOW?
2003-01-20, 5:18 AM #6
WTF? That's a little messed up cog there. *coughactivated;cough* And use CODE TAGS!!!!

Trya thisa coga.
Code:
# Jedi Knight Cog Script
#
# When a switch is pressed, disable actors
#
# [DP]
#
symbols
surface    switch
thing      light              nolink
thing      light1             nolink
thing      light2             nolink
thing      light3             nolink
thing      light4             nolink
thing      light5             nolink
thing      badguy             nolink
thing      badguy1            nolink
thing      badguy2            nolink
thing      badguy3            nolink
thing      badguy4            nolink
thing      badguy5            nolink
thing      badguy6            nolink
thing      badguy7            nolink
thing      badguy8            nolink
thing      badguy9            nolink

int        i                  local
int        on=1
flex       lighton=1
flex       lightoff=0
flex       delay=3
sound      wav0=Activate02.wav

message    startup
message    activaed
message    timer

end

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

code

Startup:
   For(i=0; i<6; i=i+1)
      SetThingLight(light, lighton[on], 0);
   SetWallCel(switch, on);
   Return;

# ........................................................................................

Activaed:
   on = 1 - on;
   SetWallCel(switch, on);
   PlaySoundPos(wav0, SurfaceCenter(switch), 0.6, -1, -1, 0);
   For(i=0; i<6; i=i+1)
      SetThingLight(light, lighton[on], 0);
   If(!on)
   {
      For(i=0; i<10; i=i+1)
         AISetMode(badguy, 0x2000);
      SetTimer(delay);
   }
   Else
   {
      For(i=0; i<10; i=i+1)
         AIClearMode(badguy, 0x2000);
   }
   Return;

# ........................................................................................

Timer:
   call Activated;
   Return;

end
This is a switchable light, but will reset after the delay.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2003-01-20, 5:49 AM #7
ok.. but NOW player activ swith jump with lightsaber and kill all. This looks unrealistic. I need unfreeze part, not freezing part. as well, thanks for better cog
2003-01-20, 7:23 AM #8
and activated: not activaed
2003-01-20, 8:55 AM #9
ok, This is cog with unfreeze part, but it crush when i press swith [http://forums.massassi.net/html/frown.gif] [http://forums.massassi.net/html/frown.gif] [http://forums.massassi.net/html/frown.gif]
Someone can correct this?

Code:
# Jedi Knight Cog Script
#
# When a switch is pressed, disable actors
#
# [DP & EH_AceCSF]
# Not supported by LEC
#====================================================================================
symbols

surface    switch

sector     sector0
sector     sector1
sector     sector2
thing      light              nolink
thing      light1             nolink
thing      light2             nolink
thing      light3             nolink
thing      light4             nolink
thing      light5             nolink
thing      badguy             linkid=0
thing      badguy1            linkid=0
thing      badguy2            linkid=0
thing      badguy3            linkid=0
thing      badguy4            linkid=0
thing      badguy5            linkid=0
thing      badguy6            linkid=0
thing      badguy7            linkid=0
thing      badguy8            linkid=0
thing      badguy9            linkid=0

int        i                  local
int        on=1

flex       lighton=1          local
flex       lightoff=0         local
flex       delay=360

sound      wav0=Activate02.wav

message    startup
message    activated
message    timer
message    Fire
message    Touched
message    Pulse
message    playeraction
end
#========================================================================================
code
Startup:
player=jkGetLocalPlayer();
   For(i=0; i<6; i=i+1)
{
      SetThingLight(light, lighton, 0);
}
   SetWallCel(switch, on);
   Return;
# ........................................................................................
activated:
   on = 0;
   SetWallCel(switch, on);
   PlaySoundPos(wav0, SurfaceCenter(switch), 0.6, -1, -1, 0);
   For(i=0; i<6; i=i+1)
      SetThingLight(light, lightoff, 0);
   If(!on)
   {
      For(i=0; i<10; i=i+1)
         AISetMode(badguy, 0x2000);
   }
      SetTimer(delay);
      Print("This must be another power demage, hold your position.");
      SetPulse(0.001); 
   Return;
# ........................................................................................
Timer:
	
   call UnfreezeTime;
	
   
# ........................................................................................
Fire:
	
	call unfreeze;
	
	
# ........................................................................................
Touched:
    if (GetSenderID() == 0)
	
	call unfreeze;
	
	
# ........................................................................................
playeraction:
   if (GetParam(0) == 0.0)
	     
	call unfreeze;
		
# ........................................................................................
UnfreezeTime:
	{
      For(i=0; i<10; i=i+1)
         AIClearMode(badguy, 0x2000);
	}
      For(i=0; i<6; i=i+1)
	{
         SetThingLight(light, lighton, 0);
	}
      Print("ok, light is back on-line.");
         on = 1;
	
Unfreeze:
	{
      For(i=0; i<10; i=i+1)
         AIClearMode(badguy, 0x2000);
        }
      Print("This is that Jedi! Kill Him!!");
	
# ........................................................................................
Pulse:
{ 
If((GetCurWeapon(player) == 10) && (GetThingsector(player) == sector))
{
call unfreeze;
SetPulse(0);
}
}
Return;
end



[This message has been edited by GBK (edited January 23, 2003).]
2003-01-23, 1:57 AM #10
eny idea?
2003-01-23, 8:08 AM #11
If you learn how to spell, people might understand what you're saying and be able to figure out a solution. -_-
2003-01-23, 8:56 AM #12
well.. i have completly no idea what is wrong.. that {{ }} in Pulse ({ before get) was removed to { after get but that not help

GBK perhaps?
2003-01-23, 2:29 PM #13
Ok, you need to be more careful when using brackets. Im suprised that cog even compiled.

Code:
# Jedi Knight Cog Script
#
# When a switch is pressed, disable actors
#
# [DP & EH_AceCSF]
# Not supported by LEC
#====================================================================================
symbols

surface switch

sector sector0
sector sector1
sector sector2
thing light nolink
thing light1 nolink
thing light2 nolink
thing light3 nolink
thing light4 nolink
thing light5 nolink
thing badguy linkid=0
thing badguy1 linkid=0
thing badguy2 linkid=0
thing badguy3 linkid=0
thing badguy4 linkid=0
thing badguy5 linkid=0
thing badguy6 linkid=0
thing badguy7 linkid=0
thing badguy8 linkid=0
thing badguy9 linkid=0

Thing Player Local

int i local
int on=1

flex lighton=1 local
flex lightoff=0 local
flex delay=360

sound wav0=Activate02.wav

message startup
message activated
message timer
message Touched
message Pulse
end
#========================================================================================
code
Startup:
player=jkGetLocalPlayer();
For(i=0; i<6; i=i+1)
{
SetThingLight(light, lighton, 0);
}
SetWallCel(switch, on);
Return;
# ........................................................................................
activated:
on = 0;
SetWallCel(switch, on);
PlaySoundPos(wav0, SurfaceCenter(switch), 0.6, -1, -1, 0);
For(i=0; i<6; i=i+1)
SetThingLight(light, lightoff, 0);
If(!on)
{
For(i=0; i<10; i=i+1)
AISetMode(badguy, 0x2000);
}
SetTimer(delay);
Print("This must be another power demage, hold your position.");
SetPulse(0.001);
Return;
# ........................................................................................
Timer:

call UnfreezeTime;
Stop;

# ........................................................................................

# ........................................................................................
Touched:
if (GetSenderID() == 0)

call unfreeze;
Stop;

# ........................................................................................
UnfreezeTime:
For(i=0; i<10; i=i+1)
AIClearMode(badguy, 0x2000);
For(i=0; i<6; i=i+1)
SetThingLight(light, lighton, 0);
Print("ok, light is back on-line.");
on = 1;
Stop;

Unfreeze:
For(i=0; i<10; i=i+1)
AIClearMode(badguy, 0x2000);
Print("This is that Jedi! Kill Him!!");
Stop;
# ........................................................................................
Pulse:
If((GetCurWeapon(player) == 10) && (GetThingsector(player) == sector0)) {
call unfreeze;
SetPulse(0); }
Return;
end


I didnt test it, but Parsec likes it.

[This message has been edited by GBK (edited January 23, 2003).]
And when the moment is right, I'm gonna fly a kite.
2003-01-23, 6:00 PM #14
My way was simpler, and if I could spell that one word right, it might have worked. [http://forums.massassi.net/html/wink.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack

↑ Up to the top!