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 → "kill enemy, first" COG
"kill enemy, first" COG
2002-01-19, 12:22 PM #1
Does anyone know of a COG that wont allow you to proceed to the next objective until you have killed a certain enemy, like a ranor or something? I want to set up an objective that tells you to defeat an enemy. You must find that enemy, and kill before you can move on. I dont know much about COGs , so i'd be thankful for some help.

PS: I'd also like to be able to set how many times you have to shoot this enemy to kill it.
2002-01-20, 9:59 AM #2
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Oakley:
Does anyone know of a COG...</font>



I feel insulted...


 

First of all, any conditional statements concerning objectives would be in objectives cog. Second, for the enemie, edit it's template to increase it's health.


------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-21, 9:56 AM #3
Here. Anyone is welcome to use these cogs (in fact, anyone is welcome to use anything from my released levels/etc. - e.g. the dark emperor series have stuffs that anyone can use on their levels/mods/etc.)

Example 1:
Code:
# Jedi Knight Cog Script
#
# REBELBASE_GOALS.COG
#
# Goals:
#  0 - Emperor Katarn has sent out 2 squadrons (8 stormtroopers per squadron) of stormtroopers to invade the Rebel base. Destroy all those 16 stormtroopers from the cave.
#  1 - Begin your journey of desending into the Valley Of The Jedi
#
# [DM]
#
# At last we will have revenge
# ==================================================================

symbols
int	player	local

message	startup
message	killed
message	entered

thing	thingGoal01
thing	thingGoal02
thing	thingGoal03
thing	thingGoal04
thing	thingGoal05
thing	thingGoal06
thing	thingGoal07
thing	thingGoal08
thing	thingGoal09
thing	thingGoal010
thing	thingGoal011
thing	thingGoal012
thing	thingGoal013
thing	thingGoal014
thing	thingGoal015
thing	thingGoal016

sector	sectorGoal1

sound	soundGoal0=accomplish1.wav	local
sound	soundGoal1=accomplish1.wav	local
sound	tag

int	done0=0	local
int	done1=0	local
int      deadjedi=0              local
int      nosound=0              local
end

# ==================================================================

code
startup:
 player = GetLocalPlayerThing();
 SetInv(player, 99, 5000);
 SetGoalFlags(player, 0, 1);
 SetGoalFlags(player, 1, 1);
Return;

killed:
 // Goal: 0
// if((!done0) && (GetSenderRef() == thingGoal0))
deadjedi = deadjedi + 1;
  if (deadjedi == 15)
   {
Print("The Rebel base is now safe from the stormtoopers. Now you may begin your journey to the Valley Of The Jedi.");
  PlaySoundThing(soundGoal0, player, 1.0, -1, -1, 0);
   SetGoalFlags(player, 0, 2);
   done0 = 1;
   Return;
  }

Return;

entered:
 // Goal: 1
 if((!done1) && (GetSenderRef() == sectorGoal1))
  if (done0 == 1)
  {
   jkPrintUNIString(player, 350);
   PlaySoundThing(soundGoal1, player, 1.0, -1, -1, 0);
   SetGoalFlags(player, 1, 2);
   done1 = 1;
   Sleep(4);
   

ChangeInv(player, 16, 3);
SetInv(player, 20, 5);

   if((GetInv(player, 71) != 0) && (GetInv(player, 70) == GetInv(player, 71)))
{
      ChangeInv(player, 16, 1);
}

jkEndLevel(1);
   Return;
  }

  if (done0 == 0)
{
if (nosound == 1) return;
Print("Han Solo says 'Our base is under attack. Come back and we need your help!");
   PlaySoundThing(tag, player, 1.0, -1, -1, 0);
   nosound = 1;
   Sleep(3);
   nosound = 0;

   Return;
}
Return;

end


Example 2:
Code:
# Jedi Knight Goal Cog Script - Generated by Goal!, Jed Plugin by dr0id <http://hem2.passagen.se/thesj/dr0idstuff/>
#
# ISDHANGAR_GOALS.COG
#
# Goals:
#  0 - Destroy all gunners, docking bay controllers and the bridge crews. (Keys may be required to reach some objective areas)
#  1 - Get back onto the shuttle and leave the Star Destroyer
#
# [Darth Maul]

