On Screen Picture

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

Moderator: Core Staff

Post Reply
User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

On Screen Picture

Post by Nightmare » March 30th, 2006, 5:03 pm

So you can make text appear on a persons screen when he walks past a trigger, but, is it possible to make the person who passes through a trigger to see a picture instead of text appear on his screen? I might not be possible but it would be helpful to a map I'm making.


Thanks
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » March 30th, 2006, 6:01 pm

Im not 100% sure how to do it (or if its possible without precache'ing the shader/image in the gametype file first).

You would have to use Shaders and Hud Elements. Its a little complicated, aand atm, I really cannot be arsed to explain :P

Look through some mods (there is a new mod called espionage on codfiles). Then look for how they show images, then use the same basis :)

I will try and show you how soon (if its possible of course)
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » March 30th, 2006, 6:26 pm

Ok thanks drof
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

leveller
CJ Fan
CJ Fan
Posts: 156
Joined: June 25th, 2005, 12:24 pm

Post by leveller » March 30th, 2006, 9:42 pm

it is very well posible to add pictures,

i was working on that with the akk mod, but it gave to much lagg on the network, because everypicture had to be send over the net.

but in mapping, i think it would work verry well.

i'll put together a few files, with the scripts, that you need to make it work.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » March 30th, 2006, 11:20 pm

leveller wrote:it is very well posible to add pictures,

i was working on that with the akk mod, but it gave to much lagg on the network, because everypicture had to be send over the net.

but in mapping, i think it would work verry well.

i'll put together a few files, with the scripts, that you need to make it work.
The thing that got me, is does the Shader (image) have to be precached in the gametype files first? or is it possible to precache in the map scrips?
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

leveller
CJ Fan
CJ Fan
Posts: 156
Joined: June 25th, 2005, 12:24 pm

Post by leveller » March 31st, 2006, 10:27 am

Drofder wrote:
The thing that got me, is does the Shader (image) have to be precached in the gametype files first? or is it possible to precache in the map scrips?
its all precached in the map script, no problem.


i made i litle template, with a port and a trigger in between, your run trough it, and the picture shows up,
and disapears after 5 sec.

all the scripting needed = there.

http://www.sidecar-productions.nl/jump-bitch
Last edited by leveller on April 13th, 2006, 3:52 pm, edited 1 time in total.

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » March 31st, 2006, 6:12 pm

Thanks alot leveller, altho the scripting is a mounthful and it confuses me, could you explain a few of the commands in the script?
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » March 31st, 2006, 7:31 pm

Nightmare wrote:Thanks alot leveller, altho the scripting is a mounthful and it confuses me, could you explain a few of the commands in the script?

Code: Select all

main()
{
	ambientPlay("ambient_mp_carentan");

	maps\mp\_load::main();
	
	game["allies"] = "american";
	game["axis"] = "german";

	game["american_soldiertype"] = "airborne";
	game["american_soldiervariation"] = "normal";
	game["german_soldiertype"] = "fallschirmjagergrey";
	game["german_soldiervariation"] = "normal";

	game["attackers"] = "allies";
	game["defenders"] = "axis";
^ General Map Script

Code: Select all

	setupVar();
	do_Precaching();
	thread trigger_01();
}
Runs each thread one after the other.

Code: Select all

setupVar()
{
	level.infopic["Your_picture"]="Textures/Leveller/custom/Your_picture.dds";
	level.infotext["infoHeader"] = &"This is the header text.";
}
Set a variable to a name of your choice ("Your_Picture")
And also give the second variable some text (Do not remove the & or the ")

Code: Select all

do_Precaching()
{
	levPrecacheShader(level.infopic["Your_picture"]);	
	levPrecacheShader("white");
	levPrecacheString(level.infotext["infoHeader"]);
}
send the shaders and text to be preCached

Code: Select all

levPrecacheShader(shader)
{
	if(!isdefined(level.lev_precachedshaders))
	level.lev_precachedshaders = [];

	level.lev_precachedshaders[level.lev_precachedshaders.size] = shader;
	precacheShader(shader);
}
preCaches shaders.

Code: Select all

levPrecacheString(element)
{
	if(!isdefined(level.lev_precachedstrings))
		level.lev_precachedstrings = [];

	level.lev_precachedstrings[level.lev_precachedstrings.size] = element;
	precacheString(element);
}
preCaches text

Code: Select all

trigger_01()
{
	while(1)
		{
		do_trigger = getent ("trigger_1","targetname");
		do_trigger waittill ("trigger",user);
		user thread trigger_play();
		wait .5;
		}
}
Waits for the person to trigger the trigger (trigger_1). and then plays the next thread.

Code: Select all

trigger_play()
{
	while (1)
		{
		wait .05;
		self disableWeapon();
		thread	maps\mp\_New_Hud::DeleteHud();
		wait .01;
		thread	maps\mp\_New_Hud::Initialise();
		wait 5;
		self enableWeapon();
		thread	maps\mp\_New_Hud::DeleteHud();
		break;
		}
}
disables the users weapon.
Then makes sure the hud is removed.
Then creates the hud
then enables the weapon and removes the hud.

The other GSC simply creates all the huds.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » March 31st, 2006, 8:11 pm

Ok thanks alot drof I understand it alot better now, but why disable the weapon? I noticed that if you go back and forth through the trigger, the picture will actually get stuck on your hud and I can access my gun, but that picture just stays stuck on the screen and I cant see anything.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

leveller
CJ Fan
CJ Fan
Posts: 156
Joined: June 25th, 2005, 12:24 pm

Post by leveller » March 31st, 2006, 9:42 pm

the disable weapon part can be removed, i used it in the "AKK mod", and forgot to take it out.

this is just a verry basic trigger setup and picture on screen script.
one cant expect, to get a fully customised script, serving all your needs. :P

you could alter the trigger settings, or do a faster clean up for the hud to get a better result,
to prevent getting to many layers of the picture on the screen.


.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » April 1st, 2006, 1:01 am

You could try using a "while" in there Leveller.

For example...

Code: Select all

while(trigger)
{
show hud
}

remove hud
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests