project-navigation
Personal tools

Author Topic: Small hud experiments...  (Read 3517 times)

Offline Malick

  • Rookie
  • ***
  • Posts: 72
    • View Profile
Small hud experiments...
« on: February 09, 2011, 07:31:33 pm »
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: [Select]
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"
}

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

Thanks !

Malick

Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: Small hud experiments...
« Reply #1 on: February 09, 2011, 07:36:07 pm »
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.

Offline Malick

  • Rookie
  • ***
  • Posts: 72
    • View Profile
Re: Small hud experiments...
« Reply #2 on: February 09, 2011, 11:42:03 pm »
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

Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: Small hud experiments...
« Reply #3 on: February 10, 2011, 02:12:07 pm »
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"