In Game Hud Popup?

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Well I deleted it after I tested it so can't say but seems strange that it didn't work right away I just cut and pasted it after I seen that it worked hmm oh well if you got it to work then good for you .
Image
Cobra {sfx}
Site Admin
Posts: 194
Joined: Tue Mar 23, 2004 10:25 pm
Contact:

Post by Cobra {sfx} »

Loverly work guys, on screen and countin down :)

Ta mucho for all yer help!

ive connected it to the trigger so when u recieve jetpack it threads from the to the hudmenu, works a treat, all i gotta do now is decide how much flight time to give em and disable their low gravity when it runs out, doesnt sound too hard :P

Cobra

(very happy)

ps is there a way to give them more speed in flight and less on ground if carrying it?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

run speed

Post by tltrude »

It would be "run speed", but I don't know how to adjust it.
Tom Trude,

Image
Cobra {sfx}
Site Admin
Posts: 194
Joined: Tue Mar 23, 2004 10:25 pm
Contact:

Post by Cobra {sfx} »

yeh your right tom, runspeed.

Heres summat unusual ... i put the mod serverside but the new hud dont show yet it does on my network, anyway i can fix that?

Also got the fuel counter (on network) when it runs out to kill the grav so thats perfect :)

all good fun

Cobra
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

URC

Post by tltrude »

I guess the clients would need to have the new .urc file to see it.
Tom Trude,

Image
Cobra {sfx}
Site Admin
Posts: 194
Joined: Tue Mar 23, 2004 10:25 pm
Contact:

Post by Cobra {sfx} »

Ok i tried incooperating the first one with part of the second one now im getting lost lol, can anyone fix this...

hudtest:

level.Fuel = 60
wait 2
showmenu myFuelbar

while(level.Fuel > 0)
{
setcvar Fuelbar level.Fuelbar
wait 1
level.Fuelbar--
while (1)

waitthread hudprint ("Countdown: " + (level.Fuelbar) + " seconds" .75 .65 .1 )) // three numbers are for color (gold)
}
waitframe
end

hudprint local.nstring local.r local.g local.b:

huddraw_rect 187 140 -84 50 50
huddraw_color 187 local.r local.g local.b
huddraw_font 187 "facfont-20"
huddraw_string 187 local.nstring
huddraw_align 187 left bottom
huddraw_alpha 187 1

wait .5 //refresh time




hidemenu myFuelbar

it runs from a trigger thread (or should lol)

but i think ive messed it up

(just need that countdown timer on screen in text)

Cobra
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

one problem

Post by tltrude »

Count your brackets in this line.

waitthread hudprint ("Countdown: " + (level.Fuelbar) + " seconds" .75 .65 .1 ))
Tom Trude,

Image
Cobra {sfx}
Site Admin
Posts: 194
Joined: Tue Mar 23, 2004 10:25 pm
Contact:

Post by Cobra {sfx} »

Ok i fixed that but now i get an error in console - bad token .75
think thats all thats stoppin it now

Cobra

waitthread hudprint ("Countdown: " + (level.Fuelbar) + " seconds" )) .75 .65 .1

fixed the first bad token now it says bad token right?
summat to do with the .75 .65 .1

waitthread hudprint ("Countdown: " + (level.Fuelbar) + " seconds" .75 .65 .1 )) //tried that = nope

waitthread hudprint ("Countdown: " + (level.Fuelbar) + " seconds" .75 .65 .1 ) //tried that = nope

i just get token ererors

argh its close unless something is missing?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Post by tltrude »

Try it this way.

waitthread hudprint ("Countdown: " + (level.Fuelbar) + " seconds" ) .75 .65 .1
Tom Trude,

Image
Cobra {sfx}
Site Admin
Posts: 194
Joined: Tue Mar 23, 2004 10:25 pm
Contact:

Post by Cobra {sfx} »

Close ... went 60 - 59 - stayed on 59 and gravity reset prematurely.
also displayed countdown with fuel on screen, nearly there :P

Ill mess around when i get up (just finished 12 hr nights :(

Cobra

thanks for your help tom, yer a good un ;)

ps - i have msn that the 3d jetpack model is ready,
now thats gonna be fun sortin lol
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

while(level.Fuel > 0)
{
setcvar Fuelbar level.Fuelbar
wait 1
level.Fuelbar--
while (1)
which is it level.fuel or level.fuelbar ?
Image
Cobra {sfx}
Site Admin
Posts: 194
Joined: Tue Mar 23, 2004 10:25 pm
Contact:

Post by Cobra {sfx} »

Ah well spotted Bodger, ok i renamed em all to fuel, i still get the same thing ...

60 - 59 - stayed on 59 and gravity reset prematurely.
also displayed countdown with fuel on screen..
(on screen)=Countdown:Fuel 60
(on screen)=Countdown:Fuel 59

baffled :P

Cobra
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

graphics and text

Post by tltrude »

Well you are mixing up the graphic and text displays by using the same variable names for both. The text display does not need cvars.
Tom Trude,

Image
Cobra {sfx}
Site Admin
Posts: 194
Joined: Tue Mar 23, 2004 10:25 pm
Contact:

Post by Cobra {sfx} »

Grrr

All i need is an onscreen countdown (Fuel readout) from 60, this is triggered upon em getting a jetpack, ive tried god knows how many combos of this and gettin nowhere :(

it either doesnt show up or shows up, stops at 59 and stays there.

Dont matter, ive wasted about 3 days messin with that ill give up on it and do summat else.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Maybe try this

Code: Select all

hudtest: 

level.Fuel = 60 
wait 2 
showmenu myFuelbar 

huddraw_rect 187 140 -84 50 50 
huddraw_color 187 .75 .65 .1 
huddraw_font 187 "facfont-20" 
huddraw_align 187 left bottom 
huddraw_alpha 187 1 

while(level.Fuel > 0) 
{ 
setcvar Fuelbar level.Fuel
huddraw_string 187 ("Countdown: " + (level.Fuelbar) + " seconds")
wait 1 
level.Fuelbar-- 
} 

hidemenu myFuelbar
huddraw_string 187 ""

end
Image
Post Reply