Weather Function

Discussion in 'Server and Client Scripting' started by Morty., Jun 8, 2014.

  1. Morty.

    Morty. Learning Scripting

    Joined:
    Jan 12, 2014
    Messages:
    32
    Likes Received:
    0
    PO Trainer Name:
    Morty
    I am trying a new Tier, called "Random Weather"

    The idea, is that a random weather will be setup if this tier is selected. I tried this, but it is not working. Any ideas Please? :s I already have created it in the "tiers.xml"

    battleSetup: function(p1,p2,battle_id) {
    if (weather == "granizo") {
    sys.prepareWeather(battle_id, 1);
    }
    if (weather == "lluvia") {
    sys.prepareWeather(battle_id, 2);
    }
    if (weather == "arena") {
    sys.prepareWeather(battle_id, 3);
    }
    if (weather == "sol") {
    sys.prepareWeather(battle_id, 4);
    }
    if (sys.tier(src, 0) == "Random Weather" && (sys.tier(src, 1) == "Random Weather")) {
    var randweather = sys.rand(0, 4);
    sys.prepareWeather(battle_id, randweather)
    }
    },
     
  2. Morty.

    Morty. Learning Scripting

    Joined:
    Jan 12, 2014
    Messages:
    32
    Likes Received:
    0
    PO Trainer Name:
    Morty
    Just to Note it , in the previous version of PO, I had the command "Clima" then, /clima sol. sets Weather == "sol". and the weather became "sun". But in 2.4.1 it does not work any more. Maybe you who are experts might help me on that :c
     
  3. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    There's (probably) nothing wrong with the script.
    Seems like the battleSetup event is no longer called. I'll look into it.
     
  4. Morty.

    Morty. Learning Scripting

    Joined:
    Jan 12, 2014
    Messages:
    32
    Likes Received:
    0
    PO Trainer Name:
    Morty
    That would explain it :c I am really desperate to make it work :c