1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

Givin´ the instance another hsv (SOLVED!)

Discussion in 'Programming' started by Architheutis, Apr 29, 2019.

  1. Architheutis

    Architheutis Member

    Joined:
    Nov 9, 2018
    Posts:
    57
    Hi Folks,

    a little queston:

    I have certain levels in night ambience.
    Therefor I changed my player-instance`s hsv in that level, manually.
    But naturally, if my player gets assgrabbed by enemies or harmful objects,
    the k.o.-animation and the reanimated player idle don´t keep the manually
    modified hsv. Now I want to set the values of the hsv within a if room_exists(LV05{
    ...everytime, when my player goes wreck or revives - in the same hue as he started
    at night. I think, there are simple ways to implement, without using shaders.

    Any ideas?
    Thanks a lot!

    Archie.
    :)
     
  2. woods

    woods Member

    Joined:
    Jun 21, 2016
    Posts:
    223
    https://docs.yoyogames.com/source/dadiospice/002_reference/rooms/room_exists.html

    if room_exists(global.rm[0])
    {
    room_goto(global.rm[0]);
    }

    The above code checks to see if the room indexed in the array "global.rm[]" exists and if it does it then goes to that room.

    looks like you need an array of the rooms...


    ===

    another option...
    add a variable nighttime
    if nighttime = true {set speed and such to whatever}
     
    Architheutis likes this.
  3. RefresherTowel

    RefresherTowel Member

    Joined:
    Jul 13, 2016
    Posts:
    1,219
    Make a global variable (or a variable inside your controller object). Store the default player HSV in that (something like global.player_hsv = make_colour_hsv(?,?,?) ). When you draw your player, instead of using make_color_hsv, you simply assign the colour to the global variable ( draw_sprite_ext(player_sprite,image_index,x,y,image_xscale,image_yscale,image_angle,global.player_hsv,image_alpha) ). Then whenever you want the hsv changed, you change the global variable. This way, the players HSV settings are always saved and will be automatically drawn using that saved variable.
     
    Architheutis likes this.
  4. Architheutis

    Architheutis Member

    Joined:
    Nov 9, 2018
    Posts:
    57
    Thank you, guys.
    I will try these methods in the next hours.

    Archie.
    :rolleyes:
     
  5. Architheutis

    Architheutis Member

    Joined:
    Nov 9, 2018
    Posts:
    57
    Hi.

    I`ve figured out, how an object can be situatevely tinted into a certain tone:

    I simply created a script with if-statements... for example:

    // nightfall
    if (room = LV05) || (room = LV19) || (room = LV27){ // add further nighttime levels or scenes inside a non-illuminated cave
    image_blend = make_color_rgb(89,142,178);}

    // sunset
    if (room = LV09){
    image_blend = make_color_rgb(0,0,0);}

    // under water
    if place_meeting(x,y,oWater){ // turns into blueish tone, everytime, when the player gets in contact with the water object
    image_blend = make_color_rgb(20,120
    ,255);}


    I named that script "scr_color" and I added scr_color(); into concerning objects (action)

    That`s it!

    Thank you @woods and @RefresherTowel for your help.
    With your hints I came to the path of that kinda solution.

    Best wishes,
    Archie.
     
    Last edited: Apr 30, 2019

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice