Development > Newbie Coding

Small hud experiments...

(1/1)

Malick:
Hi gents,

I've been away and lurking a loooong time. I've decided to experiment with some coding for UFO AI.

My first test is to modify the HUD, in order to show the rank of the selected unit in the hovering bar.
I opened hud_default.ufo and copy pasted some lines, editing with the following code :


--- Code: --- image rank_bg
{
src "hud/head_box"
pos "25 105"
size "75 75"
}

image rank_img
{
src *cvar:mn_hovered_chrrank_img
pos "35 120"
size "50 50"
}

--- End code ---

The head box shows, but not the rank.
Of course it does not work. Can anybody tell me what's wrong ???

Thanks !

Malick

bayo:
hi. I dont check.

maybe mn_hovered_chrrank_img is not exposed when you a soldier in the hud.

anyway, u should provide a diff instead of code. It is incredibly more easy to test.

Malick:
Hi bayo,

Sorry, I'm a bit confused : how do I generate a diff file ?
I'm not using any programming soft currently, just editing the ufo files with notepad :D

I manage to show the rank as a string with *cvar:mn_chrrank
But it seems it is not accessible with the _hovered_ function

I need to reinstall the sources and a decent C compiler (Code::Blocks ?)
Then I'll try a little bit harder.

Thanks anyway :)

Malick

bayo:
Yes Code::Blocks should work for Windows, for other plateforms there is makefile.

To create diff, if you use "git", u can use "git diff"

Navigation

[0] Message Index

Go to full version