PDA

View Full Version : Father Cutscene Problems (RoX TC)



Lord_Grismath
05-19-2002, 03:55 AM
Gar... I wrote and re-wrote this cog, and I have no clue what I'm doing wrong. It's all basic stuff here, just quite a bit of it, and when I write this much code in a sitting there are always chances for mistakes that I cannot identify.

When I enter the specified sector in-game, the game simply crashed without wrning and kicks me back to Windows.



#
# RITES OF XANTHUS TOTAL CONVERSION
#
# A new cutscene for the execution of Tahben's father.
#
# Whew, this is big. :]
#
# -Lord_Grismath
#
# NOTE: Cross Check ALL COG COMMANDS at Home. :P
#

symbols

message startup
message entered

template tahben
template orcarmy

thing flycam // Flycam for the approach to the camp
thing guillocam // Camera on executioner
thing guillocam2 // Camera at Guillotine, shifts to basket

thing orcexec // Orcish executioner
thing tahdummy // Tahben Dummy (Sword Actor)
thing father // Guillotine with Tahben's Father
thing rope // Rope for the Guillotine
thing orc1 // Orc camp guards
thing orc2
thing orc3
thing orc4
thing tower
thing orcspawn1
thing orcspawn2
thing tahteleport // 16 things, I just hope this isn't too many :[]

int killed=0 local
int played=0 local

sound music
sound music2
sound tahtofather
sound guillotine
sound toolate
sound fathershout
sound nooo
sound crash // the tower falling
sound charge // orc reinforcements

sector entersect

int status=0 local
int breathingkey local
int chopkey local

thing enemy0 local
thing enemy1 local
thing enemy2 local
thing enemy3 local
thing enemy4 local
thing enemy5 local
thing enemy6 local
thing enemy7 local
thing enemy8 local
thing enemy9 local
thing tahactor local
thing player local

end

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

code

startup:

player = GetLocalPlayerThing();
breathingkey = playkey(father, breathing, 1, 0x0);

Return;

entered:

