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 → COG problem
COG problem
2003-05-29, 11:49 AM #1
Hi!
I don't know what I'm doing wrong. Everything seems OK!
Code:
# Fixing the elevator
#
# By Edward
symbols

message		activated

thing		r5ug
thing		entercam
thing		sideviewcam
thing		incam
thing		clampcam
thing		clamp1left
thing		clamp1right
thing		clamp2left
thing		clamp2right
thing		uggy
thing		lift
thing		shaftcam
thing		door
thing		doorelev1
thing		doorelev2
thing		elevdown
thing		x
thing		officer
thing		elevdowncam

surface		pannel
surface		skip

int		skippit=0	local

sound		thereyouare
sound		pleep1
sound		wevebeenwaiting
sound		pleep2
sound		fixthiselev
sound		pleep3
sound		idontcare
sound		pleep4

sound		openr5
sound		u_oh
sound		que
sound		clamps
sound		screem
sound		ifthisisr5thenwho
sound		thatsoundedlikeugnaut
sound		screech

keyframe	r5opentop
keyframe	ugfix
keyframe	woops

int		Rkey=-1		local
int		Ukey=-1		local

end
#
code
activated:
	IF(GetSenderRef()==door)
	{
		SetActorFlags(GetLocalPlayerThing(),0x840000);
		SetCurrentCamera(0);
		SetCameraFocus(0,entercam);
		SetCameraFocus(1,officer);
		TeleportThing(r5ug,GetLocalPlayerThing());
		TeleportThing(GetLocalPlayerThing(),x);
		MoveToFrame(door,1,8);
		if(skippit==0) WaitForStop(door);
		AISetMovePos(r5ug,GetThingPos(doorelev1));
		if(skippit==0) sleep(2);
		StopThing(r5ug);
		sleep(0.05);
		SetCameraFocus(0,sideviewcam);
		print("Officer: There you are!");
		PlaySoundThing(thereyouare,officer,1,-1,10,0xC0);
		if(skippit==0) sleep(GetSoundLen(thereyouare));
		MoveToFrame(door,0,8);
		PlaySoundThing(pleep1,r5ug,1,-1,10,0xC0);
		if(skippit==0) sleep(GetSoundLen(pleep1));
		print("Officer: We've been waiting for you!");
		PlaySoundThing(wevebeenwaiting,officer,1,-1,10,0xC0);
		if(skippit==0) sleep(GetSoundLen(wevebeenwaiting));
		PlaySoundThing(pleep2,r5ug,1,-1,10,0xC0);
		if(skippit==0) sleep(GetSoundLen(pleep2));
		print("Officer: We need you to fix this elevator now!");
		PlaySoundThing(fixthiselev,officer,1,-1,10,0xC0);
		if(skippit==0) sleep(GetSoundLen(fixthiselev));
		PlaySoundThing(pleep3,r5ug,1,-1,10,0xC0);
		if(skippit==0) sleep(GetSoundLen(pleep3));
		print("Officer: I don't care if you have a speech problem, fix this one first!");
		PlaySoundThing(idontcare,officer,1,-1,10,0xC0);
		if(skippit==0) sleep(GetSoundLen(idontcare));
		PlaySoundThing(pleep4,r5ug,1,-1,10,0xC0);
		MoveToFrame(doorelev1,1,8);
		AISetMovePos(r5ug,GetSurfaceCenter(pannel));
		if(skippit==0) sleep(3);
		SetCameraFocus(0,incam);
		SetCameraFocus(1,r5ug);
		MoveToFrame(doorelev1,0,8);
		AISetLookPos(r5ug,GetSurfaceCenter(pannel));
		if(skippit==0) sleep(1);
		PlaySoundThing(openr5,r5ug,1,-1,10,0xC0);
		Rkey=PlayKey(r5opentop,r5ug,1,0x004);
		if(skippit==0) sleep(1);
		TeleportThing(uggy,r5ug);
		Ukey=PlayKey(ugfix,uggy,1,0x004);
		if(skippit==0) sleep(10);
		print("Officer: If that's the R59P, then... Who's fixing the elevator?");
		PlaySoundThing(ifthisisr5thenwho,officer,1,-1,10,0xC0);
		if(skippit==0) sleep(GetSoundLen(ifthisisr5thenwho));
		print("Uggy: U-oh...");
		PlaySoundThing(u_oh,uggy,1,-1,10,0xC0);
		if(skippit==0) sleep(GetSoundLen(u_oh));
		StopKey(Ukey,uggy,1);
		Ukey=PlayKey(woops,uggy,1,0x004);
		if(skippit==0) sleep(1);
		SetCameraFocus(0,clampcam);
		SetCameraFocus(1,clamp1left);
		if(skippit==0) sleep(1);
		PlaySoundLocal(clamps,1,0,0xC0);
		MoveToFrame(clamp1left,1,8);
		MoveToFrame(clamp1right,1,8);
		if(skippit==0) sleep(1);
		PlaySoundLocal(clamps,1,0,0xC0);
		MoveToFrame(clamp2left,1,8);
		MoveToFrame(clamp2right,1,8);
		if(skippit==0) sleep(1);
		stopkey(Ukey,uggy,1);
		SetCameraFocus(0,incam);
		SetCameraFocus(1,incam);
		PlaySoundLocal(que,1,0,0xC0);
		if(skippit==0) sleep(1);
		MoveToFrame(incam,1,10);
		PlaySoundLocal(screem,1,0,0xC0);
		if(skippit==0) sleep(GetSoundLen(screem));
		SetCameraFocus(0,officer);
		SetCameraFocus(1,officer);
		PlaySoundLocal(thatsoundedlikeugnaut,1,0,0xC0);
		print("Officer: Did you hear that? That sounded like an Ugnaut...");
		if(skippit==0) sleep(GetSoundLen(thatsoundedlikeugnaut));
		SetCameraFocus(0,shaftcam);
		SetCameraFocus(1,lift);
		StopThing(r5ug);
		sleep(0.05);
		TeleportThing(r5ug,elevdown);
		MoveToFrame(lift,1,16);
		PlaySoundThing(screech,lift,1,-1,25,0xC1);
		if(skippit==0) WaitForStop(lift);
		SetCameraFocus(0,elevdowncam);
		SetCameraFocus(1,r5ug);
		if(skippit==0) sleep(1);
		MoveToFrame(doorelev2,1,8);
		if(skippit==0) sleep(3);
		AISetMovePos(r5ug,elevdowncam);
		if(skippit==0) sleep(3);
		MoveToFrame(doorelev2,0,8);
		TeleportThing(GetLocalPlayerThing(),r5ug);
		SetCameraFocus(0,GetLocalPlayerThing());
		TeleportThing(r5ug,x);
		SetCameraFocus(1,GetLocalPlayerThing());
		ClearActorFlags(GetLocalPlayerThing(),0x840000);
	}
	else if(GetSenderRef()==skip)
	{
		print(">>>>>>>> Fast Fowarding >>>>>>>>");
		skippit=1;
	}
