• 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.

[Other Question] Untitled

  • 7
    Posts
    4
    Years
    • Seen Jun 4, 2024
    I was wondering how to do a soot mechanic similar to the one in Ruby and Sapphire.
     
  • 278
    Posts
    15
    Years
    This is actually pretty easy.
    Create a variable with the name of Soot or SootSack, create an event and give it the soot grass graphic along with change the trigger to player touch. In the event command sections create a conditional branch and have it check if the player has the SootSack item. If they do have it increase the Soot variable by one, otherwise have it do nothing. After the end of the conditional branch have the event delete itself with the Erase Event command so that tile doesn't give you anymore soot until you leave and come back. Then copy and paste the event over all of the grass tiles you want the player to collect soot from. I have attached an image of how the event should be set up, just select your graphic instead of the one I used.
     

    Attachments

    • Untitled
      1.png
      31.4 KB · Views: 3
    Last edited:
  • 1,682
    Posts
    8
    Years
    • Seen yesterday
    Why not use the onStepTakenFieldMovement proc that was made for that purpose!
    Looks like this, it's in PField_Field.
    Code:
    Events.onStepTakenFieldMovement+=proc {|sender,e|
      event = e[0] # Get the event affected by field movement
      thistile = $MapFactory.getRealTilePos(event.map.map_id,event.x,event.y)
      map = $MapFactory.getMap(thistile[0])
      sootlevel = -1
      for i in [2, 1, 0]
        tile_id = map.data[thistile[1],thistile[2],i]
        next if tile_id==nil
        if map.terrain_tags[tile_id] && map.terrain_tags[tile_id]==PBTerrain::SootGrass
          sootlevel = i
          break
        end
      end
      if sootlevel>=0 && hasConst?(PBItems,:SOOTSACK)
        $PokemonGlobal.sootsack = 0 if !$PokemonGlobal.sootsack
    #    map.data[thistile[1],thistile[2],sootlevel]=0
        if event==$game_player && $PokemonBag.pbHasItem?(:SOOTSACK)
          $PokemonGlobal.sootsack += 1
        end
    #    $scene.createSingleSpriteset(map.map_id)
      end
    }
    Comment the two commented lines. We may also have to change this line here, map.data[thistile[1],thistile[2],sootlevel]=0, specifically the 0. If your soot grass incluedes the ground under it, and you can't just delete the tile out right, you need to change it to the correct tile, instead of 0, the blank one.
    Tile ids work like this
    of course that means that the grass has to either change to the right tile id if it includes the ground under it.
    8* the row number + 384 + the column number is the tile id for regular tiles. each auto tile is 48 ids each but I don't know how those match up.
    might need to check the tileset of the map before setting the new tile id, that would be a good idea.
    It's not everything, but this is also a big push in the right direction.
     
    Back
    Top