if(GetSenderRef() == entersect) {
if(status == 0) {

jkBeginCutscene();
player = GetLocalPlayerThing();
SetActorFlags(player, 0xa00000);
StopThing(player);

tahactor = CreateThing(tahben,tahdummy);

SetCameraFocus(0, flycam);
SetCurrentCamera(0);

PlaySoundLocal(music, 1, 0.0, 0x00);
Sleep(1);

MoveToFrame(flycam,1,3);
WaitForStop(flycam);
MoveToFrame(flycam,2,3);
WaitForStop(flycam);
MoveToFrame(flycam,3,3);
WaitForStop(flycam);

SetCameraFocus(0, guillocam);
SetCurrentCamera(0);

Sleep(1);
MoveToFrame(tahactor, 1, 2);
Sleep(1);

SetCameraFocus(0, flycam);
SetCurrentCamera(0);

MoveToFrame(flycam,4,3);
WaitForStop(flycam);

print("Tahben: Father! Fear not; I shall rescue thee!");
PlaySoundLocal(tahtofather, 1, 0.0, 0x00);
Sleep(1);

SetCameraFocus(0, guillocam2);
SetCurrentCamera(0);

AISetLookFrame(orcexec, 1);

print("Orc: It is too late to save him, man!");
PlaySoundLocal(toolate, 1, 0.0, 0x00);

Sleep(2);

AISetLookFrame(orcexec, 0);
AISetFireTarget(orcexec, rope);
DestroyThing(rope);
Sleep(1);

SetCameraFocus(0, guillocam);
SetCurrentCamera(0);

Sleep(1);

StopKey(father, breathingkey, 2.0);
chopkey = playkey(father, chop, 1, 0x14);
PlaySoundLocal(fathershout, 1, 0.0, 0x00);

Sleep(2);

SetCameraFocus(0, flycam);
SetCurrentCamera(0);

print("Tabhen: NOOO!");
PlaySoundLocal(nooo, 1, 0.0, 0x00);
Sleep(2);

PlaySoundLocal(music2, 1, 0.0, 0x00);

MoveToFrame(flycam, 5, 3);

// Now for Tahben's vengeance...

MoveToFrame(tahactor, 2, 1);
WaitForStop(tahactor);
MoveToFrame(guillocam, 1, 3);
AISetFireTarget(tahactor, tower);
AISetFireTarget(tahactor, tower);

MoveToFrame(orc1, 1, 2);
MoveToFrame(tahactor, 3, 2);
WaitForStop(tahactor);

// The tower falls, killing one of the orcs

SetCameraFocus(0, guillocam);
SetCurrentCamera(0);

MoveToFrame(flycam, 6, 3);
MoveToFrame(tower, 1, 3);
WaitForStop(tower);

PlaySoundLocal(crash, 1, 0.0, 0x00);

SetPOVShake('0.0 -.003 0.0', '1.0 0.0 0.0', .05, 30.0);
SetPOVShake('0.0 +.003 0.0', '-1.0 0.0 0.0', .05, 30.0);
SetPOVShake('0.0 -.003 0.0', '1.0 0.0 0.0', .05, 30.0);

SetCameraFocus(0, flycam);
SetCurrentCamera(0);

PlaySoundLocal(music2, 1, 0.0, 0x00);

DamageThing(orc1, 900, 0x40, tower);
Sleep(2);
MoveToFrame(flycam, 7, 3);

AIMoveThing(tahactor, orc2);
AIFireTarget(tahactor, orc2);
DamageThing(orc2, 900, 0x10, tahactor);
MoveToFrame(flycam, 8, 3);

AISetMode(Orc3, 0x800);
AISetMode(Orc4, 0x800);

MoveToFrame(tahactor, 3, 2);
WaitForStop(tahactor);

MoveToFrame(flycam, 9, 3);
WaitForStop(flycam);
Sleep(2);

TeleportThing(player, tahteleport);
jkEndCutscene();
SetCameraFocus(0, player);
ClearActorFlags(player, 0xa00000);

playsoundlocal(charge, 1, -1, 0x0);

enemy0=CreateThing(orcarmy, orcspawn1);
AISetMoveThing(enemy0, player);
Sleep(0.2);
enemy1=CreateThing(orcarmy, orcspawn1);
AISetMoveThing(enemy1, player);
Sleep(0.2);
enemy2=CreateThing(orcarmy, orcspawn1);
AISetMoveThing(enemy2, player);
Sleep(0.2);
enemy3=CreateThing(orcarmy, orcspawn1);
AISetMoveThing(enemy3, player);
Sleep(0.2);
enemy4=CreateThing(orcarmy, orcspawn1);
AISetMoveThing(enemy4, player);
Sleep(0.2);
enemy5=CreateThing(orcarmy, orcspawn2);
AISetMoveThing(enemy5, player);
Sleep(0.2);
enemy6=CreateThing(orcarmy, orcspawn2);
AISetMoveThing(enemy6, player);
Sleep(0.2);
enemy7=CreateThing(orcarmy, orcspawn2);
AISetMoveThing(enemy7, player);
Sleep(0.2);
enemy8=CreateThing(orcarmy, orcspawn2);
AISetMoveThing(enemy8, player);
Sleep(0.2);
enemy9=CreateThing(orcarmy, orcspawn2);
AISetMoveThing(enemy9, player);

status = 1;
} else {
return;
}
}

return;

end