return;
end

The r5ug won't stop when I say StopThing() and the uggy nor r5ug will play key when I say Ukey=PlayKey or Rkey=PlayKey!

HELP!
Oh, and could someone find me a perticular sound? A sound of metal screeching against metal, like a train hitting the breaks or a falling elevator hitting its breaks? Please?

/Edward
Edward's Cognative Hazards
2003-05-29, 2:19 PM #2
When you use "AISetMovePos", is the position out of reach of the actor? If so, I *think* it might not work that way (the stopping, that is). BTW, AiSetMoveFrame works nicely (unless there may be a change in the thing you want the actor to move to). Also consider "AiSetMoveThing". And if he still won't stop, do "AiSetMoveSpeed(Actor, 0);".

For the sounds, there's a few of LEC's like that, but I can't for the life of me remember what they're called.

------------------
"The Just shall live by faith." - Galatians 3:11
To edit is human... To COG is divine!!

[This message has been edited by DogSRoOL (edited May 29, 2003).]
Catloaf, meet mouseloaf.
My music
2003-05-29, 2:59 PM #3
to stop an actor that is moving by either 'AiSetMovePos' or 'AiSetMoveThing' go like this:
Code:
AiSetMovePos(actor, GetThingPos(actor));
or
AiSetMoveThing(actor, actor);

as you can see the actor sets sets its move pos to itself and that stops it.
i've tried the set 'AiSetMovePos' one before and it worked.

------------------
Famous last words - "It seemed like a good idea at the time."

[This message has been edited by DSLS_DeathSythe (edited May 29, 2003).]
Famous last words - "It seemed like a good idea at the time."
2003-05-30, 6:05 AM #4
OK, I got him to stop, but he won't walk out of the elevator at the end. Nor will the KEYs react! HELP!

/Edward
Edward's Cognative Hazards
2003-05-30, 8:17 PM #5
Uh oh!
Looks like your about to face a similar problem that I faced with AIJump - Getting the actor to respond again. I never did figure it out - I had to use a velocity method. Maybe you could "bump" you actor by setting his velocity. And if you have staticdrag in your actor's template set it to 0. Actors seem to have a problem with it - they won't move w/o being bumped by something (actor, player, projectile, etc.) One of these is bound to be the problem.

