Edward
06-10-2004, 07:02 AM
Hi!
I've modified Force Seeing so that all surfaces will become Green Code from the matrix. Now, if a surface has a COG associated to it, it would become Gold Code, and I found it a little... little... If you are the one in the Matrix, I thought, you should be able to see any object with a COG attached to it, so... I edited some, and did so that sectors with a COG attached would get something created in the middle, and objects with a COG would flicker between Render Texture and Render Solid Colors. But, when ever I deactivate the Force, the game crashes... Could someone help me out!
# Jedi Knight Cog Script
#
# FORCE_SEEING.COG
#
# FORCEPOWER Script - Seeing
# Light Side Power
# Bin 23
#
# [YB]
# [SF]pjb did Code Seeing.
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
thing player local
flex cost=30.0 local
flex mana local
sound seeingSound=ForceSee01.WAV local
sound seeingSound2=vibes2.wav local
int channel=-1 local
int rank=0 local
int flags=0 local
int old_flags=0 local
template t=+lightninghit local
int effectHandle=-1 local
material greencode=code.mat local
material yellowcode=code2.mat local
int i local
surface x local
int zz=0 local
thing z local
int zzz=0 local
sector y local
int yy local
int zzzz=0; local
message startup
message shutdown
message activated
message timer
message pulse
message newplayer
message killed
message selected
end
# ================================================== ======================================
code
startup:
player = GetLocalPlayerThing();
old_flags = GetMapModeFlags();
sleep(0.1);
HeapNew(0, getsurfacecount()+1);
for(i=0; i<=GetSurfaceCount(); i=i+1)
{
heapset(i,getsurfacemat(i));
if(GetSurfaceFlags(i) & 0x2) { SetSurfaceMat(i, yellowcode); }
else { SetSurfaceMat(i, greencode); }
}
sleep(0.1);
call stop_power;
Return;
# .................................................. ......................................
shutdown:
call stop_power;
Return;
# .................................................. ......................................
activated:
if(!IsInvActivated(player, 23))
{
mana = GetInv(player, 14);
if(mana >= cost)
{
if(GetInv(player, 65) != 1) ChangeInv(player, 14, -cost);
rank = GetInv(player, 23);
if(rank == 1) flags = 0xc; // players & actors
else if(rank == 2) flags = 0xc; // players & actors
else if(rank == 3) flags = 0x1c; // players & actors & items
else if(rank == 4) flags = 0x4c; // players & actors & items & projectiles
PlayMode(player, 24);
// Play activation sound
channel = PlaySoundThing(seeingSound, player, 1.0, -1, -1, 0x80);
if(GetDebugModeFlags() & 0x400)
ChangeSoundPitch(channel,0.5,0.01);
// Play loop sound at 0.0 volume and fade it in to 1.0 volume in 0.75 secs
channel = PlaySoundThing(seeingSound2, player, 0.0, -1, -1, 0x81);
ChangeSoundVol(channel, 1.0, 0.75);
effectHandle = newColorEffect(1, 1, 1, 0, 0, 0, 0, 0, 0, 1.0);
for(i=0; i<=GetSurfaceCount(); i=i+1)
{
heapset(i,getsurfacemat(i));
if(GetSurfaceFlags(i) & 0x2){ SetSurfaceMat(i, yellowcode); }
else { SetSurfaceMat(i, greencode); }
}
EnableIRMode(1, 1);
old_flags = GetMapModeFlags();
SetMapModeFlags(flags);
SetInvActivated(player, 23, 1);
zz=0;
zzz=0;
zzzz=0;
SetPulse(0.01);
}
}
else { call stop_power; }
Return;
# .................................................. ......................................
timer:
call stop_power;
Return;
# .................................................. ......................................
pulse:
// check that the player didn't die
if(GetThingHealth(player) < 1)
{
call stop_power;
}
if(GetActorFlags(player) & 0x200000)
{
call stop_power;
}
zzz=zzz+1;
if(zzz==10)
{
for(z=0; z<=GetThingCount(); z=z+1)
{
if(GetThingFlags(z) & 0x400) { SetThingUserData(z, 4000000000); }
if(GetThingUserData(z) == 4000000000)
{
if(GetThingCurGeoMode(z) == 3)
{
SetThingCurGeoMode(z, 4);
}
else if(GetThingCurGeoMode(z) == 4)
{
SetThingCurGeoMode(z, 3);
}
}
}
zzz=0;
}
zzzz=zzzz+1;
if(zzzz==100)
{
for(y=0; y<=GetSectorCount(); y=y+1)
{
if((GetSectorFlags(y) & 0x4) && (VectorDist(GetThingPos(player),GetSectorCenter(y) ) <= 10))
{
tt=CreateThingAtPos(t,y,GetSectorCenter(y),'0 0 0');
}
}
zzzz=0;
}
zz=zz+1;
if(zz==25)
{
for(x=0; x<=GetSurfaceCount(); x=x+1) {
if(GetSurfaceMat(x)==greencode)
SetSurfaceCel(x, rand()*4); }
SetMaterialCel(yellowcode, rand()*4);
zz=0;
}
Return;
# .................................................. ......................................
selected:
jkPrintUNIString(player, 23);
Return;
# .................................................. ......................................
killed:
if(GetSenderRef() != player) Return;
newplayer:
call stop_power;
Return;
# .................................................. ......................................
stop_power:
SetPulse(0);
KillTimerEx(1);
if(channel != -1)
{
StopSound(channel, 0.1);
channel = -1;
}
if(effectHandle!=-1)
{
freeColorEffect(effectHandle);
effectHandle = -1;
}
// Don't disable IR mode if IR Goggles are on...
if(!IsInvActivated(player, 41))
DisableIRMode();
for(i=0; i<=GetSurfaceCount(); i=i+1)
{
SetSurfaceMat(i, heapget(i));
}
for(z=0; z<=GetThingCount(); z=z+1)
{
if(GetThingUserData(z) == 4000000000)
{
if(GetThingCurGeoMode(z) == 3)
{
SetThingCurGeoMode(z, 4);
}
}
}
// Clear the map mode flags
ClearMapModeFlags(0xffff);
// and reset them to what they were.
SetMapModeFlags(old_flags);
SetInvActivated(player, 23, 0);
Return;
end
Not only that, but in MP, at startup the textures aren't stored in the heap. All surfaces get one texture.
/Edward
I've modified Force Seeing so that all surfaces will become Green Code from the matrix. Now, if a surface has a COG associated to it, it would become Gold Code, and I found it a little... little... If you are the one in the Matrix, I thought, you should be able to see any object with a COG attached to it, so... I edited some, and did so that sectors with a COG attached would get something created in the middle, and objects with a COG would flicker between Render Texture and Render Solid Colors. But, when ever I deactivate the Force, the game crashes... Could someone help me out!
# Jedi Knight Cog Script
#
# FORCE_SEEING.COG
#
# FORCEPOWER Script - Seeing
# Light Side Power
# Bin 23
#
# [YB]
# [SF]pjb did Code Seeing.
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
thing player local
flex cost=30.0 local
flex mana local
sound seeingSound=ForceSee01.WAV local
sound seeingSound2=vibes2.wav local
int channel=-1 local
int rank=0 local
int flags=0 local
int old_flags=0 local
template t=+lightninghit local
int effectHandle=-1 local
material greencode=code.mat local
material yellowcode=code2.mat local
int i local
surface x local
int zz=0 local
thing z local
int zzz=0 local
sector y local
int yy local
int zzzz=0; local
message startup
message shutdown
message activated
message timer
message pulse
message newplayer
message killed
message selected
end
# ================================================== ======================================
code
startup:
player = GetLocalPlayerThing();
old_flags = GetMapModeFlags();
sleep(0.1);
HeapNew(0, getsurfacecount()+1);
for(i=0; i<=GetSurfaceCount(); i=i+1)
{
heapset(i,getsurfacemat(i));
if(GetSurfaceFlags(i) & 0x2) { SetSurfaceMat(i, yellowcode); }
else { SetSurfaceMat(i, greencode); }
}
sleep(0.1);
call stop_power;
Return;
# .................................................. ......................................
shutdown:
call stop_power;
Return;
# .................................................. ......................................
activated:
if(!IsInvActivated(player, 23))
{
mana = GetInv(player, 14);
if(mana >= cost)
{
if(GetInv(player, 65) != 1) ChangeInv(player, 14, -cost);
rank = GetInv(player, 23);
if(rank == 1) flags = 0xc; // players & actors
else if(rank == 2) flags = 0xc; // players & actors
else if(rank == 3) flags = 0x1c; // players & actors & items
else if(rank == 4) flags = 0x4c; // players & actors & items & projectiles
PlayMode(player, 24);
// Play activation sound
channel = PlaySoundThing(seeingSound, player, 1.0, -1, -1, 0x80);
if(GetDebugModeFlags() & 0x400)
ChangeSoundPitch(channel,0.5,0.01);
// Play loop sound at 0.0 volume and fade it in to 1.0 volume in 0.75 secs
channel = PlaySoundThing(seeingSound2, player, 0.0, -1, -1, 0x81);
ChangeSoundVol(channel, 1.0, 0.75);
effectHandle = newColorEffect(1, 1, 1, 0, 0, 0, 0, 0, 0, 1.0);
for(i=0; i<=GetSurfaceCount(); i=i+1)
{
heapset(i,getsurfacemat(i));
if(GetSurfaceFlags(i) & 0x2){ SetSurfaceMat(i, yellowcode); }
else { SetSurfaceMat(i, greencode); }
}
EnableIRMode(1, 1);
old_flags = GetMapModeFlags();
SetMapModeFlags(flags);
SetInvActivated(player, 23, 1);
zz=0;
zzz=0;
zzzz=0;
SetPulse(0.01);
}
}
else { call stop_power; }
Return;
# .................................................. ......................................
timer:
call stop_power;
Return;
# .................................................. ......................................
pulse:
// check that the player didn't die
if(GetThingHealth(player) < 1)
{
call stop_power;
}
if(GetActorFlags(player) & 0x200000)
{
call stop_power;
}
zzz=zzz+1;
if(zzz==10)
{
for(z=0; z<=GetThingCount(); z=z+1)
{
if(GetThingFlags(z) & 0x400) { SetThingUserData(z, 4000000000); }
if(GetThingUserData(z) == 4000000000)
{
if(GetThingCurGeoMode(z) == 3)
{
SetThingCurGeoMode(z, 4);
}
else if(GetThingCurGeoMode(z) == 4)
{
SetThingCurGeoMode(z, 3);
}
}
}
zzz=0;
}
zzzz=zzzz+1;
if(zzzz==100)
{
for(y=0; y<=GetSectorCount(); y=y+1)
{
if((GetSectorFlags(y) & 0x4) && (VectorDist(GetThingPos(player),GetSectorCenter(y) ) <= 10))
{
tt=CreateThingAtPos(t,y,GetSectorCenter(y),'0 0 0');
}
}
zzzz=0;
}
zz=zz+1;
if(zz==25)
{
for(x=0; x<=GetSurfaceCount(); x=x+1) {
if(GetSurfaceMat(x)==greencode)
SetSurfaceCel(x, rand()*4); }
SetMaterialCel(yellowcode, rand()*4);
zz=0;
}
Return;
# .................................................. ......................................
selected:
jkPrintUNIString(player, 23);
Return;
# .................................................. ......................................
killed:
if(GetSenderRef() != player) Return;
newplayer:
call stop_power;
Return;
# .................................................. ......................................
stop_power:
SetPulse(0);
KillTimerEx(1);
if(channel != -1)
{
StopSound(channel, 0.1);
channel = -1;
}
if(effectHandle!=-1)
{
freeColorEffect(effectHandle);
effectHandle = -1;
}
// Don't disable IR mode if IR Goggles are on...
if(!IsInvActivated(player, 41))
DisableIRMode();
for(i=0; i<=GetSurfaceCount(); i=i+1)
{
SetSurfaceMat(i, heapget(i));
}
for(z=0; z<=GetThingCount(); z=z+1)
{
if(GetThingUserData(z) == 4000000000)
{
if(GetThingCurGeoMode(z) == 3)
{
SetThingCurGeoMode(z, 4);
}
}
}
// Clear the map mode flags
ClearMapModeFlags(0xffff);
// and reset them to what they were.
SetMapModeFlags(old_flags);
SetInvActivated(player, 23, 0);
Return;
end
Not only that, but in MP, at startup the textures aren't stored in the heap. All surfaces get one texture.
/Edward