*After foolishly posting this on the wrong forum, here's another attempt...*
I've transported a couple of Stormies onto a lift (in a different cog; during a cutscene) with the intention of the lift activating and going to the floor the player is on when he activates a certain door or crosses a certain adjoin. I've tried both ways with no luck. I'm completely baffled because it's not supposed to be a complicated cog...
#Jedi Knight Cog Script
#
#troopelev.cog
#
#Moves an elevator with troopers on it when the player moves past a certain point
#
#Scripted by Chewbubba
#
#This file was not made or supported by LucasArts Entertainment Company
#
symbols
message activated
message killed
sector storage
thing trooper5 linkid=1
thing elevator
thing maindoor linkid=2
sound ouch=ouch.wav
int elevdone=0
int dead=0
end
code
activated:
if(GetSenderRef() == 2)
{
if(elevdone) return;
//The next line checks to see if the troopers have been moved from the storage sector onto the elevator
if(GetThingSector(trooper5) == storage) return;
MoveToFrame(elevator, 1, 5);
elevdone=1;
}
return;
killed:
if(GetSenderRef() == 1)
{
if(dead) return;
PlaySoundLocal(ouch, 1.0, 0, 0);
Print("ouch...");
dead=1;
}
return;
end
Rhettman: No, I don't use such long comments, I added that here for clarification. Also, I wasn't clear about the "storage" sector in the other post. I think it is less misleading now.
------------------
And you thought Chewie was hairy...
I've transported a couple of Stormies onto a lift (in a different cog; during a cutscene) with the intention of the lift activating and going to the floor the player is on when he activates a certain door or crosses a certain adjoin. I've tried both ways with no luck. I'm completely baffled because it's not supposed to be a complicated cog...
#Jedi Knight Cog Script
#
#troopelev.cog
#
#Moves an elevator with troopers on it when the player moves past a certain point
#
#Scripted by Chewbubba
#
#This file was not made or supported by LucasArts Entertainment Company
#
symbols
message activated
message killed
sector storage
thing trooper5 linkid=1
thing elevator
thing maindoor linkid=2
sound ouch=ouch.wav
int elevdone=0
int dead=0
end
code
activated:
if(GetSenderRef() == 2)
{
if(elevdone) return;
//The next line checks to see if the troopers have been moved from the storage sector onto the elevator
if(GetThingSector(trooper5) == storage) return;
MoveToFrame(elevator, 1, 5);
elevdone=1;
}
return;
killed:
if(GetSenderRef() == 1)
{
if(dead) return;
PlaySoundLocal(ouch, 1.0, 0, 0);
Print("ouch...");
dead=1;
}
return;
end
Rhettman: No, I don't use such long comments, I added that here for clarification. Also, I wasn't clear about the "storage" sector in the other post. I think it is less misleading now.
------------------
And you thought Chewie was hairy...