Pokemon Calling Trigger Problem

darkmik07

New Member
Reaction score
2
Trigger:
  • Call Pokemon
    • Events
      • Unit - A unit uses an item
    • Conditions
      • (Item being manipulated) Equal to Pokeball
    • Actions
      • For each (Integer A) from 1 to PokemonNumber, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item being manipulated) Equal to Pokeball[(Integer A)]
              • AlreadyCalled[(Integer A)] = false
            • Then - Actions
              • Set tmploc = (Position of (Triggering unit))
              • Unit - Move PokemonCaptured[(Integer A)] instantly to tmploc
              • Set AlreadyCalled[(Integer A)] = true
              • Custom Script: call RemoveLocation(udg_tmploc)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AlreadyCalled[(Integer A)] = true
                • Then - Actions
                  • Set tmploc = (Center of <rect name>)
                  • Unit - Move PokemonCaptured[(Integer A)] to tmploc
                  • Custom Script: call RemoveLocation(udg_tmploc)
                • Else - Actions

i want it that if the pokemon evolves you can call it back with the same pokeball. But in this trigger i cant call it back with the same pokeball in the inventory.
 

Bogrim

y hello thar
Reaction score
154
Chaos is an ability in the object editor which permanently transforms the unit into another unit-type. If you set an upgrade as requirement for this ability, you can transform the unit without the need to update trigger data.
 

HellCraft

Member
Reaction score
19
Replace your Evolution trigger with this:
Trigger:
  • Evolution
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • For each (Integer A) from 1 to MaxPokemon, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Pokemon[(Integer A)]
              • (Level of (Triggering unit)) Equal to PokemonEvolveLevel[(Integer A)]
            • Then - Actions
              • Set tmploc = (Position of (Triggering unit)) //tmploc is a point
              • Set tmpint = (Level of (Triggering unit)) //tmpint is an integer
              • For each (Integer B) from 1 to (Max(PokemonNumber,MaxPokemon)), do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Triggering Unit) Equal to PokemonCaptured[(Integer B)]
                    • Then - Actions
                      • Set tmpint2 = (Integer B) //tmpint2 is an integer
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-Type of (Triggering Unit)) Equal to Pokemon[(Integer B)]
                    • Then - Actions
                      • Set tmpint3 = (Integer B) //tmpint3 is an integer
                    • Else - Actions
              • Unit - Remove (Triggering unit) from the game
              • Unit - Create 1 PokemonEvolution[(Integer A)] for (Owner of (Triggering unit)) at tmploc facing Default building facing degrees
              • Hero - Set (Last created unit) Hero-level to tmpint, Hide level-up graphics
              • Set PokemonCaptured[tmpint2] = PokemonEvolution[tmpint3]
              • Custom script: call RemoveLocation(udg_tmploc)
            • Else - Actions


Chaos will work too. Totally forgot about that.

EDIT: Oh wait this is wrong. Ill fix it.
EDIT2: Ok, now see if it works or not.
 

darkmik07

New Member
Reaction score
2
so is this it?

Untitled-21.png


What should i change here? and what should i do after?
 

darkmik07

New Member
Reaction score
2
thanks men.. you helped me alot. +rep

EDIT: LOOK AT THE this line:

Set PokemonCaptured[tmpint2] = PokemonEvolution[tmpint3]<---- This line is not working, look at the = PokemonEvolution (i thought pokemonevolution was unit-type? i cant put it there)
 

HellCraft

Member
Reaction score
19
Oh yes, my bad.
Try doing this instead:
Trigger:
  • Set PokemonCaptured[tmpint2] = (Last Created Unit)

And change this:
Trigger:
  • For each (Integer B) from 1 to (Max(PokemonNumber,MaxPokemon)), do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering Unit) Equal to PokemonCaptured[(Integer B)]
        • Then - Actions
          • Set tmpint2 = (Integer B) //tmpint2 is an integer
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-Type of (Triggering Unit)) Equal to Pokemon[(Integer B)]
          • Then - Actions
            • Set tmpint3 = (Integer B) //tmpint3 is an integer
          • Else - Actions


