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 → It worked before, why won't it work now...
It worked before, why won't it work now...
2002-03-15, 4:53 AM #1
I made this cog, simular to a cog I once did, but now I can't get it to work.. [http://forums.massassi.net/html/frown.gif]

The idea is that that you cross a adjoin, camera starts rolling, and you see the main badguy moving.

Code:
# Jedi Knight Cog Script
#
#kihrmove1
#Hake sees Kihr move through window
# This Cog is Not supported by LucasArts Entertainment Co

symbols

message	crossed
float		patrolspeed=1	// defaults to walk
surface	crs
thing		cam
thing		Kihr
thing		player local
flex		speed=2.0

# ========================================================================================
end 
# ========================================================================================
code

crossed:

	if (done) return;
	done = 1;
	{

	// setup first 
	player = GetLocalPlayerThing(); 
	jkBeginCutscene(); 
	// switch the player for an Actor 
	SetActorFlags(player, 0xa00000); 
	StopThing(player); 

	SetCameraFocus(0, cam);
	MoveToFrame(cam, 1, speed);
	MoveToFrame(cam, 2, speed);
	MoveToFrame(cam, 3, speed);	
	MoveToFrame(cam, 4, speed);
	MoveToFrame(cam, 5, speed);
	MoveToFrame(cam, 6, speed);
	MoveToFrame(cam, 7, speed);
	MoveToFrame(cam, 8, speed);
	MoveToFrame(cam, 9, speed);
	Sleep(22.0);
	AiSetLookFrame(Kihr, 0);
	Sleep(0.5);
	AiSetMoveFrame(Kihr, 0);
	Sleep(0.5);
	AiSetLookFrame(Kihr, 1);
	Sleep(0.5);
	AiSetMoveFrame(Kihr, 1);
	Sleep(0.5);
	AiSetLookFrame(Kihr, 2);
	Sleep(0.5);
	AiSetMoveFrame(Kihr, 2);
	Sleep(0.5);
	AiSetLookFrame(Kihr, 3);
	Sleep(0.5);
	AiSetMoveFrame(Kihr, 3);
	Sleep(0.5);
	AiSetLookFrame(Kihr, 4);
	Sleep(0.5);
	AiSetMoveFrame(Kihr, 4);
	Sleep(0.5);
	AiSetLookFrame(Kihr, 5);
	Sleep(0.5);
	AiSetMoveFrame(Kihr, 5);
	Sleep(0.5);
	AiSetLookFrame(Kihr, 6);
	Sleep(0.5);
	AiSetMoveFrame(Kihr, 6);
	Sleep(7.0);  
	jkEndCutscene();
	SetCameraFocus(0, jkGetLocalPlayer());
	if (jkGetSaberCam() == 1)
	CycleCamera();
	// unfreeze's Kyle
	ClearActorFlags(Player, 0xa00000);
	}
	return;
end



The cam movement and all work perfectly, but the 'Kihr' person refuses to walk, he does look to the right frames though...

It must be something small, since I used that command before.
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-03-15, 12:49 PM #2
Hm.. at first I was thinking you'd need to use WaitForStop(), but now I think the problem is that 'Kihr' has no velocity.

I'd suggest putting AiSetMoveSpeed(1.0); (or whatever speed you want) below Sleep(22.0);

See if that does it.

-Greven
2002-03-15, 2:47 PM #3
You dont need all of those 'Movetoframes', just the last one.

------------------
Success is the inverse relationship between effort, gain, and loss.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-03-16, 11:55 AM #4
You got this cog from a tutorial, right? MikeC had a nearly identical cog that he had problems with. That tutorial had at least a few mistakes.

One of them was the purpose of jkGetSaberCam(). It returns the boolean value of the Saber cam checkbox in JK's options. 1 for checked, 0 for unchecked.

And is this for MotS or JK?

------------------
Author of the Jedi Knight DataMaster.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-03-17, 12:35 AM #5
Only the starting and endinglines of the cutscene are from a tutorial, the rest I wrote myself.

I'll try that movespeed thing.


[This message has been edited by ZOOIkes (edited March 17, 2002).]
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-03-17, 12:35 AM #6
Oh and it's mots
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-03-17, 1:16 AM #7
ok, that didn't work [http://forums.massassi.net/html/frown.gif]
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-03-19, 4:56 AM #8
Anyone?
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-03-19, 6:20 AM #9
I don't see any immediate problem with your cog. There are several things you need to fix, but I think your main problem lies in the level.

1) You've got two speed symbols that you don't use.

2) You only need one MoveToFrame()

3) I think you'd be better off using some code like this instead of what you have:
Code:
AISetLookFrame(actor, frame);
AISetMoveFrame(actor, frame);
WaitForStop(actor);

4) Remove that line with jkGetSaberCam().

5) Anytime during that cutscene, the player could switch the camera, and that would look bad. You need a fast pulse to set the player's camera to internal.

------------

To find out what's wrong with the actor's frame movement, you should make a very simple cog to make him move to only one frame. I suspect that there's a problem with the actor's settings.

------------------
Author of the Jedi Knight DataMaster.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-03-20, 4:41 AM #10
I'll try those things (I had allready removed all the move to frame commands with no success...)

