Different Crosshairs

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
InsomniaSNake
Corporal
Posts: 32
Joined: Tue Sep 30, 2003 12:52 pm

Different Crosshairs

Post by InsomniaSNake »

I saw this in a cheat menu once, only I deleted it a long time ago but now I want to use it it's gone.

It had the ability to change crosshair, in game you had a menu where you could choose your crosshair and it changed immediatly... Anyone got an idea how they did this?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Probably they changed the crosshair urc to get the shader from a cvar.
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

You can turn the crosshair off and show a menu or should I say a hud item that is the crosshair you want . My bro and I even had a popup menu to select what one you wanted .

Works like this turn off the crosshair and turn show the hud item , the example below was part of a larger menu . ui crosshair 0 turns off the crosshair . Make the tga of the crosshair with an alpha channel so it is transparent and make it 32 x 32 . popmenu 0 removed our menu after you selected your crosshair .

here is part of the crosshair menu

//==================================================
// Crosshair 1

resource
Button
{
name "Default"
rect 63 90 32 32
fgcolor 0.00 0.00 0.00 0.00 //if last # is 0.0 alpha channal is applied
bgcolor 0.00 0.00 0.00 0.00
borderstyle "none"
shader crosshair001 // see shader at bottom of post

// this part is the hud item uses the crosshair001.urc below

stuffcommand "ui_addhud crosshair001; ui_removehud crosshair002; ui_removehud crosshair003; ui_removehud crosshair004; ui_removehud crosshair005; ui_crosshair 0;popmenu 0"

//

clicksound "sound/weapons/fire/mg42burst_01.wav"
}

//==================================================

crosshair001.urc

menu "crosshair001" 32 32 NONE 1
bgcolor 0 0 0 0
align centerx centery


resource
Label
{
name "Default"
rect 0 0 32 32
fgcolor 1.00 1.00 1.00 1.00
bgcolor 0.00 0.00 1.00 0.00
borderstyle "NONE"
shader textures/hud/crosshair001 // crosshair001.tga
}
end.

//==================================================

crosshair.shader // for crosshair menu

crosshair001
{
surfaceparm nolightmap
nomipmaps
nopicmip
cull none
{
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
map textures/hud/crosshair001.tga
}
}
InsomniaSNake
Corporal
Posts: 32
Joined: Tue Sep 30, 2003 12:52 pm

Post by InsomniaSNake »

Wow Really Impressive work, sounds complicated but I am willing to try it out. Thanks a lot, hope it works.
InsomniaSNake
Corporal
Posts: 32
Joined: Tue Sep 30, 2003 12:52 pm

Post by InsomniaSNake »

If that's the only method to do so then there is no way you can make a bloodpatch go on and off can there?
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

sure you can. all you would have to do is make a toggle. say for instance your bloodpatch was blood.pk3. so with the toggle change it to blood1.pk3. if blood1.pk3 doesnt exist then your set.
Post Reply