To this:
Trigger:
  • For each (Integer B) from 1 to PokemonNumber, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering Unit) Equal to PokemonCaptured[(Integer B)]
        • Then - Actions
          • Set tmpint2 = (Integer B) //tmpint2 is an integer
        • Else - Actions

Check if it works now.
 

darkmik07

New Member
Reaction score
2
i found another bug.

example:
i catch a pokemon and it instantly moves to the region that i sets, when i call it back and it appears beside me and send him back to the region again. When i call it again the pokemon that i catched is stocked in that region, it wont go beside me


how do i create a trigger that do not allow player 1 to catch pokemon of player 2-10
 

darkmik07

New Member
Reaction score
2
set up a condition in your catching trigger

what does your catching trigger use as an event?

this was the given trigger to me:

Trigger:
  • Catch Pokemon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Catch Pokemon
    • Actions
      • For each (Integer A) from 1 to MaxPokemon, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Target unit of ability being cast)) Equal to Pokemon[(Integer A)]
            • Then - Actions
              • Set PokemonNumber = PokemonNumber + 1 //This is an integer
              • Set PokemonCaptured[PokemonNumber] = (Target unit of ability being cast) //This is a unit array
              • Create an item of type (Pokeball) and give it to (Casting Unit)
              • Set Pokeball[PokemonNumber] = (Last Created Item) //This is an item array
              • Unit - Rescue (Target unit of ability being cast) for (Owner of (Casting unit)) and Change color
              • Set tmploc = (Center of region &lt;rect name&gt;)
              • Unit - Move (Target unit of ability being cast) instantly to tmploc
              • Game - Display to (All players) the text: ((Name of (Owner of (Casting unit))) + ( has captured a + (Name of (Target unit of ability being cast))))
              • Custom Script: call RemoveLocation(udg_tmploc)
            • Else - Actions
 

Chaos_Knight

New Member
Reaction score
39
this was the given trigger to me:

Trigger:
  • Catch Pokemon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Catch Pokemon
    • Actions
      • For each (Integer A) from 1 to MaxPokemon, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Target unit of ability being cast)) Equal to Pokemon[(Integer A)]
            • Then - Actions
              • Set PokemonNumber = PokemonNumber + 1 //This is an integer
              • Set PokemonCaptured[PokemonNumber] = (Target unit of ability being cast) //This is a unit array
              • Create an item of type (Pokeball) and give it to (Casting Unit)
              • Set Pokeball[PokemonNumber] = (Last Created Item) //This is an item array
              • Unit - Rescue (Target unit of ability being cast) for (Owner of (Casting unit)) and Change color
              • Set tmploc = (Center of region &lt;rect name&gt;)
              • Unit - Move (Target unit of ability being cast) instantly to tmploc
              • Game - Display to (All players) the text: ((Name of (Owner of (Casting unit))) + ( has captured a + (Name of (Target unit of ability being cast))))
              • Custom Script: call RemoveLocation(udg_tmploc)
            • Else - Actions

Where is MaxPokemon variable?
 

darkmik07

New Member
Reaction score
2
look at the original thread:

http://www.thehelper.net/forums/showthread.php?t=146606

EDIT: this was the triggers:

This is what I would do:

First an initialization trigger which initializes all the pokemon, their respective evolutions etc.
Trigger:
  • Pokemon Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Setting Pokemon --------
      • Set Pokemon[1] = Bulbasaur //Pokemon is a unit-type array
      • Set Pokemon[2] = Ivysaur
      • Set Pokemon[3] = Venosaur
      • Set Pokemon[4] = Onix
      • Set Pokemon[5] = Sleelix
      • -------- Setting Pokemon Evolutions --------
      • Set PokemonEvolution[1] = Ivysaur //PokemonEvolution is a unit-type array
      • Set PokemonEvolution[2] = Venosaur
      • Set PokemonEvolution[3] = Venosaur //Set it to the same unit since even if the evolution trigger happens for this unit, nothing will happen since the replaced unit is the same as the original one
      • Set PokemonEvolution[4] = Sleelix
      • Set PokemonEvolution[5] = Sleelix
      • -------- Setting the level required for evolution --------
      • Set PokemonEvolveLevel[1] = 5 //PokemonEvolveLevel is an integer array
      • Set PokemonEvolveLevel[2] = 10 //for second grade evolution
      • Set PokemonEvolveLevel[3] = 1000 //basically, set it to a level not reachable so that the pokemon never evolves
      • Set PokemonEvolveLevel[4] = 8
      • Set PokemonEvolveLevel[5] = 1000
      • -------- Max number of pokemon --------
      • Set MaxPokemon = 5 //MaxPokemon is an integer


