PDA

View Full Version : Goal COG Only Partially Functional



Quilty
04-26-2002, 11:27 AM
The following goal cog was initially created by the Goal! PlugIn. It only completes goals 0 and 5. The remaining goals do not check off even though, for example, the activation of the surface in question does trigger another cog. The goals that are intially hidden do not appear. Is it a problem for the activation of a surface to be triggering both a cutscene and the completion of a goal? I don't think it would be.

Any thoughts?

Thanks.


symbols
int player local

message startup
message activated
message damaged

surface surfaceGoal0
surface surfaceGoal1
surface surfaceGoal2
thing thingGoal3
thing thingGoal4
surface surfaceGoal5

sound soundGoal0=accomplish1.wav local
sound soundGoal1=accomplish1.wav local
sound soundGoal2=accomplish1.wav local
sound soundGoal3=accomplish1.wav local
sound soundGoal4=accomplish1.wav local
sound soundGoal5=accomplish1.wav local

int done0=0 local
int done1=0 local
int done2=0 local
int done3=0 local
int done4=0 local
int done5=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);
// SetGoalFlags(player, 3, 1); // Not visible at startup
// SetGoalFlags(player, 4, 1); // Not visible at startup
SetGoalFlags(player, 5, 1);

Return;

activated:

// Goal: 0
if((!done0) && (GetSenderRef() == surfaceGoal0))
{
jkPrintUNIString(player, 350);
PlaySoundThing(soundGoal0, player, 1.0, -1, -1, 0);
SetGoalFlags(player, 0, 2);
SetGoalFlags(player, 1, 1);
done0 = 1;
Return;
}

// Goal: 5
if((!done5) && (GetSenderRef() == surfaceGoal5))
{
jkPrintUNIString(player, 350);
PlaySoundThing(soundGoal5, player, 1.0, -1, -1, 0);
SetGoalFlags(player, 5, 2);
done5 = 1;
Return;
}

//Return;

// Goal: 2
if((!done2) && (GetSenderRef() == surfaceGoal2))
{
jkPrintUNIString(player, 350);
PlaySoundThing(soundGoal2, player, 1.0, -1, -1, 0);
SetGoalFlags(player, 2, 2);
SetGoalFlags(player, 3, 1);
done2 = 1;
Return;
}

//Return;

damaged:
// Goal: 1
if((!done1) && (GetSenderRef() == surfaceGoal1))
{
jkPrintUNIString(player, 350);
PlaySoundThing(soundGoal1, player, 1.0, -1, -1, 0);
SetGoalFlags(player, 1, 2);
done1 = 1;
Return;
}

//Return;

killed:
// Goal: 3
if((!done3) && (GetSenderRef() == thingGoal3))
{
jkPrintUNIString(player, 350);
PlaySoundThing(soundGoal3, player, 1.0, -1, -1, 0);
SetGoalFlags(player, 3, 2);
SetGoalFlags(player, 4, 1);
done3 = 1;
Return;
}

//Return;

touched:
// Goal: 4
if((!done4) && (GetSenderRef() == thingGoal4))
{
jkPrintUNIString(player, 350);
PlaySoundThing(soundGoal4, player, 1.0, -1, -1, 0);
SetGoalFlags(player, 4, 2);
done4 = 1;
Return;
}

Return;

end


------------------
Dead Reckoning and Dead Reckoning 2 (http://www.geocities.com/quilty00)

SaberMaster
04-28-2002, 01:22 PM
You need to define all of your messages in the symbols section. Also, you should uncomment some of those returns.

To explain: When an event occurs, JK looks to the symbols section to see if the cog uses that message. Then JK looks in the code for the position of the message. JK runs all code between the message name and the next return or stop statement.

------------------
Author of the Jedi Knight DataMaster (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

MikeC
04-29-2002, 06:21 PM
There's a rare but occassionally observed bug in GOAL! (first doccumented by yours truely). If you set up several goals with different triggers, it sometimes doesn't list all the messages at the start of the cog. All you have to do is initialize the message statements and it starts working.

------------------
Have Lightsaber Will Travel (http://mikec.massassi.net/) JK Editing tips, troubleshooting information, resources and more.
www.swgalaxies.net (http://www.swgalaxies.net/) For all your Star Wars Galaxies needs
The Massassi (http://www.swgalaxies.net/guilds/guild.php3?id=4) A SW Galaxies Player Association