• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

[Pokeemerald] Camera will not move during script

  • 8
    Posts
    2
    Years
    • Seen Dec 20, 2023
    Hello,

    I've run into a scripting problem while using pokeemerald. I'm trying to pan the camera during a cutscene/script, but when I build the game, nothing happens. The rest of the Explosion script goes off, but the camera stays in place. Does the problem lie with the code, or something else?



    Code:
    mapscripts PewterMine_MapScripts {
    	map_script MAP_SCRIPT_ON_TRANSITION: PewterMine_OnTransition
    	}
    
    script PewterMine_OnTransition{
    end
    }
    script PewterMine_JoinAmy{
    lock
    if(var(VAR_STORY_PROGRESS)<14){
    msgbox(format("Ugh... I'll show you! You grunts have nothing on us!"))
    faceplayer
    msgbox(format("Hey, you! Help me beat this guy!"),MSGBOX_YESNO)
    if(var(VAR_RESULT)==1){
    multi_fixed_2_vs_1(TRAINER_GRUNT_AQUA_HIDEOUT_2,format("How..."),TRAINER_GRUNT_AQUA_HIDEOUT_1,3)
    specialvar(VAR_RESULT, GetBattleOutcome)
    if(var(VAR_RESULT)==B_OUTCOME_WON){
    setvar(VAR_STORY_PROGRESS,14)
    delay(10)
    goto(PewterMine_Explosion)
    }
    else{
    special(SetCB2WhiteOut)
    }
    }
    }
    release
    end
    }
    script PewterMine_JoinCaleb{
    lock
    if(var(VAR_STORY_PROGRESS)<14){
    msgbox(format("You people have no right to be here! Here, or anywhere in Kanto!"))
    faceplayer
    msgbox(format("Hey! Help me chase this grunt away!"),MSGBOX_YESNO)
    if(var(VAR_RESULT)==1){
    multi_fixed_2_vs_1(TRAINER_GRUNT_AQUA_HIDEOUT_3,format("No!"),TRAINER_SAWYER_1,2)
    specialvar(VAR_RESULT, GetBattleOutcome)
    if(var(VAR_RESULT)==B_OUTCOME_WON){
    setvar(VAR_STORY_PROGRESS,14)
    delay(10)
    goto(PewterMine_Explosion)
    }
    else{
    special(SetCB2WhiteOut)
    }
    }
    }
    release
    end
    }
    
    script PewterMine_Magma6Dia{
    lock
    msgbox(format("Zubat! Clear out the enemy!"))
    release
    end
    }
    
    script PewterMine_Aqua7Dia{
    lock
    msgbox(format("Ack... What are you people doing on our turf?"))
    release
    end
    }
    
    script PewterMine_Magma9Dia{
    }
    script PewterMine_Magma10Dia{
    }
    script PewterMine_Explosion{
    lock
    delay(5)
    applymovement(OBJ_EVENT_ID_CAMERA,PewterMine_CameraExplosion)
    waitmovement(0)
    applymovement(8,PewterMine_Aqua8Jump)
    msgbox(format("It's a bomb!"))
    applymovement(4,PewterMine_Exclam)
    msgbox(format("Hold da kaeft!"))
    msgbox("Run!")
    applymovement(8,PewterMine_Aqua8Run)
    applymovement(4,PewterMine_SorenRun)
    applymovement(6,PewterMine_Aqua7Run)
    applymovement(7,PewterMine_Aqua7Run)
    applymovement(9,PewterMine_Magma9Run)
    applymovement(3,PewterMine_Aqua3Run)
    applymovement(5,PewterMine_Aqua3Run)
    waitmovement(0)
    fadescreen(1)
    special(ShakeCamera)
    setflag(FLAG_PEWTER_MINE_DONE)
    applymovement(OBJ_EVENT_CAMERA,PewterMine_CameraBack)
    waitmovement(0)
    fadescreen(0)
    release
    end
    }
    
    movement PewterMine_Aqua7Run{
    walk_diag_northeast
    walk_fast_right*11
    step_end
    }
    movement PewterMine_Magma9Run{
    walk_fast_down*3
    walk_fast_right*10
    step_end
    }
    movement PewterMine_Aqua3Run{
    walk_fast_up*3
    walk_fast_right
    walk_diag_northeast
    walk_fast_right*11
    step_end
    }
    movement PewterMine_Aqua8Run{
    walk_fast_right*2
    walk_diag_northeast
    walk_fast_right*4
    walk_diag_northeast
    walk_fast_right*10
    step_end
    }
    movement PewterMine_Aqua8Jump{
    emote_exclamation_mark
    delay_16
    jump_in_place_right
    jump_in_place_right
    }
    movement PewterMine_SorenRun{
    walk_fast_down*3
    walk_fast_right*2
    walk_diag_northeast
    walk_fast_right*4
    walk_diag_northeast
    walk_fast_right*9
    step_end
    }
    movement PewterMine_Aqua11Run{
    walk_fast_up*2
    walk_fast_right*2
    walk_diag_northeast
    walk_fast_right*4
    walk_diag_northeast
    walk_fast_right*9
    step_end
    }
    movement PewterMine_Exclam{
    emote_exclamation_mark
    }
    movement PewterMine_CameraExplosion{
    walk_fast_down*7
    walk_fast_left*5
    step_end
    }
    movement PewterMine_CameraBack{
    walk_fast_right*5
    walk_fast_up*7
    step_end
    }
     
    Hello,

    I've run into a scripting problem while using pokeemerald. I'm trying to pan the camera during a cutscene/script, but when I build the game, nothing happens. The rest of the Explosion script goes off, but the camera stays in place. Does the problem lie with the code, or something else?

    Code:
    script PewterMine_Explosion{
    lock
    delay(5)
    applymovement(OBJ_EVENT_ID_CAMERA,PewterMine_CameraExplosion)
    waitmovement(0)
    I see you trying to move the camera object, but I don't see you spawning it on the map anywhere in any of your scripts.
    In order to do anything with the camera object, you first need to spawn it on the current map through special(SpawnCameraObject) and then you can do whatever with OBJ_EVENT_ID_CAMERA.
    Also, keep in mind you have to despawn it at the end of the script too using special(RemoveCameraObject).
     
    Thank you, turns out that that was all I was missing! Is there a thread or other place to find scripting details like this? All I can find is overviews of pokeemerald or poryscript and simple tutorials, but not information like this.
     
    Thank you, turns out that that was all I was missing! Is there a thread or other place to find scripting details like this? All I can find is overviews of pokeemerald or poryscript and simple tutorials, but not information like this.
    None that I'm aware of besides Avara's own tutorial, but merely looking at the usages of OBJ_EVENT_ID_CAMERA through git grep should be enough.
    There isn't a better source of overworld scripting knowledge than the game's own overworld scripts, imo.
    https://github.com/pret/pokeemerald/blob/master/data/maps/NavelRock_Top/scripts.inc#L38-L43
    https://github.com/pret/pokeemerald...s/SouthernIsland_Interior/scripts.inc#L61-L62
    https://github.com/pret/pokeemerald/blob/master/data/maps/SkyPillar_Top/scripts.inc#L95-L96
     
    Back
    Top