For the evolution trigger:
Trigger:
  • Evolution
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • For each (Integer A) from 1 to MaxPokemon, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Pokemon[(Integer A)]
              • (Level of (Triggering unit)) Equal to PokemonEvolveLevel[(Integer A)]
            • Then - Actions
              • Set tmploc = (Position of (Triggering unit)) //tmploc is a point
              • Set tmpint = (Level of (Triggering unit)) //tmpint is an integer
              • Unit - Remove (Triggering unit) from the game
              • Unit - Create 1 PokemonEvolution[(Integer A)] for (Owner of (Triggering unit)) at tmploc facing Default building facing degrees
              • Hero - Set (Last created unit) Hero-level to tmpint, Hide level-up graphics
              • Custom script: call RemoveLocation(udg_tmploc)
            • Else - Actions

If you are making items for the pokemon, you need to make an item array variable that stores the items in every item slot and later give those items to last created unit.

And for the catching:
Trigger:
  • Catch Pokemon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Catch Pokemon
    • Actions
      • For each (Integer A) from 1 to MaxPokemon, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Target unit of ability being cast)) Equal to Pokemon[(Integer A)]
            • Then - Actions
              • Unit - Rescue (Target unit of ability being cast) for (Owner of (Casting unit)) and Change color
              • Unit - Move (Target unit of ability being cast) instantly to (Center of &lt;rect name&gt;)
              • Game - Display to (All players) the text: ((Name of (Owner of (Casting unit))) + ( has captured a + (Name of (Target unit of ability being cast))))
            • Else - Actions


EDIT: Forgot that you need to summon the pokemon too.
For that you could do something similar to this:
Set the captured pokemon in a array variable when it's captured. Set the item(the pokeball) that is needed for summoning the in another variable. For this you also need an integer variable.
Since I closed the world editor, and I am too lazy to open it again, ill just type the extra actions freehand.
Trigger:
  • Catch Pokemon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Catch Pokemon
    • Actions
      • For each (Integer A) from 1 to MaxPokemon, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Target unit of ability being cast)) Equal to Pokemon[(Integer A)]
            • Then - Actions
              • Set PokemonNumber = PokemonNumber + 1 //This is an integer
              • Set PokemonCaptured[PokemonNumber] = (Target unit of ability being cast) //This is a unit array
              • Create an item of type (Pokeball) and give it to (Casting Unit)
              • Set Pokeball[PokemonNumber] = (Last Created Item) //This is an item array
              • Unit - Rescue (Target unit of ability being cast) for (Owner of (Casting unit)) and Change color
              • Set tmploc = (Center of region &lt;rect name&gt;)
              • Unit - Move (Target unit of ability being cast) instantly to tmploc
              • Game - Display to (All players) the text: ((Name of (Owner of (Casting unit))) + ( has captured a + (Name of (Target unit of ability being cast))))
              • Custom Script: call RemoveLocation(udg_tmploc)
            • Else - Actions


And for the call pokemon trigger:
Trigger:
  • Call Pokemon
    • Events
      • Unit - A unit uses an item
    • Conditions
      • (Item being manipulated) Equal to Pokeball
    • Actions
      • For each (Integer A) from 1 to PokemonNumber, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item being manipulated) Equal to Pokeball[(Integer A)]
              • AlreadyCalled[(Integer A)] = false
            • Then - Actions
              • Set tmploc = (Position of (Triggering unit))
              • Unit - Move PokemonCaptured[(Integer A)] instantly to tmploc
              • Set AlreadyCalled[(Integer A)] = true
              • Custom Script: call RemoveLocation(udg_tmploc)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AlreadyCalled[(Integer A)] = true
                • Then - Actions
                  • Set tmploc = (Center of &lt;rect name&gt;)
                  • Unit - Move PokemonCaptured[(Integer A)] to tmploc
                  • Custom Script: call RemoveLocation(udg_tmploc)
                • Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top