• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

NEED HELP: Pokemon Trigger

Status
Not open for further replies.
Level 1
Joined
May 20, 2014
Messages
1
Heyho,
i want to make a Pokemon Game,
i created now the Catching + Evolution Triggern,
the last part is that the Pokemon´s can be called by his owner,
the Problem is in my trigger that i cant call it again when its evolved,
Example Charmander can be callen, evolved to Charmeleon it doesnt work anymore,
i dont know how to create the trigger for it, can someone help me pls? =(

And how can i let the Text appear in GUI? Greets =)

Init Trigger:
[GUI]Catch Trigger
Ereignisse
Einheit - A unit Beginnt, eine Fähigkeit zu wirken
Bedingungen
(Ability being cast) Gleich Catch
Aktionen
For each (Integer A) from 1 to MaxPokemon, do (Actions)
Schleifen - Aktionen
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
(Unit-type of (Target unit of ability being cast)) Gleich Pokemon[(Integer A)]
'THEN'-Aktionen
Set PokemonNumber = (PokemonNumber + 1)
Set PokemonCaptured[PokemonNumber] = (Target unit of ability being cast)
Held - Create Pokeball and give it to (Casting unit)
Set Pokeball[PokemonNumber] = (Last created item)
Einheit - Rescue (Target unit of ability being cast) for (Owner of (Casting unit)) and Farbe behalten
Set tmploc = (Center of Gebiet 007 <gen>)
Einheit - Move (Target unit of ability being cast) instantly to tmploc
Spiel - 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'-Aktionen
Do nothing
[/GUI]
Evolution Trigger:

Evolution trigger
Ereignisse
Einheit - A unit Steigt eine Stufe auf
Bedingungen
Aktionen
For each (Integer A) from 1 to MaxPokemon, do (Actions)
Schleifen - Aktionen
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
(Unit-type of (Triggering unit)) Gleich Pokemon[(Integer A)]
(Level of (Triggering unit)) Gleich PokemonEvolveLevel[(Integer A)]
'THEN'-Aktionen
Set tmploc = (Position of (Triggering unit))
Set tmpint = (Level of (Triggering unit))
Einheit - Pause ein (Triggering unit)
Spezialeffekt - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCasterOverhead.mdl
Wait 1.00 seconds
Spezialeffekt - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
Wait 1.00 seconds
Spezialeffekt - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
Wait 1.00 seconds
Spezialeffekt - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
Wait 1.00 seconds
Spezialeffekt - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
Wait 0.50 seconds
Einheit - Pause aus (Triggering unit)
Einheit - Remove (Triggering unit) from the game
Spezialeffekt - Destroy (Last created special effect)
Einheit - Create 1 PokemonEvolution[(Integer A)] for (Owner of (Triggering unit)) at tmploc facing Vorgabe für Gebäude-Ausrichtung degrees
Held - Set (Last created unit) Hero-level to tmpint, Verbergen level-up graphics
Custom script: call RemoveLocation(udg_tmploc)
'ELSE'-Aktionen

Catch Trigger

Evolution trigger
Ereignisse
Einheit - A unit Steigt eine Stufe auf
Bedingungen
Aktionen
For each (Integer A) from 1 to MaxPokemon, do (Actions)
Schleifen - Aktionen
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
(Unit-type of (Triggering unit)) Gleich Pokemon[(Integer A)]
(Level of (Triggering unit)) Gleich PokemonEvolveLevel[(Integer A)]
'THEN'-Aktionen
Set tmploc = (Position of (Triggering unit))
Set tmpint = (Level of (Triggering unit))
Einheit - Pause ein (Triggering unit)
Spezialeffekt - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCasterOverhead.mdl
Wait 1.00 seconds
Spezialeffekt - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
Wait 1.00 seconds
Spezialeffekt - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
Wait 1.00 seconds
Spezialeffekt - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
Wait 1.00 seconds
Spezialeffekt - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
Wait 0.50 seconds
Einheit - Pause aus (Triggering unit)
Einheit - Remove (Triggering unit) from the game
Spezialeffekt - Destroy (Last created special effect)
Einheit - Create 1 PokemonEvolution[(Integer A)] for (Owner of (Triggering unit)) at tmploc facing Vorgabe für Gebäude-Ausrichtung degrees
Held - Set (Last created unit) Hero-level to tmpint, Verbergen level-up graphics
Custom script: call RemoveLocation(udg_tmploc)
'ELSE'-Aktionen

CALL TRIGGER - PROBLEM!!!!

Call Pokemon
Ereignisse
Einheit - A unit Benutzt einen Gegenstand
Bedingungen
(Item-type of (Item being manipulated)) Gleich Pokeball
Aktionen
For each (Integer A) from 1 to PokemonNumber, do (Actions)
Schleifen - Aktionen
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
(Item being manipulated) Gleich Pokeball[(Integer A)]
AlreadyCalled[(Integer A)] Gleich False
'THEN'-Aktionen
Set tmploc = (Position of (Hero manipulating item))
Einheit - Move PokemonCaptured[(Integer A)] instantly to tmploc
Set AlreadyCalled[(Integer A)] = True
Custom script: call RemoveLocation(udg_tmploc)
'ELSE'-Aktionen
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-Bedingungen
AlreadyCalled[(Integer A)] Gleich True
'THEN'-Aktionen
Set tmploc = (Center of Gebiet 008 <gen>)
Einheit - Move PokemonCaptured[(Integer A)] instantly to tmploc
Set AlreadyCalled[(Integer A)] = False
Custom script: call RemoveLocation(udg_tmploc)
'ELSE'-Aktionen
Do nothing

So how can i make it that the trigger know´s that the evolved Monster has the same Place in Inventory of his owner,
for example that Monster 1 has Spot 1 Pokeball in inventory
Monster 2 has Spot 2 in Inventory?

Please help me^^ !!
 
Last edited:
Level 29
Joined
Oct 24, 2012
Messages
6,543
JASS:
 [/JASS + ]
Use this without the '+'... ^[/QUOTE]

The above is triggers / gui not jass

@TO
Place your triggers in trigger and hidden tags like this.

[plain][hidden="Trigger name here"][trigger]Copied trigger here[/trigger][/hidden][/plain]

Will look like this.
[hidden="Trigger name here"][trigger]Copied trigger here[/trigger][/hidden]

You should also remove all your leaks. The tutorial Things that leak will help you with that.
You should make your triggers more efficient.
 Never use integer A / B use a custom integer variable. Integer A / B are slower and less efficient.
 Anything used twice or more should be stored in a variable and the variable should be used.
 Don't use waits. They are inaccurate and can cause other problems.
You should look at my tutorial Things You Should Know When Using Triggers / GUI
It will explain a lot more on the things I pointed out above.
Link is below in my sig.
 
Status
Not open for further replies.
Top