==================================================================

symbols
int	player	local

message	startup
message	killed
message	entered

thing	cam
thing	cam1

thing	ship1
thing	ship2

thing	thingGoal0
thing	thingGoal1
thing	thingGoal2
thing	thingGoal3
thing	thingGoal4
thing	thingGoal5
thing	thingGoal6
thing	thingGoal7

thing	thingGoal9
thing	thingGoal10
thing	thingGoal11
thing	thingGoal012
thing	thingGoal013

thing	thingGoal014
thing	thingGoal015
thing	thingGoal016
thing	thingGoal017
thing	thingGoal018

thing	thingGoal019
thing	thingGoal020
thing	thingGoal021

thing	thingGoal022
thing	thingGoal023

thing	thingGoal24
thing	thingGoal025
thing	thingGoal026
thing	thingGoal027
thing	thingGoal028

flex         speed
flex         speed2

sector	sectorGoal1

sound	shuttlesound

sound	soundGoal0=accomplish1.wav	local
sound	soundGoal1=accomplish1.wav	local

int      deadjedi=0              local

int	done0=0	local
int	done1=0	local
end

# ==================================================================

code
startup:
 player = GetLocalPlayerThing();
 SetInv(player, 99, 4000);
 SetGoalFlags(player, 0, 1);
 SetGoalFlags(player, 1, 1);
Return;

killed:
 // Goal: 0
deadjedi = deadjedi + 1;
  if (deadjedi == 28)
  {
Print("All crews of ISD Ravager are destroyed. Now get onto the shuttle and escape!");
   PlaySoundThing(soundGoal0, player, 1.0, -1, -1, 0);
   SetGoalFlags(player, 0, 2);
   SetGoalFlags(player, 1, 1);
   done0 = 1;
   Return;
  }

Return;

entered:
 // Goal: 1
 if((!done1) && (GetSenderRef() == sectorGoal1))
if (done0 == 0) return;
if (done1 == 1) return;
  {
   PlaySoundThing(soundGoal1, player, 1.0, -1, -1, 0);
   SetGoalFlags(player, 1, 2);
   done1 = 1;


jkBeginCutscene();


        SetActorFlags(player, 0xa00000);
        StopThing(player);

    SetCameraFocus(0, cam);
	SetCurrentCamera(0);
   playsoundlocal(shuttlesound, 1, 0, 0);
MoveToFrame(ship1, 1, speed);
MoveToFrame(ship1, 2, speed);
MoveToFrame(ship1, 3, speed);
   Sleep(8.0);		
    SetCameraFocus(0, cam1);
	SetCurrentCamera(0);
MoveToFrame(ship2, 1, speed2);
   Sleep(6.0);		
SetCameraFocus(0, jkGetLocalPlayer());
	if (jkGetSaberCam() == 1)
	CycleCamera();
	DestroyThing(cam);

	jkEndCutscene();


ChangeInv(player, 16, 3);
SetInv(player, 20, 4);

   if((GetInv(player, 71) != 0) && (GetInv(player, 70) == GetInv(player, 71)))
{
      ChangeInv(player, 16, 1);
}
jkEndLevel();
   Return;
  }

Return;

end


[This message has been edited by Darth Maul (edited January 21, 2002).]
(Draws his undead great sword out, and with a variety of magical spells, gets ready to fight.

Music composer (presented as Undead Knight and maker of JK SP projects - download soundtrack of Dark Emperor 2 here!

Jedi vs. Sith - Dark Luke's Jedi Knight web site: Informations, addons, etc.
2002-01-21, 4:10 PM #4
Darth Maul: Thanks for the help man. I originally said, "i dont know much about cogs." You showed me what i can write and where. I appreciate you offering me your cogs, and i probably will use some. You will get full credit my man! Thanks again!

↑ Up to the top!