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 → P.A system?
P.A system?
2000-11-07, 8:58 AM #1
how does the P.A system work.
I have downloaded it( from this wonderful site) but i can't understand what the unistring thing is!!!
I wanna be able to get it to work and actually say some stuff!
How? [http://forums.massassi.net/html/confused.gif] and [http://forums.massassi.net/html/mad.gif]
2000-11-07, 10:59 AM #2
What is a P.A. that you're talking about?
And post the unistring line that you're talking about.

------------------
http://millennium.massassi.net/ - Millennium
2000-11-08, 6:11 AM #3
ok! Well in the cog dowloads section (i think it's under multi player) you can get a P.A system cog whick is for levels where u want stuff tp be said to all the users when u press a switch. Like in Drazen Isle.
for instance:- if u press a switch it sais "player1(or whatever your name is) pressed the switc" (u can change the text i think). Here is the cog:-

symbols
message activated
message timer
sound beep
surface printswitch
flex unistring0
flex unistring1
int status=0 local
int player local
flex delay=5.0 desc=timer_delay

end

code

activated:

playsoundpos(beep, SurfaceCenter(printswitch), 1, -1, -1, 0);

If(status==1) Return;
status=1;

jkStringClear();
jkStringConcatUNIString(unistring0);
jkStringConcatSpace();
jkStringConcatPlayerName(player);
jkStringConcatSpace();
jkStringConcatUNIString(unistring1);
jkStringOutput(-3, -1);
SetTimer(delay);
Return;

timer:

status=0;

end

How do u get it to work!! The bits u have to
write give to jed is the printswitch,unistring1,unistring2 and delay.
I am quite new to cogging and i can't get it to work? How? [http://forums.massassi.net/html/eek.gif]
2000-11-08, 11:21 AM #4
unistrings are references to jkstrings.uni. Put your string in there. If you want it simpler, just use my cog:
Code:
symbols
surface face
message activated
end

code
activated:
Print("Flop spelled backwards is polf.");
end

just replace Flop spelled backwards is polf with what you want.
Capitalization
Commas
Periods
Question Marks
Apostrophes
Confusable Words
Plague Words
2000-11-08, 2:00 PM #5
beep is played when you activate this message function.

For the duration of the "delay", you can't send another message from the same surface.

It will print like the following.

"uni0 playerName uni1"
So if you put "Activated by" in uni0 and "in the office" in uni1, and playerName is "Bob" it will print
"Activated by Bob in the office"
Keep it blank if you want nothing to be said.
Code:
symbols


message activated
message timer


sound beep
surface printswitch
flex unistring0
flex unistring1
int status=0 local
int player local
flex delay=5.0 desc=timer_delay

end

code

activated:

playsoundpos(beep, SurfaceCenter(printswitch), 1, -1, -1, 0);

If(status) Return;
status=1;

jkStringClear();
jkStringConcatUNIString(unistring0);
jkStringConcatSpace();
jkStringConcatPlayerName(player);
jkStringConcatSpace();
jkStringConcatUNIString(unistring1);
jkStringOutput(-3, -1);
SetTimer(delay);


Return;

timer:

status = 0;

end


------------------
http://millennium.massassi.net/ - Millennium

↑ Up to the top!