There are currently 0 players online.
 
Warsow


 
 

back[HUD][0.3] how to change clock color when you picked up item

Forum index
Modifications / Coding
[HUD][0.3] how to change clock color when you picked up item
Posted by
Post Scroll to bottom
Guwashi
Member
(479 posts)

This code might be useful for ppl who always forget item respawn time (== me :P).

- screenshot

http://d3.jpn.org/warsow/tmp/colored_clock.jpg


- sample HUD (archive)
Put this pk3 to basewsw and choose 'guwashi' hud from player setting menu.
http://d3.jpn.org/warsow/basewsw/z_guwashi.pk3

- sample code
basewsw/huds/guwashi.hud
basewsw/huds/inc/guwashi/clock.hud
basewsw/huds/inc/guwashi/picked_up_item.hud

- key logic
The point of this logic is quite simple.
if %PICKUP_ITEM == 27 // Red Armor
setColor 1, 0, 0, 1 // red
drawClock
endif

That's all :P.

EDIT1: added sample HUD and added key logic.
EDIT2: added screenshot.
EDIT3: updated screenshot :P

Guwashi
Member
(479 posts)

sample HUD
http://d3.jpn.org/warsow/basewsw/z_guwashi.pk3
put this pk3 to basewsw and choose 'guwashi' hud from player setting menu.

MysTikal

Member
(1279 posts)

Hehe, I had a hud like this before (its included on my 0.21 huds but commented out, see warnings.hud)

Should port it to 0.3 I guess.

um8

Member
(521 posts)

wtf ? how does it work ? :o

Guwashi
Member
(479 posts)

um8 wrote:

wtf ? how does it work ? :o

The point of this logic is quite simple.
if %PICKUP_ITEM == 27 // Red Armor
setColor 1, 0, 0, 1 // red
drawClock
endif

simple huh?

jal

master of the universe
(10599 posts)

Didn't we include this in the default hud at the end? I thought it was included :(

0x557A

Member
(1137 posts)

Isn't there #ITEM_RED_ARMOR?

Guwashi
Member
(479 posts)

jal: I added this code in old default hud, but default hud was totally changed to ETR's one... ehh ahh... ETR? :P

Uz: atm, there is no item constants, but is it so often to use item constants?

jal

master of the universe
(10599 posts)

There are :) They were added later on.

pille

Member
(305 posts)

sry i dont get it to work :/ ...how do i notice that it work? is there a counter counts down or up or what?

T-B0N3

Member
(1268 posts)

as far as i get it it just changes the color of the clock to help u remember to grab ra, doesnt actually times it?

scratch

Member
(568 posts)

It changes color when you pick up the item, yeah. It helps you time it but doesn't like change color when the RA spawns again or anything. It just lasts for a fixed period of time (just like the RA icon in most HUDs), and it's easy to read the clock and see the notification, easier than trying to look in the corner (where the item pickup is usually located) and read the clock at the same time :)

Guwashi
Member
(479 posts)

Added screenshot on my 1st post.

pille: didn't work? do u copy pk3 to basewsw? (e.g. warsow/basewsw/z_guwashi.pk3)

jal

master of the universe
(10599 posts)

It hightlights the clock so you remember to look at it :)

Raelz

Member
(1022 posts)

is there any way to stop the clack after pickup for few secs ?

Guwashi
Member
(479 posts)

Raelz: no there isn't that features :P

jal: thx for change topic name :)

ETR

Member
(2908 posts)

Ahh shit, Guwashi, commit this for 0.31... I totally forgot it I guess (I remember it being in default hud before... :O) *ashamed*.

battletwat

Member
(721 posts)

Whoa, just noticed this. This is extremely useful, gonna put it to my hud too.

Edit: Cant get it to work. :( When i pick RA, it starts the optional timer but shows the time left in game and then it disappears in few second. Am i doing something wrong?

T-B0N3

Member
(1268 posts)

edit: lol . its supposed to do that. the clock doesnt freezes or something

battletwat

Member
(721 posts)

T-BON3 according to screen up there it counts from 25 to 0, and thats not what it does to me. It starts that optional timer, but not with 25sec but whatever theres left in game and after few secs it disappears (no, not after 25sec like i thought it should). U mean this is what its supposed to do? Or ive misunderstood something?


Scroll to top



RSSRSSRSSRSS

Copyright © 2013 Chasseur De Bots

Warsow in social media



Warsow is an indie game developed by group of hobbyists. Please consider giving us a small donation: