Conditional by Actor Sprite

Discussion in 'RGSS3 Script Requests' started by Christopher Riel, Oct 23, 2019.

Thread Status:
Not open for further replies.
  1. Christopher Riel

    Christopher Riel Villager Member

    Messages:
    16
    Likes Received:
    0
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    Hi, I've been testing different conditionals with the actors, the conditional by Actor Faces has really helped me a lot
    Code:
    $game_actors[x].face_name == "FileName" && $game_actors[x].face_index == "Index"
    but, I would like to know if the same can be done but with the actors' sprites.
    I've tried something simple like:
    Code:
    $game_actors[X].character_name == "FileName" && $game_actors[X].character_index == "Index"
    But they have not worked. especially the "character_index" that I tried the same with variables and it has not worked.
    How could it make it work?
     
    #1
  2. Oddball

    Oddball Veteran Veteran

    Messages:
    1,643
    Likes Received:
    429
    First Language:
    English
    Primarily Uses:
    N/A
    A cobbled together solution would be to change the actor, and have multipule copies of the same actor with different graphics. Then, you'd only need to test for the actor
     
    #2
  3. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,640
    Likes Received:
    2,966
    Location:
    Philippines
    First Language:
    Tagalog
    I think it should have worked... For starters, maybe try checking the actual value of those properties first...

    Do this on a script call before your check

    Code:
    p $game_actors[x].character_name
    p $game_actors[x].character_index
    
    Then test your game with the console on, and see the value that gets printed. This will help you know why the condition doesnt work.
     
    #3
  4. Christopher Riel

    Christopher Riel Villager Member

    Messages:
    16
    Likes Received:
    0
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    Mmmm .. I made a script call with the code you gave me, but the name of the actor does not change in the console, and the Index only remain at 0.
     
    #4
  5. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,640
    Likes Received:
    2,966
    Location:
    Philippines
    First Language:
    Tagalog
    What is the exact message you see in the console?

    Can you also post a screenshot of your actual event commands?
     
    #5
  6. Christopher Riel

    Christopher Riel Villager Member

    Messages:
    16
    Likes Received:
    0
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    Oh, I think I already solved the problem, I think the conditional does not detect the actor's file name or the Index through "Set Move Route".
    but if you change the values when make with the "Change Actor Graphic" button

    well I think it turned out, thanks for the help c:
     
    #6
  7. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,640
    Likes Received:
    2,966
    Location:
    Philippines
    First Language:
    Tagalog
    Thats weird... Using the change graphics inside move route should reflect on the properties because the engine uses only those properties to display the correct sprite. So if the sprites are changing in-game, the properties should also be changing...
     
    #7
  8. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,952
    Likes Received:
    10,653
    First Language:
    English
    Primarily Uses:
    RMVXA

    This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

     
    #8
Thread Status:
Not open for further replies.

Share This Page