• 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] script to check the movement and views

Dinisk

DinisK
89
Posts
7
Years
    • Seen Apr 27, 2019
    I sat and thought where I was making a mistake, but after ten hours my patience could not stand it and I ask for help from you. What I want. Girl, as on the screen, depending on the direction of gaze (there are two options, up and to the left) moves away from the nameplate without touching the main character. At first she speaks (look at the nameplate) and moves away from her. Then, when the dialogue is repeated, she answers (have you read?) and only when you exit the card she again gets up next to the nameplate. Tom girl continues to move again during the dialogue. I want to do all this through variables, no flags and copyvars 4011&800C (sorry my bad google translate)
    yCdOyTE.png

    #dynamic 0x800000

    #org @start
    compare 0x4011 0x0
    if 0x1 call @msg 0x2
    copyvar 0x4011 0x800C
    compare 0x4011 0x2
    if 0x1 call @up
    copyvar 0x4011 0x800C
    compare 0x4011 0x3
    if 0x1 call @left
    compare 0x4011 0x2
    if 0x4 call @msg2
    end

    #org @msg
    setvar 0x4011 0x1
    msgbox @msg1 0x2
    end

    #org @msg1
    = Oh look, look

    #org @msg2
    = Godspeed!

    #org @up
    copyvar 0x4011 0x800C
    applymovement 0x2 @move
    waitmovement 0x2
    end

    #org @move
    #raw 0x3
    #raw 0x13
    #raw 0x2
    #raw 0xfe
    end

    #org @left
    copyvar 0x4011 0x800C
    applymovement 0x2 @move1
    waitmovement 0x2
    end

    #org @move1
    #raw 0x0
    #raw 0x10
    #raw 0x1
    #raw 0xfe
    end
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • Here, this script should be what you're looking for:

    Code:
    #dynamic 0x800000
    
    #org @start
    checkflag 0x1F // Checks if we've already spoken
    if 0x1 goto @done // If we have spoken to her, skip to the end
    setflag 0x1F // Sets a temporary flag
    msgbox @msg1 0x2
    compare 0x800C 0x2 // We don't need to copyvar 0x800C to 0x4011, we can read it directly
    if 0x1 goto @up // We only need to check 0x800C once and split the script depending on the result
    applymovement 0x2 @move1
    waitmovement 0x0
    movesprite2 0x2 0x2 0x4 // Changes the default position of the OW until you leave the map
    spritebehave 0x2 0x7 // Makes the OW face up if you unload them and then return
    end
    
    #org @up
    applymovement 0x2 @move
    waitmovement 0x0
    movesprite2 0x2 0x3 0x3 // Changes the default position of the OW until you leave the map
    spritebehave 0x2 0x9 // Makes the OW face left if you unload them and then return
    end
    
    #org @done
    msgbox @msg2 0x2
    end
    
    #org @move
    #raw 0x13 // The girl doesn't have to face right before moving right
    #raw 0x2
    #raw 0xFE // Don't put the 'end' command after movement values
    
    #org @move1
    #raw 0x10// The girl doesn't have to face down before moving down
    #raw 0x1
    #raw 0xFE // Don't put the 'end' command after movement values
    
    #org @msg1
    = Oh look, look!
    
    #org @msg2
    = Godspeed!

    You said that you didn't want to use any flags, but flag 0x1F is a bit different than most others. Its a temporary flag, meaning that when you exit the map, it resets to 0x0. Flags 0x11 - 0x1F are usually only used for destructible OWs that reset themselves (Cut trees, Rock Smash rocks etc) but since you want the girl to reset her position when you leave the map I thought it would be appropriate to use in this context.
     
    Last edited:

    Dinisk

    DinisK
    89
    Posts
    7
    Years
    • Seen Apr 27, 2019
    Here, this script should be what you're looking for:

    Code:
    #dynamic 0x800000
    
    #org @start
    checkflag 0x1F // Checks if we've already spoken
    if 0x1 goto @done // If we have spoken to her, skip to the end
    setflag 0x1F // Sets a temporary flag
    msgbox @msg1 0x2
    compare 0x800C 0x2 // We don't need to copyvar 0x800C to 0x4011, we can read it directly
    if 0x1 goto @up // We only need to check 0x800C once and split the script depending on the result
    applymovement 0x2 @move1
    waitmovement 0x0
    movesprite2 0x2 0x2 0x4 // Changes the default position of the OW until you leave the map
    spritebehave 0x2 0x7 // Makes the OW face up if you unload them and then return
    end
    
    #org @up
    applymovement 0x2 @move
    waitmovement 0x0
    movesprite2 0x2 0x3 0x3 // Changes the default position of the OW until you leave the map
    spritebehave 0x2 0x9 // Makes the OW face left if you unload them and then return
    end
    
    #org @done
    msgbox @msg2 0x2
    end
    
    #org @move
    #raw 0x13 // The girl doesn't have to face right before moving right
    #raw 0x2
    #raw 0xFE // Don't put the 'end' command after movement values
    
    #org @move1
    #raw 0x10// The girl doesn't have to face down before moving down
    #raw 0x1
    #raw 0xFE // Don't put the 'end' command after movement values
    
    #org @msg1
    = Oh look, look!
    
    #org @msg2
    = Godspeed!

    You said that you didn't want to use any flags, but flag 0x1F is a bit different than most others. Its a temporary flag, meaning that when you exit the map, it resets to 0x0. Flags 0x11 - 0x1F are usually only used for destructible OWs that reset themselves (Cut trees, Rock Smash rocks etc) but since you want the girl to reset her position when you leave the map I thought it would be appropriate to use in this context.
    Amazing, your knowledge is great, this is exactly what I need.// surprising where did you get such information, because it is not in the xse manual (keyboard f2) and in other long guides(or did not quite understand what it means)
    thanks again
     
    Last edited:

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • Amazing, your knowledge is great, this is exactly what I need.// surprising where did you get such information, because it is not in the xse manual (keyboard f2) and in other long guides(or did not quite understand what it means)
    thanks again

    Ten years on this forum kind of does that, you just pick things up from everywhere :P

    One of the best resources to get a more detailed explanation about individual scripting commands is DavidJCobb's document with amendments by Spherical Ice. Asking questions on the forum is also a good way to learn. Other than that, just studying in-game scripts and practicing/ experimenting is probably the best way to directly improve your scripting skills.
     
    Back
    Top