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 → Need some cogs modified........
Need some cogs modified........
2002-07-31, 12:43 PM #1
Here are two cogs, you can probably tell what they do. As they are now, when the mission is failed, it ends the episode. What i want is, inseat od the level ending, to restart at the last saved position.

Code:
#Don't get seen.
#
#[GoY]
#
#If you wish to add more start and stop surfaces, just create new surfaces 
#with different names and have linkid=1 for start and linkid=2 for stop
#If you wish to add more bots, make multiple copies of the cog.

symbols

thing	playa	local
vector	pso	local

thing	baddy	linkid=3
surface crtl	linkid=1
thing	crtl2	linkid=2

sound	failed	
sound	deact

message activated
message startup
message pulse
message	killed

end

code

activated:
if (GetSenderId()==1)
{
SetPulse(0);
GetSurfaceCenter(crtl);
PlaySoundPos(deact, pso, 1, 0, 10, 0x0);
SetWallCel(crtl,1); 
}

if (GetSenderId()==2)
{
SetPulse(0);
pso=GetThingPos(crtl2); 
PlaySoundPos(deact, pso, 1, 0, 10, 0x0); 
}
return;

startup:
playa=GetLocalPlayerThing();
SetPulse(1);
return;

killed:
if (GetSenderId()==3)
{
print("Mission Objective Failed");
PlaySoundGlobal(failed, 1, 0 ,0x4);
sleep(1);
jkendlevel(0);
}
return;

pulse:
if (hasLOS(playa,baddy)==1)
{
print("Mission Objective Failed");
PlaySoundGlobal(failed, 1, 0 ,0x4);
sleep(1);
jkendlevel(0);
}
return;

end


Code:
#Don't get seen.
#
#[GoY]
#
#If you wish to add more start and stop surfaces, just create new surfaces 
#with different names and have linkid=1 for start and linkid=2 for stop
#If you wish to add more bots, make multiple copies of the cog.

symbols

surface	start	linkid=1
surface	stop	linkid=2

thing	playa	local
thing	baddy	linkid=3

sound	failed	

message	crossed
message pulse

end

code

startup:
playa=GetLocalPlayerThing();
return;
crossed:

if (GetSenderId()==1)
{
SetPulse(1);
}
if (GetSenderId()==2)
{
SetPulse(0);
}

return;

pulse:
if (hasLOS(playa,baddy)==1)
{
print("Mission Objective Failed");
PlaySoundGlobal(failed, 1, 0 ,0x4);
sleep(1);
jkendlevel(0);
}
return;

end


------------------
Sanctum de la Mort
2002-07-31, 12:59 PM #2
JK or MotS?

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-31, 1:06 PM #3
JK SP
2002-07-31, 3:53 PM #4
No other way in JK, in MotS you can use KillPlayerQuietly(); instead...

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-01, 1:37 PM #5
From the first cog:
Code:
GetSurfaceCenter(crtl);
PlaySoundPos(deact, pso, 1, 0, 10, 0x0);

The variable, pso, should be assigned to GetSurfaceCenter() there.

In the second cog, startup is not defined in the symbols section.

Now as to the problem. Replace jkEndLevel(0) with SetActorFlags(player, 0x400000). This will end the level with a fade and go back to the last save.

Good luck. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-08-01, 2:38 PM #6
That, I did not know. I'll be needin that.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack

↑ Up to the top!