I'm trying to make the "Heavy Explosives" powerup in MotS function like it does in the game. I want it so that if you use it in a particular sector, it'll blow the walls off, if the player activates it anywhere else, a line will be printed saying "this won't be a good place to detonate that". I've written a COG that I think should work, but I get absolutely nothing when I activate the heavy explosives from the inventory. I looked at how LEC did it and I got completely lost. Have a look at my COG below and see if you can see what's wrong:
# Jedi Knight Cog Script
#
# Blow up the wall with the explosives
#
# By Anthony Piggott (akpiggott@jediknights.co.uk) for ToaM1
#
# This script is NOT supported by LucasArts Entertainment Company
# ==================================================================
symbols
message startup
message activated
int done0=0 local
int done1=0 local
int player local
surface wall1
surface wall2
sector smash
sector blowzone
sector plsector local
end
# ==================================================================
code
startup:
player = GetLocalPlayerThing();
SetSectorAdjoins(smash, 0);
plsector = GetThingSector(player);
Return;
activated:
if(GetInv(player, 53))
{
if((!done0) && (plsector==blowzone))
{
sleep(0.1);
done0 = 1;
SetSectorAdjoins(smash, 1);
SetFaceGeoMode(wall1, 0);
SetAdjoinFlags(wall1, 2);
SetFaceGeoMode(wall2, 0);
SetAdjoinFlags(wall2, 2);
}
else
{
sleep(0.1);
done1 = 1;
Print("KYLE: This wouldn't be a good place to detonate that.");
sleep(10.0);
done1 = 0;
}
}
Return;
end
Any suggestions?
------------------
Anthony Piggott
E-Mail: akpiggott@eidosnet.co.uk
ICQ: 41235225
Homepage: http://pages.eidosnet.co.uk/~akpiggott/
# Jedi Knight Cog Script
#
# Blow up the wall with the explosives
#
# By Anthony Piggott (akpiggott@jediknights.co.uk) for ToaM1
#
# This script is NOT supported by LucasArts Entertainment Company
# ==================================================================
symbols
message startup
message activated
int done0=0 local
int done1=0 local
int player local
surface wall1
surface wall2
sector smash
sector blowzone
sector plsector local
end
# ==================================================================
code
startup:
player = GetLocalPlayerThing();
SetSectorAdjoins(smash, 0);
plsector = GetThingSector(player);
Return;
activated:
if(GetInv(player, 53))
{
if((!done0) && (plsector==blowzone))
{
sleep(0.1);
done0 = 1;
SetSectorAdjoins(smash, 1);
SetFaceGeoMode(wall1, 0);
SetAdjoinFlags(wall1, 2);
SetFaceGeoMode(wall2, 0);
SetAdjoinFlags(wall2, 2);
}
else
{
sleep(0.1);
done1 = 1;
Print("KYLE: This wouldn't be a good place to detonate that.");
sleep(10.0);
done1 = 0;
}
}
Return;
end
Any suggestions?
------------------
Anthony Piggott
E-Mail: akpiggott@eidosnet.co.uk
ICQ: 41235225
Homepage: http://pages.eidosnet.co.uk/~akpiggott/
Xbox Live/PlayStation Network/Steam: tone217
http://twitter.com/ourmatetone
http://twitter.com/ourmatetone