• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Script✓] Making sprites invisible at the beginning of the game

23
Posts
10
Years
    • Seen Jun 5, 2023
    Hi,

    I'm currently developing a script -- in which the player character received his/her starter Pokemon from the professor. My intention is for the rival to arrive late to the lab, and appear while the professor is talking to the player.

    This involves the rival's sprite being invisible until the dialogue with the professor has been activated. I am uncertain on how to do this, so any help would be most welcome.
     
    48
    Posts
    7
    Years
  • Sprite visibility is controlled by flag. You can use the following commands in XSE to manipulate flags:
    Spoiler:


    When a flag number is same as the person's ID number (you can find the number below Script offset box in Advanced map), setting the flag makes the person invisible and clearing the flag makes it visible again.

    For specifically your case:
    You can place your rival's sprite in the lab and put a number between 200-2FF in the ID box. (These are the safe flags you can use. There is a documentation about which flags are safe to use and which are not.) Say, you put 269 as the Id number for example. Then somewhere before you enter the lab in your game, make a script to make flag 0x269 set. Your rival's sprite will be hidden in the game as soon as 0x269 is set. And in the script the inside the lab, just include the line "clearflag 0x269" and the sprite will become visible again. After this line, you can manipulate the rival sprite (movements, dialogues, etc) in any way you want.

    Bonus tip:
    Here is what i usually do. I set a bunch of flags from 200-210 in a level script in mom's room in player's house. I can use these flags later in the game to make invisible people visible again.

    Hope these helps!

    Edit: Added the documentation link. Also, just noticed that there is a tick mark in the post., so I guess your question might have already been answered..
     
    Last edited:
    Back
    Top