I'm trying to make a COG so that, after activating an item, it allows the player to rotate through a series of cels on a material (returning to cel #1 after it hits the last cel) when they press primary fire, and then reset the material to cel 0 when they press secondary fire.
But it won't work. I've tried removing the partial immobilization of the player, thinking it might freeze the controls, but it makes no difference.
Code:
# Jedi Knight Cog Script
#
# transit_system.cog
#
# This handles the inter-island transportation/ferry system
#
#
# This Cog is Not supported by LucasArts Entertainment Co
symbols
message activated
message startup
message fire
thing console0 linkid=20
thing console1 linkid=20
material ticket_con
int CurrentCel=0 local
int Mode=0 local
int player local
end
# ========================================================================================
code
startup:
player = GetLocalPlayerThing();
activated:
if(GetSenderID()==20) {
SetActorFlags(player, 0x40000);
call fire;
}
return;
fire:
Mode = GetSenderRef();
if (Mode==0) {
CurrentCel=GetMaterialCel(ticket_con);
if(CurrentCel!=4) {
SetMaterialCel(ticket_con,(CurrentCel+1));
}
else {
SetMaterialCel(ticket_con, 1);
}
}
else if (Mode==1) {
ClearActorFlags(player, 0x40000);
SetMaterialCel(ticket_con, 0);
}
return;
# ........................................................................................
endBut it won't work. I've tried removing the partial immobilization of the player, thinking it might freeze the controls, but it makes no difference.
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken
Gotta watch out for them homonyms. 