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 → Goal COG Only Partially Functional
Goal COG Only Partially Functional
2002-04-26, 8:27 AM #1
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.

Code:
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
Dead Reckoning
2002-04-28, 10:22 AM #2
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.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-04-29, 3:21 PM #3
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 JK Editing tips, troubleshooting information, resources and more.
www.swgalaxies.net For all your Star Wars Galaxies needs
The Massassi A SW Galaxies Player Association
Have Lightsaber Will Travel JK Editing tips, troubleshooting information, resources and more.
www.swgalaxies.net For all your Star Wars Galaxies needs
The Massassi A SW Galaxies Player Association

↑ Up to the top!