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

[Scripting Question] Camping event

  • 4
    Posts
    209
    Days
    • Seen Nov 17, 2024
    Hi, I'm pretty newbie with Pokemon fangame creation. Maybe this is really ambitious for newbie like me, but i want to make a camping event. The idea is this is a healing event where the main character can find a spot to set a camp. It will teleport the player to a small camp map. In this map, i want the pokemon in the team to appear on map (and maybe moving randomly or interact with each other, just another ambitious target lol). Ofcourse the pokemon which appear on this camp will depends on the player's party. After that the screen will turn black and the player will be teleported back to main map again. My question is, is there a way to get all value for pokemon party? I mean, like i want to get 6 value for each unique pokemon in the party. I'm guessing it has something to do with this Trainer.party value.
     
    Updated: my friend jokingly sugget to try asking chatgpt and it actually kinda working.

    # This script should be placed in the script section of the object event.

    # Debugging message indicating interaction
    pbMessage("You interacted with the object! Your Pokémon will appear.")

    # Get the player's Pokémon party
    pokemon_party = $player.pokemon_party

    # Check if the player has any Pokémon
    if pokemon_party.empty?
    pbMessage("You have no Pokémon in your party.")
    return
    end

    # Loop through the designated event spots (assuming IDs 1 to 6)
    (1..6).each do |i|
    event_id = i # The ID of the event spot (1 to 6)

    # Get the current Pokémon from the player's party (up to 6 Pokémon)
    pokemon = pokemon_party[i - 1] if i <= pokemon_party.length

    if pokemon
    # Get the species name in uppercase
    species_name = pokemon.species.to_s.upcase

    # Build the path for the graphic file in the Followers folder
    graphic_path = "Graphics/Characters/Followers/#{species_name}.png"

    # Check if the graphic file exists
    if File.exist?(graphic_path)
    # Set the character graphic for the event spot
    $game_map.events[event_id].character_name = "Followers/#{species_name}"
    else
    # Use default graphic if the specific graphic is not found
    pbMessage("Graphic not found for #{pokemon.name}, using default graphic.")
    $game_map.events[event_id].character_name = "Followers/000" # Default graphic
    end
    else
    # If there are fewer than 6 Pokémon, keep the event's graphic as default
    $game_map.events[event_id].character_name = "Followers/000" # Default graphic
    end

    # Refresh the event to apply changes
    $game_map.events[event_id].refresh
    end

    pbMessage("Your Pokémon have appeared as NPCs!")





    I know that the script is pretty rough and maybe not the best but at least it fulfilled what i need. Idk how to close this thread, if needed.
     
    Back
    Top