the thingflags of the actor is: 0x2000400 but that couldn't be the problem, neither could it be the template because I use the same actor in a diffrent level with the same flags and all, but there it does work!
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-03-20, 4:58 AM #11
Changed the things, but unfortunatly no succes...
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-03-20, 5:28 AM #12
Ok, I'm somewhat progressing now! *cheers of joy*

I revamped the cog to the following:

Code:
# Jedi Knight Cog Script
#
#kihrmove1
#Hake sees Kihr move through window
# This Cog is Not supported by LucasArts Entertainment Co

symbols

message	crossed
message	arrived
surface	crs
thing		cam
thing		Kihr
thing		player local
float		patrolspeed=1
float		numframes=1
int		curframe=1		local
flex		speed=2.0

# ========================================================================================
end 
# ========================================================================================
code

crossed:

	if (done) return;
	done = 1;
	{

	// setup first 
	player = GetLocalPlayerThing(); 
	jkBeginCutscene(); 
	// switch the player for an Actor 
	SetActorFlags(player, 0xa00000); 
	StopThing(player); 

	SetCameraFocus(0, cam);
	MoveToFrame(cam, 9, speed);
	AiSetMoveSpeed(Kihr, patrolspeed); 
	AISetMoveSpeed(Kihr, patrolspeed);
	AISetLookFrame(Kihr, curframe);
	AISetMoveFrame(Kihr, curframe);
	Sleep(35.0);
	jkEndCutscene();
	SetCameraFocus(0, jkGetLocalPlayer());
	// unfreeze's Kyle
	ClearActorFlags(Player, 0xa00000);
	}
	return;
#----------
arrived:
	curframe = curframe + 1;
	if (curframe > numframes) DestroyThing(K);

	AISetLookFrame(Kihr, curframe);
	AISetMoveFrame(Kihr, curframe);
	return;

end


It allmost works.
Thing is Kihrgaro (the actor) seemed to do even less then before, he didn't even look.
But when I walked a bit further I was noticed by a nearby enemy, and suddenly he began to move...
I checked it 4 times and the ritual stayed the same, he only moves if the enemy is alerted.

This is probably an AI problemm, what should be in the ai? nothing?
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-03-25, 3:51 AM #13
anyone?
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-03-25, 5:10 AM #14
Email me your project and I'll take a look. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the Jedi Knight DataMaster.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-03-25, 6:53 AM #15
That's kind off problematic since the goo is 50 megs and I have a slow modem [http://forums.massassi.net/html/smile.gif]
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-03-25, 10:22 AM #16
Possible problems I see with the last posted version of the cog.

You don't need the brackets on the third and almost last line of the code for the activated message (they don't do anything).

The AiSetMoveSpeed(Kihr, patrolspeed); line is repeated twice.

In the Symbols section both curframe and numframes are defined to equal 1. They both remain unchanged until the start of the Arrived: code where curframe is then changed to equal 2. So the next statement:
if (curframe > numframes) will be true (2 > 1) .....
Okay, sorry, I just realized you probably change the value of numframes to equal however many frames you have for Kihr when you add the cog in JED. So I guess it should work. Since the sleep(35.9); period is so long would that work better by calling a Timer?
Anyway when it comes time to run DestroyThing(K);
-- the "K" is not defined (should be Kihr??). If Kihr is destroyed you should add a return; statement so it won't process the next lines.

Why do you use SetCameraFocus(0, jkGetLocalPlayer()); instead of simply SetCameraFocus(0, player); ?
Does capitalization make a difference between using ClearActorFlags(Player, 0xa00000); and ClearActorFlags(player, 0xa00000); ??

Just my thoughts, I have yet to make my own cutscenes.
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
2002-03-25, 12:35 PM #17
Sylvicolus: None of those problems would stop AISetMoveFrame() from running. It should have run and the actor should have moved to the frame.

Zooikes: It may be that the cog isn't running, so you could put in a few print statements.

A 50 meg project is very awkward. What have you got in there? If there's a lot of sounds or something, just take them out to reduce the size.

------------------
Author of the Jedi Knight DataMaster.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-03-26, 4:41 AM #18
Hmm, zipped up it's only 18megs I noticed, but that still takes ages.
It contains 4 levels, dozens of new textures, voices, cogs, 3do's etc etc etc.
But hey that's not the problem here [http://forums.massassi.net/html/smile.gif]

I'll iron out the bugs sylv mentioned and I try those print messages.
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-03-26, 5:53 AM #19
I think I can get it to work!!!!

I did a bit of trial and error and came to the following conclusions:

it's definitly not the cog. I tried using a "normal" 00_aiframemove.cog and that gave the same effect, he starts walking when the other enemy starts notices me.

I tried fiddeling arround with the ai, that didn't help...

Then I did the next obvious thing, I removed the enemy which triggered the mover to walk.
The conclusion was that he didn't start walking untill he saw me!

I then noticed that BEFORE the cutscene I encounter NO enemies. Apperently When the first enemy encounters you he gives some kind of signal that activates all other enemies!
I placed a enemy before the cutscene, and I think it worked (Don't know for sure, because I screwed all the sleep-times when I changed the cog.)

Thanks for the help!
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-03-26, 6:09 AM #20
Very positive now!

yay 3rd bug down. 1 to go:
http://forums.massassi.net/html/Forum2/HTML/009573.html
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com

↑ Up to the top!