PDA

View Full Version : Activating an Inventory Item...



AKPiggott
10-12-2000, 12:36 PM
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/

Fernando_the_Hunn
10-13-2000, 07:23 AM
first, the plsector only gets set in the startup message, so it will always be the sector the player starts in. put that line in the activated message. Also, remove the thing from the players inventory after he uses it probably. thats all I see... http://forums.massassi.net/html/smile.gif

------------------
cogs dont kill people. people kill people...

mailto:no_oneatall@hotmail.comno_oneatall@hotmail. com</A>
ICQ 81116825
===========================================
Evil Cog master of the Western TC!

AKPiggott
10-13-2000, 11:04 AM
Oh yeah., I as gonna remove it, good point about plsector, I wasn't thinking there.

I've solved the problem differently now, but thanks for the help.

------------------
Anthony Piggott
E-Mail: akpiggott@eidosnet.co.uk
ICQ: 41235225
Homepage: http://pages.eidosnet.co.uk/~akpiggott/

Han5678
10-14-2000, 06:58 PM
Okk i don't think you need the help anymore but i don't see where you are specifiying what wall to blow out, because i see you have it set for plsector and like the other guy said it won't do anything. but maybe you did set it right but i didn't see it i went over it really fast