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

AI vs AI

  • 4
    Posts
    11
    Years
    • Seen Dec 4, 2014
    Hi there!

    Seeing as i have been searching for hours now with no results, i figured i'd just ask directly. What is the best way, if at all possible, to make a battle where both sides are controlled by the AI?
     
    Hmm i do have idea but its a little awkward to explan but basicly you need to find the AI script then make the sencond battler use that insted of being controlled. i look into makeing a script for that. when i have time
     
    Thanks!

    I do have some basic programming experience but none with ruby, and i'm not sure how one would go about changing what controls the player.
     
    Its not full ai but here you go
    Spoiler:


    Replace the old pbOwnedByPlayer?(index) with the above code you should find it in PokeBattle_Battle

    The pokemon will battle each other when you active switch 76
     
    Its not full ai but here you go
    Spoiler:


    Replace the old pbOwnedByPlayer?(index) with the above code you should find it in PokeBattle_Battle

    The pokemon will battle each other when you active switch 76

    With as you stated "pbOwnedByPlayer(index)" would I have to replace this wherever it says that in PokeBattle_Battle? Because my game froze when I activated the switch in battle and I am not sure what it is that I am doing wrong.
     
    Dylanrockin you only have to replace it in the place where it's defined.

    So replace:

    def pbOwnedByPlayer?(index)
    code
    more code
    end

    with:

    def pbOwnedByPlayer?(index)
    return false if pbIsOpposing?(index)
    return false if @player.is_a?(Array) && index==2
    return false if $game_switches[76]==true
    end
     
    Spoiler:


    as stated by Marino i did miss the return true theres a fix above or
    just add "return true" above the end
     
    If I'm allowed to ressurect this thread, is there any way to make this work in 18.1? It was comfy to go through an entire battle with just a key.
     
    If I'm allowed to ressurect this thread, is there any way to make this work in 18.1? It was comfy to go through an entire battle with just a key.

    Yeah, it's the same.
    Write this:
    Code:
      def pbOwnedByPlayer?(idxBattler)
        return false if opposes?(idxBattler)
        return false if $game_switches[89] #Change to whatever free switch you have.
        return pbGetOwnerIndexFromBattlerIndex(idxBattler)==0
      end
     
    Back
    Top