(done) player_colors

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
Post Reply
User avatar
ian_scho
High Lord
Posts: 2807
Joined: Fri Apr 07, 2006 8:30 am
Location: Zaragoza, Spain

(done) player_colors

Post by ian_scho »

Hi again,

I see that player_colors is a four length array of... Colours for the champions. Great, we can change that at start-up.

Buuuut changing it on the fly does nothing whatsoever. It's not important as I can change the text colour anyways, just a gimmick, but I always wanted a pink champion :P

I see similar arrays such as g_disabled_runes are updated by the dsb functions.
User avatar
ian_scho
High Lord
Posts: 2807
Joined: Fri Apr 07, 2006 8:30 am
Location: Zaragoza, Spain

Re: player_colors

Post by ian_scho »

ian_scho wrote:Great, we can change that at start-up..... does nothing whatsoever.
My bad, you use this to generate the Resurrected/Reincarnated/Gained a level messages and changing it will not change the champions colours - only their message colours. The bar colours and the four hero icons are effectively static, they dont change.
User avatar
Sophia
Concise and Honest
Posts: 4307
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

The initial champion colors are "cached" at program start and the table isn't consulted again.

I'll expand dsb_update_strings into a more generic "update" function (and give it a new name, but the old one will still work) that will handle things like this.
User avatar
ian_scho
High Lord
Posts: 2807
Joined: Fri Apr 07, 2006 8:30 am
Location: Zaragoza, Spain

Post by ian_scho »

I see that youve implemented this, Thanks :wink:
The images for the characters in the top right dont change and I assume these are images and are not dynamic like the bars.

Image

Code: Select all

player_colors[1] =  {100, 100, 100}
player_colors[2] =  {200, 200, 200}
dsb_update_system()
User avatar
Sophia
Concise and Honest
Posts: 4307
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

ian_scho wrote:I assume these are images and are not dynamic like the bars.
Correct assumption.
They're automatically created, but only once. I'll fix this.
Post Reply