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 → This should work by now but it doesn't.
This should work by now but it doesn't.
2002-06-10, 2:19 AM #1
I got around to merging my old 01_mclothes and marinerboam COGs, and the result is below. This however, doesn't work either.

Code:
# Rites of Xanthus TC Cog Script
# Mysteries of the Sith
#
# 01_MARINER.COG
# 6.10.02
# -by Lord_Grismath (GrismathDynasty@hotmail.com)
#
# Description
# 
#   I've consolidated the two older mariner cogs into one, this
# new version having written from scratch (as opposed to the old
# MarinerBoam which Bel edited off of one of AKPiggot's cogs).
#
# This Cog is Not supported by LucasArts Entertainment Co

symbols

message	startup
message	pulse
message	entered

int		plrflags	local
int		wear=1		local	//Whether Tahben is wearing his armour.
int		slow=0		local	//Whether Tahben's speed has been effected.
int		played=0	local	//Whether the cutscene has been played
int		tahtalk=0	local	//Used when Tahben is talking

sector		trigsect		//Trigger sector to begin the cutscene

thing		player		local
thing		mariner		//The Mariner's starting location
thing		mwalkpos		//The position to which he walks in the cutscene
thing		playerpos		//The position to which the player is teleported
thing		mdoor			//The door to the Mariner's shack (opened at the end)

thing		maincam1
thing		maincam2
thing		tahbencam
thing		marinercam

model		tclothes
model		tarmor=kk.3do	local

keyframe     talk1=kktlk1.key                                                 
keyframe     talk2=kktlk2.key                                                 
keyframe     talk3=kktlk3.key    

end

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

code

startup:
player = GetLocalPlayerThing();
setpulse(1.0);
AiSetMode(mariner, 0x2000);
return;

# ........................................................................................

pulse:
plrflags = GetThingFlags(player);

if(plrflags & 0x2000000) {
	if(wear == 1) {
	if(slow == 0) {
		SetActorExtraSpeed(player, -1.5);
		SetGravity(6); 
		slow = 1;
	}
	}
	DamageThing(player, 3.0, 0x1, player);
} Else {
	if(slow == 1) {
		SetActorExtraSpeed(player, 0);
		SetGravity(4); 
		slow = 0;
	}
}
return;

# ........................................................................................

entered:

if(GetSenderRef() == trigsect) {
if(played == 0) {

	jkBeginCutscene();
	SetActorFlags(player, 0xa00000);
	TeleportThing(player,playerpos);
	StopThing(player);

	SetCameraFocus(0, maincam1);
	SetCurrentCamera(0);

	AISetLookPos(player, GetThingPos(mwalkpos));
	AISetLookPos(mariner, GetThingPos(mwalkpos));
       AISetMovePos(mariner, GetThingPos(mwalkpos));

	Sleep(2.0);

	SetCameraFocus(0, maincam2);
       SetCurrentCamera(0);

	tahtalk = playkey(mariner, talk1, 1, 0x0);
	Print("Tahben: Ho there, good sir! Could the rumours be true?");
	sleep(2);
	Stopkey(mariner, tahtalk, 0);
	Sleep(1);

	SetCameraFocus(0, tahbencam);
       SetCurrentCamera(0);
	
	tahtalk = playkey(mariner, talk2, 1, 0x0);
	Print("Tahben: Is it true that you alone survived a bout with the Sea Serpent?");
	Sleep(2);
	Stopkey(mariner, tahtalk, 0);
	Sleep(1);

	SetCameraFocus(0, marinercam);
       SetCurrentCamera(0);
	Print("Mariner: Bah... leave an old man to himself...");
	Sleep(3);

	SetCameraFocus(0, tahbencam);
       SetCurrentCamera(0);
	Print("Tahben: I must know how to slay such a beast.");
	sleep(3);

	SetCameraFocus(0, maincam1);
        SetCurrentCamera(0);
	sleep(1);

	Print("Tahben: For in doing so, I shall free these shores from its malice.");
	sleep(3);

	SetCameraFocus(0, marinercam);
        SetCurrentCamera(0);
	Print("Mariner: Bah... good of Xanthus... hmph");
	sleep(3);
	Print("Mariner: ...I shall reveal my secret, but I request thy leaving mine abode.");
	sleep(4);
	SetCameraFocus(0, tahbencam);
        SetCurrentCamera(0);
	Print("Mariner: Seek to fire my spear 'pon her scaled brow or ribbed under, only there can she be slain.");
	sleep(6);

	SetCameraFocus(0, maincam1);
        SetCurrentCamera(0);
	Print("You: Thank you, good sir, and I shall leave thee as promised.");
	sleep(1);

	SetCameraFocus(0, marinercam);
        SetCurrentCamera(0);
	Print("Mariner: That iron can thou walk'st in is no gear for the sea.");
	sleep(1);
	Print("Mariner: Take these lighter clothes.");
	sleep(4);

	call fashion_show;

	SetCameraFocus(0, tahbencam);
        SetCurrentCamera(0);
	Print("Mariner: Thank you, good sir.");
	sleep(1);

	SetCameraFocus(0, maincam2);
        SetCurrentCamera(0);
	MoveToFrame(mariner, 1, 1);
	WaitForStop(mariner);
	MoveToFrame(mdoor, 1, 3);
	MoveToFrame(mariner, 0, 1);
	WaitForStop(mariner);

	TeleportThing(player, playerpos);
	AIClearMode(mariner, 0x2000);
	jkEndCutscene();
	SetCameraFocus(0, player);
	ClearActorFlags(player, 0xa00000);

}
}

return;

# ........................................................................................

fashion_show:

if(wear == 1) {
	SetActorExtraSpeed(player, 1.2);
	SetThingModel(player, tclothes);
	wear=0;
} else {
	SetActorExtraSpeed(player, 1);
	SetThingModel(player, tarmor);
	wear=1;
}

return;

# ........................................................................................

end


I ParSec-ed this, (commenting out the MotS cutscene verbs) and it found no errors.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-06-10, 2:54 AM #2
Are you going to put voice acting in the cut scene?
"if a nobody is still somebody
than that means that every one can't be some one because if every one is some one then no one can be any one..."
2002-06-10, 5:14 AM #3
I just read through the cog, and I noticed several errors. But you didn't say what you
were having a problem with. [http://forums.massassi.net/html/confused.gif]

  • SetThingLook() must be used with players, they're not AI.
  • You can't use MoveToFrame() on actors, use AISetMoveFrame()
  • You should have a fast pulse to cycle the camera instead of setting the camera every few seconds.
  • playerpos should be a ghost, not a position.
  • Improper use of "effect." Should be "affect." [http://forums.massassi.net/html/tongue.gif]



------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.

[This message has been edited by SaberMaster (edited June 10, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-06-10, 8:46 AM #4
Thank you for the grammatical help, SaberMaster [http://forums.massassi.net/html/tongue.gif]

Well now, my primary problem was the fact that the cutscene wasn't evenm starting up at all when I entered the triggered sector. [http://forums.massassi.net/html/tongue.gif]
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-06-10, 3:19 PM #5
OMGOMGOMG

...I was sitting in my bedroom, testing RoX on my archaic laptop, and the cutscene WORKED. It worked on that crappy machine, and not on my comparatively elite system?!?!?
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.

↑ Up to the top!