gbk
05-19-2002, 07:42 AM
Is this for MOTS or JK?

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources (http://www.tbns.net/GBK/ol/index.htm).

SaberMaster
05-19-2002, 09:29 AM
I don't see any error that would crash the game, but fix the ones listed below and see
what happens. http://forums.massassi.net/html/wink.gif

The keyframe, breathing, is undefined. The keyframe, chop, is undefined. The vector, '0.0 +.003 0.0', is invalid. AIMoveThing() should be AISetMoveThing() AIFireTarget() should be AISetFireTarget() If this is for JK, you can't use the cutscene verbs. The MoveToFrame() code for flycam is redundant. MoveToFrame() will make the flycam go to frames 1 and 2 on the way to frame 3. You're trying to stop the breathingkey with a 2-second delay. This may not work unless the animation is played with the 0x10 keyframe flag. You have two AISetFireTarget(tahactor, tower) commands. You need to use AISetMoveFrame() instead of MoveToFrame() to move actors to their frames.


BTW, Parsec caught most of those errors. I wouldn't have written it if I didn't want
people to use it. http://forums.massassi.net/html/tongue.gif

------------------
Author of the Jedi Knight DataMaster (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

[This message has been edited by SaberMaster (edited May 19, 2002).]

[This message has been edited by SaberMaster (edited May 19, 2002).]

Lord_Grismath
05-19-2002, 01:55 PM
It's for MotS, and thanks for the help, I'll try this out.

And as for the 'AISetMove' thing, :P, I think I'd better go back to my other cogs... :]

Lord_Grismath
05-19-2002, 02:31 PM
Hmmmm... it still crashed.

What I really need help on, though, is...



# Jedi Knight Cog Script
#
# 01_MCLOTHES.COG
#
# THE RITES OF XANTHUS TOTAL CONVERSION
#
# Description
#
# I hope I did it right this time. :]
#
# -by Lord_Grismath
# 5.18.02
# This Cog is Not supported by LucasArts Entertainment Co

symbols

message startup
message pulse
message activated

flex plrflags local

model tclothes
model tarmor=kk.3do local
model clothes
model armor

thing mclothes
thing player local

int wear=1 local
int slow=0 local

end

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

code

startup:
player = GetLocalPlayerThing();
setpulse(1.0);
return;

activated:
if(GetSenderRef == mclothes) {
if(wear == 1) {
SetActorExtraSpeed(player, 1.2);
SetThingModel(player, tclothes);
SetThingModel(mclothes, armor);
wear=0;
} else {
SetActorExtraSpeed(player, 1);
SetThingModel(player, tarmor);
SetThingModel(mclothes, clothes);
wear=1;
}
}

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;


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

end


^--THAT

Note the irony of 'I hope I did it right this time.' I didn't. :P

SaberMaster
05-19-2002, 03:47 PM
Ok, several things wrong there:

GetSenderRef is missing the parentheses set. (plrflags == 0x2000000) is a bad condition. Use (plrflags & 0x2000000) or BitTest() instead. There's no return before the pulse message. plrflags should be an int, but JK will accept it anyway.


Fix those errors and then see. http://forums.massassi.net/html/wink.gif

------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

SaberMaster
05-19-2002, 03:55 PM
And about the first cog, check for errors with the camera's focus object. One of the main causes of crashing is setting the camera to look at an object that doesn't exist.

------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

Lord_Grismath
05-19-2002, 04:08 PM
Wow, thanks a lot, SaberMaster.

Stupid time:

I'm not too experienced with writing cutscene cogs from scratch, and thus am not entirely clear as to what you mean by the camera's focus (even though I included a focus verb in my cog http://forums.massassi.net/html/tongue.gif)

Lord_Grismath
05-19-2002, 04:21 PM
Sure enough, the water damage part works like a charm :]

Lord_Grismath
05-19-2002, 07:09 PM
Now if I coulg just have the same luck with the father cutscene, :[.

Lord_Grismath
05-21-2002, 03:37 AM
Umm... guys?


<font face="Verdana, Arial" size="2">I'm not too experienced with writing cutscene cogs from scratch, and thus am not entirely clear as to what you mean by the camera's focus (even though I included a focus verb in my cog )

</font>

I still need help with the father cutscene. http://forums.massassi.net/html/frown.gif