0 Favourites

HP bar green to red

  • hey all since i was on c2 my code was working but then on c3 its not the samething anymore

    how can i reimplement it ???

    thats the download link

    but i want it for c3 now

    and i know that c3 now use rgb(255,255,255)

    anyone cold remake me a script for c3 ?

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • and i know that c3 now use rgb(255,255,255)

    As you said, C3 using for setcolor only one parameter with rgb-values.

    So you have to replace the two events 'set effect 'SetColor' parameter 0' and 'set effect 'SetColor' parameter 1' in C2

    with one event in C3:

    Set effect SetColor parameter 0 to rgb (255 - (smiley.HP / smiley.MaxHP * 255),smiley.HP / smiley.MaxHP * 150,0)

    That's only the paramter 0 and parameter 1 from C2 on position 0 and 1 in the RGB-Value, position 2 is like the parameter 2 in C2 still zero.

  • O_o now im lost

    can you make a working c3 project and send it to dropbox ?

    because im working on otherstuff at same time for my game

  • kiugetski

    In C2 the SetColor Effect has 3 parameters R, G and B. In C3 it has only 1 parameter. You have to use the rgb-command with the same 3 parameters as values.

    In C2 it looks like that:

    Parameter 0 has the value: 255 - (smiley.HP / smiley.MaxHP * 255) that is your R(ed) value.

    Parameter 1 has the value: smiley.HP / smiley.MaxHP * 150 that is your G(reen) value.

    Parameter 2 has the value: 0 You don't set any B(lue) value.

    In C3 there is only one parameter for SetColor but that expects a rgb-value rgb(R,G,B). So you have to set the parameters from C2 as values in the rgb-command:

    rgb (255 - (smiley.HP / smiley.MaxHP * 255), smiley.HP / smiley.MaxHP * 150, 0)

    In C3 it looks now like this:

    The example as c3p:

  • oh ok so instead of having 2 line with set color its just one now

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)