What is false with this code ?
goal 1 & 2 are visible
but only goal 1 should be visible at startup.
# LEVEL1_GOALS.COG
#
# Goals:
# 0 - hallo
# 1 - test
# 2 - ende
#
# ==================================================================
symbols
int player local
message startup
message entered
message touched
sector sectorGoal0
thing thingGoal1
surface surfaceGoal2
sound soundGoal0=accomplish1.wav local
sound soundGoal1=accomplish1.wav local
sound soundGoal2=accomplish1.wav local
int done0=0 local
int done1=0 local
int done2=0 local
end
# ==================================================================
code
startup:
player = GetLocalPlayerThing();
SetInv(player, 99, 1000);
SetGoalFlags(player, 0, 1);
// SetGoalFlags(player, 1, 1); // Not visible at startup
// SetGoalFlags(player, 2, 1); // Not visible at startup
Return;
entered:
// Goal: 0
if((!done0) && (GetSenderRef() == sectorGoal0))
{
jkPrintUNIString(player, 350);
PlaySoundThing(soundGoal0, player, 1.0, -1, -1, 0);
SetGoalFlags(player, 0, 2);
SetGoalFlags(player, 1, 1);
done0 = 1;
Return;
}
// Goal: 2
if((!done2) && (GetSenderRef() == surfaceGoal2))
{
jkPrintUNIString(player, 350);
PlaySoundThing(soundGoal2, player, 1.0, -1, -1, 0);
SetGoalFlags(player, 2, 2);
done2 = 1;
Sleep(3);
jkEndLevel(1);
Return;
}
Return;
touched:
// Goal: 1
if((!done1) && (GetSenderRef() == thingGoal1))
{
jkPrintUNIString(player, 350);
PlaySoundThing(soundGoal1, player, 1.0, -1, -1, 0);
SetGoalFlags(player, 1, 2);
SetGoalFlags(player, 2, 1);
done1 = 1;
Return;
}
Return;
end
goal 1 & 2 are visible
but only goal 1 should be visible at startup.
# LEVEL1_GOALS.COG
#
# Goals:
# 0 - hallo
# 1 - test
# 2 - ende
#
# ==================================================================
symbols
int player local
message startup
message entered
message touched
sector sectorGoal0
thing thingGoal1
surface surfaceGoal2
sound soundGoal0=accomplish1.wav local
sound soundGoal1=accomplish1.wav local
sound soundGoal2=accomplish1.wav local
int done0=0 local
int done1=0 local
int done2=0 local
end
# ==================================================================
code
startup:
player = GetLocalPlayerThing();
SetInv(player, 99, 1000);
SetGoalFlags(player, 0, 1);
// SetGoalFlags(player, 1, 1); // Not visible at startup
// SetGoalFlags(player, 2, 1); // Not visible at startup
Return;
entered:
// Goal: 0
if((!done0) && (GetSenderRef() == sectorGoal0))
{
jkPrintUNIString(player, 350);
PlaySoundThing(soundGoal0, player, 1.0, -1, -1, 0);
SetGoalFlags(player, 0, 2);
SetGoalFlags(player, 1, 1);
done0 = 1;
Return;
}
// Goal: 2
if((!done2) && (GetSenderRef() == surfaceGoal2))
{
jkPrintUNIString(player, 350);
PlaySoundThing(soundGoal2, player, 1.0, -1, -1, 0);
SetGoalFlags(player, 2, 2);
done2 = 1;
Sleep(3);
jkEndLevel(1);
Return;
}
Return;
touched:
// Goal: 1
if((!done1) && (GetSenderRef() == thingGoal1))
{
jkPrintUNIString(player, 350);
PlaySoundThing(soundGoal1, player, 1.0, -1, -1, 0);
SetGoalFlags(player, 1, 2);
SetGoalFlags(player, 2, 1);
done1 = 1;
Return;
}
Return;
end