UGX-Mods

Call of Duty 5: World at War => Help Desk => Topic started by: animallover on April 03, 2014, 08:40:32 pm

Title: Making Text Appear
Post by: animallover on April 03, 2014, 08:40:32 pm
Quick question! Anyway of making text appear on the screen from hitting certain triggers? Like say you walk into a trigger or shoot a trigger text shows up on the screen! :) Thanks
Title: Re: Making Text Appear
Post by: daedra descent on April 03, 2014, 08:54:11 pm
Not sure what your looking for exactly but heres some of the functions that print things on the screen:

Code Snippet
Plaintext
iprintln("");
iprintlnbold("");
bbPrint( "", level.script ); // not sure what this one does exactly
Title: Re: Making Text Appear
Post by: animallover on April 03, 2014, 09:16:12 pm
Not sure what your looking for exactly but heres some of the functions that print things on the screen:

Code Snippet
Plaintext
iprintln("");
iprintlnbold("");
bbPrint( "", level.script ); // not sure what this one does exactly

So where abouts do i go to put these codes? and lets say i shoot a trigger (like you do to open secret doors) you can make it say "you found a secret teddy bear"
Title: Re: Making Text Appear
Post by: daedra descent on April 03, 2014, 09:26:52 pm
So where abouts do i go to put these codes? and lets say i shoot a trigger (like you do to open secret doors) you can make it say "you found a secret teddy bear"

You only need one of them, i just posted them since i didn't know what you wanted.

i'd use this one though:
Code Snippet
Plaintext
iprintln("");

Put that after the trigger has been activated. To make it say anything you need to add it in between the quotation marks like so:

Code Snippet
Plaintext
iprintln("you found a secret teddy bear");

The message should display in the top left corner once the trigger has been activated.
Title: Re: Making Text Appear
Post by: animallover on April 03, 2014, 09:38:39 pm
So do i just add that in my maps gsc?  :P
Title: Re: Making Text Appear
Post by: daedra descent on April 03, 2014, 09:41:40 pm
So do i just add that in my maps gsc?  :P

If thats hwere your trigger function is at then yes.
Title: Re: Making Text Appear
Post by: Ege115 on April 03, 2014, 09:52:57 pm
Right click in the 2d view of radiant.
Go to "trigger" then you can see you can choose between different triggers, "use" is for if you want to press a button on the keyboard to show the text. The one called "damage" is if you want to shoot the trigger to show the text.
The one called "multiple" is for if you want to touch the trigger to show the text. Give whatever trigger you use this KVP
targetname - trigger
Code Snippet
Plaintext
text_script()
{
trigger = GetEntArray ("trigger","targetname");

for(i = 0; i < trigger.size; i++)
{
trigger[i] SetCursorHint( "HINT_NOICON" );
trigger[i] sethintstring("Press &&1 to show a text");

trigger[i] waittill ("trigger");
iprintlnBold("you found a secret teddy bear");
wait(1);
trigger[i] delete();
}
}

Edit: Script is not tested