When I try to export and import the trigger data into another map I get errors on certain lines such as expected function missing and something like this. So then I also imported the object data because I figured that this was the reason there were errors in the triggers. Still didn't work. Should I import the odject data first?
You have to create Location1, Location2, Location3, PokeballGroup, PokeHash, Unit, Unit2, ID, ID2, Angle, variables (I'm not sure if they're all). You also have to be sure that the Pokeball (Catch) and Pokeball (Summon) Raw ID (Press CTRL+D to see Raw ID in the OE) are the same than in the Trigger ('xxxx'), and that the PokeballSummon Item ID is the same than the Pokeball ID in the OE.
I have only just begun to look at JASS tutorials, so how would I make it so that only one pokemon can be out at a time.
I created a Boolean called "AlreadySummoned" False means you haven't summoned any pokemon, True means you have already summoned. I also created an Ability that's given to the Pokemons called "Return to Pokeball", this can be done in another way (Give the ability to the trainer and use it in the Pokemon you want to hide, or the one that's already out automatically, that's easy). Changed a bit the "Pokemon Summon" to work with the AlreadySummoned boolean.
Only thing is, if they evolve and the unit needs to be replaced, how would I maintain that this evolved pokemon is still stored within the same pokeball as the previously unevolved pokemon, and will consequently be able to be summoned and unsummoned from this pokeball? The deeper we dig, the more complicated it gets hah. I see that you have set it up so that a limitless number of conditions may be instated, but am not sure how to do this either.
The same way you save the ID of the Pokemon into the Pokeball, save the ID of the Pokeball into the Pokemon.
JASS:
Set PokemonID = GetHandleId(GetTriggerUnit()) // The ID of the Pokemon
Set PokeballID = LoadInteger(udg_PokeHash, PokemonID, 0) // The ID of the Pokeball stored in the ID of the Pokemon
Set EvolvedPokemonID = GetHandleId(bj_lastCreatedUnit()) // The ID of the Evolved Pokemon
call SaveInteger(udg_Pokehash, ID, 0, EvolvedPokemonID) // Hashtable save Integer
call RemoveUnit(Pokemon) // Remove the old pokemon
After that, everything remains working the same.
So obviously it would be easier for me to import your trigger and object data(I assume), and will of course give you credit. If you don't mind continuing to help with this. I am trying to read the tutorials, but it seems it would take me a year before I'd be able to make a trigger that you just made, and of course want to finish the map sooner. Only, if I get a head start on all the terrain and then import the triggers and object data, how do I avoid the aforementioned problems occuring on the lines of your triggers(expected data missing and stuff like that...)?
Just pay attention to the Raw ID of the Abilities and Items i'm using in the Triggers. You'll get the Hang of it in no time. I'll add some comments to help you find the correct abilities/items for the triggers.
EDIT: I have just thought of a cool feature by which players may trade pokemon by dropping their pokeballs with contained pokemon and switching with that of another player(to a more complicated trading process I would not be opposed, but this seems easiest). Would it be possible then, to make a trigger for this so that when a player drops a pokeball with the intent to trade(maybe each player will type a message to make this coherent, such that red types, -trade with blue, and blue types -trade with red), and the ownership of the pokemon changes to the new owners. If you feel like it though, I am totally fine without having this. Also makes me think that the pokemon could remain neutral, not under any players control even after being caught, and when summoned from pokeball react with a certain; this would make trading easier as well. Just an idea and probably too crazy for now. This goes against what you made so far though lol, so probably we should just forget it.
This can already be done
You can give any pokeball to anyone, since the Pokemon is inside the Pokeball, doesn't matter if you drop it or anything else. I'll add a line to give ownership of unhidden unit to the triggering player.
EDIT 2: When I tried to add a hero, archmage, from unit layer to your map, and then test, I got the message pokemon summon disabled due to some error, and also when map starts, it says periodic timer off. Any idea?
The "Periodic Trigger is OFF" Message is placed there to know if the Periodic Trigger is ON or OFF, just for testing purposes. You can find it in the Periodic Trigger and delete or disable that action. I'll delete it.
If a Trigger Gets Dissabled is because there's something missing in it, like variable, or something is wrong. It just requires 1 character to be out of place in order to disable the trigger
.
<< EDIT >>
I'm working on the map to make the changes and add some more comments.
<< EDIT >>
· Created a trigger called "Evolve List" that's run in Map Initialization. What you do there is save all the Evolutions.
JASS:
function Trig_Evolve_List_Actions takes nothing returns nothing
/*
Hashtable: The Hashtable name
Poke: The Pokemon that evolves to NewPoke
Slot: The Number in the Unit-Type ID where i'll save the Unit-Type of the Evolved Unit
NewPoke: The Evolved form of the Poke
*/
// Hashtable | Poke | Slot | NewPoke
call SaveInteger(udg_PokeHash, 'hfoo' , 0 , 'hkni' ) // Footman -> Knight
call SaveInteger(udg_PokeHash, 'hkni' , 0 , 'hmtt' ) // Knight -> Siege Engine
call SaveInteger(udg_PokeHash, 'hmtt' , 0 , 'hfoo' ) // Siege Engine -> Footman
endfunction
· Made some small changes on the periodic trigger to save the Pokeball ID into the Catched Pokemon ID.
· Retained the Debug Messages untill. It's better to leave it that way untill we're really sure there are no problems. (Mainly on the Periodic Trigger)
· Gave ownership of summoned Pokemon to the User of the Pokeball.
· Made it so only 1 Pokemon can be out at the time for each player
· Made the Pokemon Evolution Trigger that automatically evolves the unit to the Evolved form you saved in the "Evolve List" trigger.
JASS:
function Trig_Pokemon_Evolution_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A003' // Ability: Evolve
endfunction
function Trig_Pokemon_Evolution_Actions takes nothing returns nothing
local unit u = GetTriggerUnit() // Triggering Unit
local real ux = GetUnitX(u)
local real uy = GetUnitY(u)
local integer UType = LoadInteger(udg_PokeHash, GetUnitTypeId(u), 0)
local unit NewPoke = CreateUnit(GetTriggerPlayer(), UType, ux, uy, bj_UNIT_FACING)
local integer uID = GetHandleId(u) // ID of the Evolving Pokemon
local integer NewPokeID = GetHandleId(NewPoke) // ID of the Evolved Pokemon
local integer PokeballID = LoadInteger(udg_PokeHash, uID, 0) // ID of the Pokeball
call SaveInteger(udg_PokeHash, NewPokeID, 0, PokeballID) // Saving the ID of the Pokeball into the NewPoke
call SaveUnitHandle(udg_PokeHash, PokeballID, 0, NewPoke) // Saving the ID of the NewPoke into the Pokeball
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Levelup\\LevelupCaster.mdl", ux, uy)) // The Special Effect
DisplayTimedTextToPlayer(GetTriggerPlayer(), 0, 0, 10, GetUnitName(u) + " |cffff0000Evolves to|r " + GetUnitName(NewPoke))
call RemoveUnit(u)
set u = null
set NewPoke = null
endfunction
//===========================================================================
function InitTrig_Pokemon_Evolution takes nothing returns nothing
set gg_trg_Pokemon_Evolution = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Pokemon_Evolution, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Pokemon_Evolution, Condition( function Trig_Pokemon_Evolution_Conditions ) )
call TriggerAddAction( gg_trg_Pokemon_Evolution, function Trig_Pokemon_Evolution_Actions )
endfunction
· Changed some icons to make it prettier
· Fixed some bugs with the abilities, since all of them were based on Channel but had the same OrderString and Base Ability ID
· Units already have the Evolve Ability for you to test. You'll have to create the triggers to give the ability to the units when they meet the requirements, or leave it there by default and make it work only when they meet the requirements.
· Don't use "Return to Pokeball" if you haven't already catched it with the Pokeball
Catch it first, then do whatever you want.
· Don't catch yourself xD