Page 1 of 1
On Screen Picture
Posted: March 30th, 2006, 5:03 pm
by Nightmare
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
Posted: March 30th, 2006, 6:01 pm
by Drofder2004
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
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)
Posted: March 30th, 2006, 6:26 pm
by Nightmare
Ok thanks drof
Posted: March 30th, 2006, 9:42 pm
by leveller
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.
Posted: March 30th, 2006, 11:20 pm
by Drofder2004
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?
Posted: March 31st, 2006, 10:27 am
by leveller
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
Posted: March 31st, 2006, 6:12 pm
by Nightmare
Thanks alot leveller, altho the scripting is a mounthful and it confuses me, could you explain a few of the commands in the script?
Posted: March 31st, 2006, 7:31 pm
by Drofder2004
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.
Posted: March 31st, 2006, 8:11 pm
by Nightmare
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.
Posted: March 31st, 2006, 9:42 pm
by leveller
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.
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.
.
Posted: April 1st, 2006, 1:01 am
by Drofder2004
You could try using a "while" in there Leveller.
For example...
Code: Select all
while(trigger)
{
show hud
}
remove hud