Re: Some answers, + JeffW, can you help?


[ Follow Ups ] [ Post Followup ] [ The Massassi Temple Message Board ]

Posted by Jeff W. on June 23, 1998 at 09:24:32:

In Reply to: Re: Some answers, + JeffW, can you help? posted by BrianL on June 23, 1998 at 05:05:04:

4) Yup - I wrote a cog that is kinda long the lines as what you want a few months ago for my very stalled level. You press a button and it sends a message to everyone like - "Public Announcement - is at the Drazen Cafe". Since I already gave this cog to Nebula for his Sarlacc level I might as well post it here as well (just remember where ya got it from ;) It should be easy to modify for a sector and you can likely get rid of one of the cogstrings used and just use the one. This cog uses two cog strings because it's designed especially for custom messages in my level (one cogstring for the text - the other for the text after)

# Jedi Knight Cog Script
#
# PA.COG
#
# Prints a specified text message on the screen from cogstrings.uni
#
# [JW]
#
# Copyright (c) Jeff Walters 1998

symbols

message activate

int inuse=0 local
int player local

surface switch linkid=1

sound switchwav

flex delay=5.0 desc=delay
flex unistring desc=unistring
flex unistring2 desc=unistring2

end

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

code

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

activate:
if(inuse == 1) Return; //Check if PA is in use, if so exits
inuse = 1;
PlaySoundPos(switchwav, SurfaceCenter(switch), 1, -1, -1, 0); //switch sound
player = GetSourceRef();
jkStringClear();
jkStringConcatUNIString(unistring); //Prints specified text message from cogstrings.uni
jkStringConcatSpace();
jkStringConcatPlayerName(player); //player name
jkStringConcatSpace();
jkStringConcatUNIString(unistring2); //Prints specified text message from cogstrings.uni
jkStringOutput(-3, -1);

Sleep(delay);
inuse = 0;
return;
end



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ The Massassi Temple Message Board ]