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 → Help with Goal Cogs
Help with Goal Cogs
2008-10-02, 7:02 PM #1
I'm trying to understand some cog script so first I'll ask for someone to explain a bit on how to make goal cogs. When I say goal cogs I mean stuff like this:

Enter a sector and the "mission objective completed" text pops up and the that goal is check off your goals list. I'm going to need a few of these for things as simple as activating a switch, killing certain npcs, entering a sector, destroying an object, etc.

So if someone wants to explain some of that to me I'll attempt to try and code it myself if I'm unsuccessful then I guess I'll just have to ask for someone to write it for me heh.

Oh and I'm not presently sure how goal cogs normally work but most of my levels end when crossing an ajoin using a end level cog so I dont want the goal cogs to end the level when you have completed all of the goals. I will however need a goal cog to end the level at a later time though i'm sure.
2008-10-05, 1:15 AM #2
If you are lazy, like me, you could use the Goal! plugin for JED. It will let you create basic level goals with an easy to use interface and then it will create and "place" the cog script (among other stuff that I don't remember) for you.

It's available from the JK Hub.
dr0id
2008-10-05, 1:44 PM #3
Thanks for the alternative but that wouldn't help me, since I use jkedit instead of jed.
2008-10-06, 3:20 PM #4
Here's the Goals tutorial here on Massassi:

http://www.massassi.net/tutorials/goals/goals.html
2008-10-06, 6:22 PM #5
Originally posted by Noyjitat:
...that wouldn't help me, since I use jkedit instead of jed.

:carl:
And when the moment is right, I'm gonna fly a kite.
2008-10-06, 6:39 PM #6
Originally posted by gbk:
:carl:

If jed was as easy to use as jkedit, I probably would of stook with it but when I found jkedit I quicky threw jed in the trash hehe.

Oh and thanks for the link to the goals tutorial, I did not notice that when I first searched for it.
2008-10-07, 5:14 PM #7
Originally posted by Noyjitat:
If jed was as easy to use as jkedit, I probably would of stook with it but when I found jkedit I quicky threw jed in the trash hehe.

:huh:
And when the moment is right, I'm gonna fly a kite.
2008-10-13, 9:40 PM #8
Ok, someone wanna give me some examples here?

Examples for:

Kill enemy actor/s
Activate a switch
Enter a sector
Touch a surface
Pick up an item such as a key or weapon
2008-10-16, 8:31 AM #9
Uh, that tutorial should work even with JKEdit. You're editing the cogstrings.uni file and doing the rest in cog. The only thing that you do in JKEdit is add the cog to the level (and maybe refresh or reload the .uni? I've never used JKEdit so idk.) But try doing that.

here's an example that should work for when an actor is killed:

Code:
sound    goalsnd=Accomplish1.wav        local
 int    player                local
thing   actor
 end

 code
 killed:
     // actor has died
     player = GetLocalPlayerThing();

     //complete the first objective
     PlaySoundThing(goalsnd, player, 1.0, -1, -1, 0);
     SetGoalFlags(player, 0, 2);
     Print("Now I'm in the Security Tower, I need to disable the alarm")

     // now show the second objective
     SetGoalFlags(player, 1, 1);
     Return;
er...
2009-03-26, 8:30 AM #10
One small problem, lexen. As it is now, the killed message will only be called when the actor is killed by a lightsaber. Add a mask=-1 after the actor and the message will be called when the actor dies by anything, even by unexplored reasons.

Noyjitat should study all aspects of COG before diving into something like this. The DataMaster is your friend. ;)

/Edward
Edward's Cognative Hazards

↑ Up to the top!