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 → Activating an Inventory Item...
Activating an Inventory Item...
2000-10-12, 9:36 AM #1
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/
Xbox Live/PlayStation Network/Steam: tone217
http://twitter.com/ourmatetone
2000-10-13, 4:23 AM #2
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...

[url="mailto:no_oneatall@hotmail.com"]mailto:no_oneatall@hotmail.com[/url]no_oneatall@hotmail.com</A>
ICQ 81116825
===========================================
Evil Cog master of the Western TC!
cogs dont kill people. people kill people...

mailto:no_oneatall@hotmail.comno_oneatall@hotmail.com</A>
ICQ 81116825
==============================================
((Evil Cog Master))
2000-10-13, 8:04 AM #3
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/
Xbox Live/PlayStation Network/Steam: tone217
http://twitter.com/ourmatetone
2000-10-14, 3:58 PM #4
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
roses are red, violets are blue, I am schizophrenic, and I am too!

↑ Up to the top!