Cod4 Compile - Text

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
User avatar
A5H73Y
CJ Wannabe
CJ Wannabe
Posts: 34
Joined: January 27th, 2011, 9:02 pm
PSN ID: a5h73y

Cod4 Compile - Text

Post by A5H73Y » June 18th, 2011, 6:16 pm

For instance, If a player has finished my map..
How do i make text come on screen saying you have completed the map? :)
Ive seen it done in like everymap i just dont know how :L
Image

Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Re: Cod4 Compile - Text

Post by Pedsdude » June 18th, 2011, 6:34 pm

You have 2 options:
- Option 1 is to use a trigger_use with a hintstring (this creates the text that moves from side to side in the middle of the screen.)
- Option 2 is to do it with scripting, which is more complicated (although not complicated in itself) and looks more professional.

Your choice of which to use (I won't bother helping further until I know which you want.)
Image
Image

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: Cod4 Compile - Text

Post by Goro92 » June 18th, 2011, 6:35 pm

A5H73Y wrote:For instance, If a player has finished my map..
How do i make text come on screen saying you have completed the map? :)
Ive seen it done in like everymap i just dont know how :L
i know 2 ways:

1:create a trigger-->press N-->key:hintstring-->value:ur text


2:with script

Code: Select all

main()
{
thread finishmap();
}
 
finishmap()
{
trigger = getent("finishmap","targetname");
 
   while (1)
   {
      trigger waittill ("trigger", user );
      if ( isPlayer( user ) && isAlive( user ) && isdefined( user.done) ) 
               {
               wait 0.5;
               }
      else  
         {
user iprintlnbold ("Congratulations, " + user.name + ", you have completed the map!");   
         user.done = true; 
         }
   }
}
Image

User avatar
A5H73Y
CJ Wannabe
CJ Wannabe
Posts: 34
Joined: January 27th, 2011, 9:02 pm
PSN ID: a5h73y

Re: Cod4 Compile - Text

Post by A5H73Y » June 18th, 2011, 11:12 pm

The first option sounds better for someone of my knowledge, ill try it tomorrow
Thanks! :D
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest