Posted by BrianL on April 17, 1998 at 12:16:35:
In Reply to: Re: Mission Objectives? posted by BrianL on April 17, 1998 at 11:35:32:
> Okay, objectives are not very difficult to do once you figure them out. This may be hard to follow, becuase i am really out of it today... :(
> you will need 3 files:
> cogstrings.uni
> your master cog (endlevel)
> a goals cog
>
> The cogstrings.uni will print your objective in the game itself on the mission objective screen. This is how you add a goal:
>
> "GOAL_01000" 0 " Find the secret something"
>
> "Goal_01001" 0 "msg"
>
>
> The master cog will receive a message from the goals.cog (will explain later) and display a message on the screen. So this is what you need for the master cog:
> Each objective has a parameter(param) So add the user0 message to your master cog and under it , this will receive a msg from the goals cog. type this:
>
> User0:
> jkPrintUNIString(player, 350);> if(GetParam(0) == 0)
> {
> PlaySoundThing(goalsnd, player, 1.0, -1, -1, 0);
> SetGoalFlags(player, 0, 2);
> Print("message");
> Return;
> }> if(GetParam(0) == 1)
> {
> PlaySoundThing(goalsnd, player, 1.0, -1, -1, 0);
> SetGoalFlags(player, 1, 2);
> Print("this is too easy");
> Return;
> }
>
> These are the first two objectives to a level. Follow the example to add more objectives.
> Now to the goals cog. This one is the most important, as it determines WHEN you complete the objective.
> Here is the code to trip the objective screen upon sector entrance:
>
> entered:
> if((!done0) && (GetSenderRef() == goal0sector0))
> {
> SendMessageEx(GetMasterCOG(), user0, 0, 0, 0, 0);
> done0 = 1;
> Return;
> }
>