------------------
"The Just shall live by faith." - Galatians 3:11
To edit is human... To COG is divine!!
Catloaf, meet mouseloaf.
My music
2003-05-31, 9:40 AM #6
GAH!
Now I see why the r5ug won't leave the elevator. I forgot GETTHINGPOS!!! GGGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH!
Oh well, KEYs aren't responding. And the ST won't move to key" is on the same level as this one. Could they be related? And I added a new player to this level.
# DESC: R5 Player
# BBOX: -.033545 -.020533 -.064529 .03321 .020809 .02539
r5_player _actor type=player thingflags=0x20000401 light=0.200000 model3d=r5.3do size=0.065000 movesize=0.065000 puppet=r5.pup soundclass=ky.snd cog=kyle.cog surfdrag=3.000000 airdrag=0.500000 staticdrag=0.300000 health=100.00 maxhealth=100.00 maxthrust=2.00 typeflags=0x1 error=0.50 fov=0.71 chance=1.00

Could this be the problem I have with these keys?

/Edward

[This message has been edited by Edward (edited May 31, 2003).]
Edward's Cognative Hazards
2003-05-31, 10:53 AM #7
Quote:
<font face="Verdana, Arial" size="2">
For the sounds, there's a few of LEC's like that, but I can't for the life of me remember what they're called.
</font>

Do you remeber what game?
Edward's Cognative Hazards
2003-05-31, 6:04 PM #8
um... jk...

And the key problem, if it's the same kind of problem I had, is definitely related. I couldn't get the actor to respond to anything. Try using actor frames, if possible. The first frame doesn't have to be the same as the actor's starting position, either, unlike other objects in jk.

------------------
"The Just shall live by faith." - Galatians 3:11
To edit is human... To COG is divine!!
Catloaf, meet mouseloaf.
My music
2003-06-01, 10:00 AM #9
OK... Here's the deal...
The actors, all of them, seem to move OK, from where they stand to the object. BUT! when I try to make them move with keys (like shake hands or grab a drink or even move to the KEYs that already exist in the resource GOB) nothing happens. They continue with their standard movements!

Who can I trust to send the level to, without them blabbing to everyone my evil plan... /takes right pinky finger to his mouth and opens his mouth like if to whistle but can't stop from smiling...

/Edward
Edward's Cognative Hazards
2003-06-01, 3:27 PM #10
:-\
Maybe try adding some short delays before trying to play the keys?

Or send moi the level. I don't even talk about my own levels in remotely significant detail, so what're the chances I'll talk about someone elses?

But try delays first, please, and I don't guarantee I can fix it, but on the other hand, that's what I thought about that 3do you sent me. Ya never know...

GuitarOfGold@aol.com

------------------
"The Just shall live by faith." - Galatians 3:11
To edit is human... To COG is divine!!
Catloaf, meet mouseloaf.
My music
2003-06-02, 4:15 PM #11
The sounds in question are from the JK Falling Ship level.

16metalgroan01.wav and 16metalgroan04.wav will proabably be good.

------------------
The Mega-ZZTer's Gaming Haven!
I finally got around to updating my sig... *grumble*...

2003-06-04, 7:40 AM #12
Sorry for being gone so long.
Now I don't want bending metal sounds. I would like a looping sound that screeches.

And there are delays between the keys.

But I shall send the level to DogSRoOL!
Only neccessary files will be with it for level 3.

/Edward
Edward's Cognative Hazards
2003-06-06, 12:15 AM #13
Hay! I've started on the next level and found same problems with KEYs as with the 3 stormtroopers in another topic. OK, I'm using the same COG.

/Edward
Edward's Cognative Hazards
2003-06-06, 2:46 AM #14
well, are teh keys listed in the actors PUP?

for some unkown reson i get the feeling that they need to be... dun ask me why. its jsut like i heard it some where.

------------------
I am pjb.
Another post......
another moment of my life wasted.....
at least i made a level.
PJB's JK page's

-the PJB jedi rule book-
rule one, "never trust a bartender with bad grammar"-kyle katarn in JO

Rule Two, "Gravity is a crule misstress" -kyle katarn in MotS, and the alternatior MK I in AJTD
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2003-06-06, 3:10 AM #15
I don't think that's the problem.
In level 1 and 2, I've managed to play any KEY.

There is something about level 3, and my money's on that new player called r5_player where the appearance and pup is the same as an r5.

/Edward
Edward's Cognative Hazards

↑ Up to the top!