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 → I don't understand "yet"
I don't understand "yet"
2002-07-02, 7:12 PM #1
I'm starting to learn the language, yet it isn't a good start so far. I can't figure out why my sound wave won't play.

Code:
symbols

message entered
message activated
message exited

sector cantina
surface switch


end

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

code

entered:
print ("Get out of my bar! You always cause trouble.");
channel = PlaySoundLocal(i00mn19z.wav, 2, -1, 0x10000);
return;

activated:
print ("Don't touch my buttons!");
return;

exited:
print ("I wish you wouldn't shoot paying customers.");
channel = PlaySoundLocal(i00mn18z.wav, 2, -1, 0x10000);
return;

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

end
2002-07-02, 8:08 PM #2
I have another matter that I'm confused with when assigning messages to certain symbols. Say if I wrote a cog that had a message of entered, and a message of touched. With the entered message I will choose the sector symbol which will simply print text when entered, and with the touched message, I'll chose the Surface symbol which will print text as well. Is there a way I can assign this message with the symbol. Because how will the entered message know exactly whether to choose the surface symbol, or the sector?
2002-07-03, 1:12 AM #3
Code:
symbols
message entered
message activated
message exited
sector cantina
surface switch
sound   sound1=i00mn19z.wav  local
sound   sound2=i00mn18z.wav  local

end

#========================================================================================
code
entered:

print ("Get out of my bar! You always cause trouble.");
channel = PlaySoundLocal(sound1, 2, -1, 0x10000);

return;

activated [http://forums.massassi.net/html/tongue.gif]rint ("Don't touch my buttons!");
return;

exited:
print ("I wish you wouldn't shoot paying customers.");
channel = PlaySoundLocal(sound2, 2, -1,0x10000);
return;
# ........................................................................................end


It might still be a bit buggy, as I did this in the reply box. O.o
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-07-03, 4:08 AM #4
Change the razz face in your cog, Grismath and I think we'll have a simple working cog. You need to define the sounds before putting it in the code.

I'm not sure I get your second question Bransin. Entered: message only responds to a sector, because you can only enter a sector (ex you can't enter a surface). Touched will respond to a surface or a thing. If more then two of these is defined then both will respond. Is that what your asking about?

Oh, a hint of advice. There are three main coggers here. GBK and SaberMaster (the two moderators) are the masters, they are the smartest people with cog at the forums. A few steps down there's me, an advanced cogger. (And farter down the road, you got people like Grismath, who put smiles in their code. [http://forums.massassi.net/html/tongue.gif] )

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-03, 4:43 AM #5
Actually you can enter things and surfaces. You don't enter them, but just stepping on them will call the entered message.

Bransin:

There are several ways you can associate objects with cogs. One way is by having the level define the object in the symbols. All events which happen to the object will trigger messages to be called in the cog.

If the message is not used by the cog, nothing will happen. But if it is, JK will run the code after the message name in the code section. Different types of objects can trigger the same message and the same code will be run. There are several ways you can stop objects from running messages:

You can add 'nolink' after the object in the symbols section. Like this: sector sec0 nolink .

Or you can add a line like If(GetSenderRef() != ojbect) Return; just under the message name in the code. This will make JK stop if the wrong object called the message. The senderref of a message is usually the object that called it.

For more than one object, you can assign linkids to multiple objects in the symbols section. Like this: sector sec0 linkid=1 . And then in the code section under the message name, you would add: If(GetSenderID() != ID) Return;. The linkid will become the senderid of messages called by objects.

Hope that explains it. [http://forums.massassi.net/html/wink.gif]

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

[This message has been edited by SaberMaster (edited July 03, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-07-03, 7:04 AM #6
Thanks a lot guys. It helped me see the bottom of the bucket better.

↑ Up to the top!