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 for Nar Shadda
Cog for Nar Shadda
2001-06-22, 1:28 PM #1
I have created two cogs for Nar Shadda (the level I'm working on right now), but neither of them seem to work... The first, is a cog that causes a rodian to sleep (be inactive) until the player enters a certain sector. Then, the rodian is supposed to say a line, (which is in whatever language Rodians speak, and is translated by being printed on the screen). Afterwords, the Rodian aims his gun at the player, and then come back to life. However, it doesn't quite work that way. First, all goes well, and the Rodian ignores you until you enter the sector. Then the words appear on the screen, but the sound file doesn't play (and it's not a problem with the sound itself, because its an LEC sound). During that time, the Rodian does a few sparatic gun aimings, and then he awakens, and begins shooting. After he is killed, the words are still printed on the screen every time the player enters the sector, which I don't want (I want it to only play the very first time). Here is the code:

Code:
# Jedi Knight Cog Script
#
# barsec.COG
#
# Description
# -This cog will play a line from the bartender, 
# -(a rodian) then cause it to aim a weapon 
# -at the player
#
# This Cog is Not supported by LucasArts Entertainment Co

symbols

message		entered
message		startup
message		entered
message		user0

int		awake=0	local
sector			bar
thing			bartender
sound			barline
keyframe		aim=grfire.key
end

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

code
startup:
	AISetMode(bartender, 0x2000);
	return;

entered:
	PlaySoundThing (barline, bartender, 1);
	Print ("You don't belong in here.");
	Sleep (2);
	AIClearMode(bartender, 0x2000);
	PlayKey (bartender, aim, 1);
	AISetMode(bartender, 0x200);
	return;
# ........................................................................................

end


The second code deals with the player entering the women's bathroom. Upon entering the sector, a woman is supposed to scream, then the player is to say "Woops, I'd better get out of here" (or something like that). Once again, the sound files do not play, and once again, I only want it to play once. Here's the code for this one:

Code:
# Jedi Knight Cog Script
#
# girlsroom.COG
#
# Description
# -This cog will play a line from a lady in a bathroom, 
# -and make her scream
#
#
# This Cog is Not supported by LucasArts Entertainment Co

symbols

message			entered
message			startup
sector			bathroom
thing			lady
thing			player
sound			scream
sound			bettergo
end

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

code
startup:
	player = GetLocalPlayerThing ();
return;

entered:
	PlaySoundThing (scream, lady, 1);
	Print ("Whaaaaaa!!!");
	Sleep (2);
	PlaySoundThing (bettergo, player);
	Print ("Woops, I'd better go...")
	return;
# ........................................................................................

end

Any help would be appriciated...
If you choose not to decide, you still have made a choice.

Lassev: I guess there was something captivating in savagery, because I liked it.
2001-06-22, 2:18 PM #2
Use sectorsound instead it should work in your case
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-06-22, 2:41 PM #3
So that would make it,
Code:
PlaySectorSound (barline, bartender, 1);
And same for the rest? I'll try that, but what about the problem with it playing over and over again? I just want it to play the first time, and I know that can be done...

------------------
When I was young, they told me that anyone could become president. Now that I'm older, I'm starting to believe them.
The Jedi's Saber
How long has Cave_Demon been falling? Click here to find out.
If you choose not to decide, you still have made a choice.

Lassev: I guess there was something captivating in savagery, because I liked it.
2001-06-23, 4:24 AM #4
look at how they used it in the bartender cog in the first level and do it how they did it
roses are red, violets are blue, I am schizophrenic, and I am too!
2001-06-24, 6:48 AM #5
Also, to only get the first cog to play once, do this:
in the entered: section, above everything else, put "if(awake) return;"

Next, directly below that (still above PlaySoundThing() or is it PlaySectorSound() now?) type in "awake=1;"

This'll make the code work only once.

For the second cog, do the same as above, but you'll need to type in "int awake=0 local" in the symbols section.
2001-06-25, 3:54 AM #6
ok, thanks... [http://forums.massassi.net/html/smile.gif]
If you choose not to decide, you still have made a choice.

Lassev: I guess there was something captivating in savagery, because I liked it.

↑ Up to the top!