• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to Fix

Status
Not open for further replies.
Level 6
Joined
Sep 27, 2008
Messages
258
  • MetalGreymon WarGreymon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Digivolve(WarGreymon)
    • Actions
      • Set Caster[14] = (Triggering unit)
      • Set CasterLoc[9] = (Position of Caster[14])
      • Set Digivolve_Owner[4] = (Owner of Caster[14])
      • Set HeroLevel_Upgrade[4] = (Level of Caster[14])
      • Hashtable - Save Handle Of(Item carried by Caster[14] in slot 1) as 3 of 1 in Item_Table
      • Hashtable - Save Handle Of(Item carried by Caster[14] in slot 2) as 3 of 2 in Item_Table
      • Hashtable - Save Handle Of(Item carried by Caster[14] in slot 3) as 3 of 3 in Item_Table
      • Hashtable - Save Handle Of(Item carried by Caster[14] in slot 4) as 3 of 4 in Item_Table
      • Hashtable - Save Handle Of(Item carried by Caster[14] in slot 5) as 3 of 5 in Item_Table
      • Hashtable - Save Handle Of(Item carried by Caster[14] in slot 6) as 3 of 6 in Item_Table
      • Unit - Remove Caster[14] from the game
      • Unit - Create 1 WarGreymon for Digivolve_Owner[4] at CasterLoc[9] facing Default building facing degrees
      • Hashtable - Save Handle Of(Last created unit) as 0 of 1 in Unit_HashTable
      • Set Omnimon_Condition = (Load 0 of 1 in Unit_HashTable)
      • Set Caster[15] = (Last created unit)
      • Hero - Set Caster[15] Hero-level to HeroLevel_Upgrade[4], Hide level-up graphics
      • Hero - Give (Load 3 of 1 in Item_Table) to Caster[15]
      • Hero - Give (Load 3 of 2 in Item_Table) to Caster[15]
      • Hero - Give (Load 3 of 3 in Item_Table) to Caster[15]
      • Hero - Give (Load 3 of 4 in Item_Table) to Caster[15]
      • Hero - Give (Load 3 of 5 in Item_Table) to Caster[15]
      • Hero - Give (Load 3 of 6 in Item_Table) to Caster[15]
      • Custom script: call RemoveLocation(udg_CasterLoc[9])
  • WarGreymon Omnimon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Digivolve(Omnimon) (Item)
      • Omnimon_Condition Equal to (Load 0 of 1 in Unit_HashTable)
    • Actions
      • Set Caster[16] = (Triggering unit)
      • Set CasterLoc[10] = (Position of Caster[16])
      • Set Digivolve_Owner[5] = (Owner of Caster[16])
      • Set HeroLevel_Upgrade[5] = (Level of Caster[16])
      • Hashtable - Save Handle Of(Item carried by Caster[16] in slot 1) as 4 of 1 in Item_Table
      • Hashtable - Save Handle Of(Item carried by Caster[16] in slot 2) as 4 of 2 in Item_Table
      • Hashtable - Save Handle Of(Item carried by Caster[16] in slot 3) as 4 of 3 in Item_Table
      • Hashtable - Save Handle Of(Item carried by Caster[16] in slot 4) as 4 of 4 in Item_Table
      • Hashtable - Save Handle Of(Item carried by Caster[16] in slot 5) as 4 of 5 in Item_Table
      • Hashtable - Save Handle Of(Item carried by Caster[16] in slot 6) as 4 of 6 in Item_Table
      • Unit - Remove Caster[16] from the game
      • Unit - Create 1 Omnimon for Digivolve_Owner[5] at CasterLoc[10] facing Default building facing degrees
      • Set Caster[17] = (Last created unit)
      • Hero - Set Caster[17] Hero-level to HeroLevel_Upgrade[5], Hide level-up graphics
      • Hero - Give (Load 4 of 1 in Item_Table) to Caster[17]
      • Hero - Give (Load 4 of 2 in Item_Table) to Caster[17]
      • Hero - Give (Load 4 of 3 in Item_Table) to Caster[17]
      • Hero - Give (Load 4 of 4 in Item_Table) to Caster[17]
      • Hero - Give (Load 4 of 5 in Item_Table) to Caster[17]
      • Hero - Give (Load 4 of 6 in Item_Table) to Caster[17]
      • Custom script: call RemoveLocation(udg_CasterLoc[10])
the problem is i use the spell too active Evolve 1 which does these in it
  • Hashtable - Save Handle Of(Last created unit) as 0 of 1 in Unit_HashTable
  • Set Omnimon_Condition = (Load 0 of 1 in Unit_HashTable)
so the condition
  • Omnimon_Condition Equal to (Load 0 of 1 in Unit_HashTable)
so Evolve 2 can be used and it seams that it should work but Evolve 2 dosen't get triggered and idk why
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
You did initialize the hashtable right (I'm sorry if this sounds stupid, but some people just forget to do that and if you don't tell me, I can't possibly know).
It's strange that you use so many arrays. Useless, but shouldn't bug it.
Hashtables are also slower, you can easily use item variables to store the items, instead of storing them all in hashtables and then reloading them from it (since it happens in the same trigger).

Also, the spell is not meant to be MUI? (Then why use hashtables, really?) Because Omnimon_Condition can be different if another unit activates Digivolve.
Oh, and you just use hashtables as a 2D-array, which can be achieved by regular arrayed variables as well (and it's not even that hard). The entire hashtable-thing in both triggers just seems completely useless.


My advice: for what you're doing here, use regular arrayed variables (can be 2D as well, better than using hashtables the way you did) where you need to.
Make Caster, CasterLoc, Digivolve_Owner and HeroLevel_Upgrade all non-arrayed.
 
Level 6
Joined
Sep 27, 2008
Messages
258
Yea i created the hashtable.

It doesn't need to be mui.

I used the hashtable cuz i thought that was how i would have to do it.

If not then what is an easier way?

Why make them non-arrayed?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Yea i created the hashtable.
Oh, okay, good.

It doesn't need to be mui.

I used the hashtable cuz i thought that was how i would have to do it.
Hashtables should only be used when you want to make stuff MUI. For other things, they're just slow and can always be done in another way.

Why make them non-arrayed?
Because they don't need to be arrayed. Simple as that :p
When programming, you have to keep a few things in mind. One of them concerns the efficiency of the trigger: you want it to run as smooth (efficient) as possible.

If not then what is an easier way?
Wouldn't this work?

  • WarGreymon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Digivolve (WaryGreymon)
    • Actions
      • Set caster = (Triggering unit)
      • Set casterOwner = (Triggering player)
      • Set casterLoc = (Position of caster)
      • Set casterExperience = (Hero experience of caster)
      • Set itemType1 = (Item-type of (Item carried by caster in slot 1))
      • Set itemType2 = (Item-type of (Item carried by caster in slot 2))
      • Set itemType3 = (Item-type of (Item carried by caster in slot 3))
      • Set itemType4 = (Item-type of (Item carried by caster in slot 4))
      • Set itemType5 = (Item-type of (Item carried by caster in slot 5))
      • Set itemType6 = (Item-type of (Item carried by caster in slot 6))
      • Unit - Remove caster from the game
      • Unit - Create 1 WarGreymon for casterOwner at casterLoc facing 0.00 degrees
      • Set omnimonCondition = (Last created unit)
      • Hero - Set omnimonCondition experience to casterExperience, Hide level-up graphics
      • Hero - Create itemType1 and give it to omnimonCondition
      • Hero - Create itemType2 and give it to omnimonCondition
      • Hero - Create itemType3 and give it to omnimonCondition
      • Hero - Create itemType4 and give it to omnimonCondition
      • Hero - Create itemType5 and give it to omnimonCondition
      • Hero - Create itemType6 and give it to omnimonCondition
      • Custom script: call RemoveLocation(udg_casterLoc)
  • Omnimon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Digivolve (Omnimon)
      • (Triggering unit) Equal to omnimonCondition
    • Actions
      • Set caster = (Triggering unit)
      • Set casterOwner = (Triggering player)
      • Set casterLoc = (Position of caster)
      • Set casterExperience = (Hero experience of caster)
      • Set itemType1 = (Item-type of (Item carried by caster in slot 1))
      • Set itemType2 = (Item-type of (Item carried by caster in slot 2))
      • Set itemType3 = (Item-type of (Item carried by caster in slot 3))
      • Set itemType4 = (Item-type of (Item carried by caster in slot 4))
      • Set itemType5 = (Item-type of (Item carried by caster in slot 5))
      • Set itemType6 = (Item-type of (Item carried by caster in slot 6))
      • Unit - Remove caster from the game
      • Unit - Create 1 Omnimon for casterOwner at casterLoc facing 0.00 degrees
      • Hero - Set caster experience to casterExperience, Hide level-up graphics
      • Set caster = (Last created unit)
      • Hero - Create itemType1 and give it to caster
      • Hero - Create itemType2 and give it to caster
      • Hero - Create itemType3 and give it to caster
      • Hero - Create itemType4 and give it to caster
      • Hero - Create itemType5 and give it to caster
      • Hero - Create itemType6 and give it to caster
      • Custom script: call RemoveLocation(udg_casterLoc)
 
Level 6
Joined
Sep 27, 2008
Messages
258
Ok idk how you did the items that way so I did it this way and I optimized the array

going from MetalGreymon---->WarGreymon works
but
going from WarGreymon---->Omnimon still doesn't work

  • MetalGreymon WarGreymon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Digivolve(WarGreymon)
    • Actions
      • Set Caster[8] = (Triggering unit)
      • Set CasterLoc[6] = (Position of Caster[8])
      • Set Digivolve_Owner = (Triggering player)
      • Set HeroLevel_Upgrade = (Level of Caster[8])
      • Set Type1 = (Item carried by Caster[8] in slot 1)
      • Set Type2 = (Item carried by Caster[8] in slot 2)
      • Set Type3 = (Item carried by Caster[8] in slot 3)
      • Set Type4 = (Item carried by Caster[8] in slot 4)
      • Set Type5 = (Item carried by Caster[8] in slot 5)
      • Set Type6 = (Item carried by Caster[8] in slot 6)
      • Unit - Remove Caster[8] from the game
      • Unit - Create 1 WarGreymon for Digivolve_Owner at CasterLoc[6] facing Default building facing degrees
      • Set Omnimon_Condition = (Last created unit)
      • Hero - Set Omnimon_Condition Hero-level to HeroLevel_Upgrade, Hide level-up graphics
      • Hero - Give Type1 to Omnimon_Condition
      • Hero - Give Type2 to Omnimon_Condition
      • Hero - Give Type3 to Omnimon_Condition
      • Hero - Give Type4 to Omnimon_Condition
      • Hero - Give Type5 to Omnimon_Condition
      • Hero - Give Type6 to Omnimon_Condition
      • Custom script: call RemoveLocation(udg_CasterLoc[6])
  • WarGreymon Omnimon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Digivolve(Omnimon) (Item)
      • (Triggering unit) Equal to Omnimon_Condition
    • Actions
      • Set Caster[8] = (Triggering unit)
      • Set CasterLoc[6] = (Position of Caster[8])
      • Set Digivolve_Owner = (Triggering player)
      • Set HeroLevel_Upgrade = (Level of Caster[8])
      • Set Type1 = (Item carried by Caster[8] in slot 1)
      • Set Type2 = (Item carried by Caster[8] in slot 2)
      • Set Type3 = (Item carried by Caster[8] in slot 3)
      • Set Type4 = (Item carried by Caster[8] in slot 4)
      • Set Type5 = (Item carried by Caster[8] in slot 5)
      • Set Type6 = (Item carried by Caster[8] in slot 6)
      • Unit - Remove Caster[8] from the game
      • Unit - Create 1 Omnimon for Digivolve_Owner at CasterLoc[6] facing Default building facing degrees
      • Set Caster[8] = (Last created unit)
      • Hero - Set Caster[8] Hero-level to HeroLevel_Upgrade, Hide level-up graphics
      • Hero - Give Type1 to Caster[8]
      • Hero - Give Type2 to Caster[8]
      • Hero - Give Type3 to Caster[8]
      • Hero - Give Type4 to Caster[8]
      • Hero - Give Type5 to Caster[8]
      • Hero - Give Type6 to Caster[8]
      • Custom script: call RemoveLocation(udg_CasterLoc[6])
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Would you mind trying to debug that trigger?

Create an If-Then-Else (ITE) in the actions.
Put the first condition (ability being cast) in the conditions of the ITE. Put a game message in the actions (saying "condition 1 correct" or something).

Create a second ITE and place it below the first one.
Move the second condition (triggering unit equal to) to the conditions of the second ITE.
Put a game message in the actions.
Put a game message that shows "name of triggering unit" in the else-section as well.

If both conditions work, then you can remove the ITE's and put the conditions back where they belong.
Then you can place game messages in the entire trigger (like before you set the unit types, before you remove caster[8], before you create the unit etc).
If a game message doesn't pop up, you know exactly where something went wrong, and it's a lot easier to go from there than to stare at the trigger for hours.
 
Level 6
Joined
Sep 27, 2008
Messages
258
ok i put these cuz i think that is what you meant
  • If ((Ability being cast) Equal to Digivolve(Omnimon) (Item)) then do (Game - Display to (All players) the text: Condition 1 correct...) else do (Game - Display to (All players) the text: Condition 1 Fail )
  • If ((Triggering unit) Equal to Omnimon_Condition) then do (Game - Display to (All players) the text: Condition 2 correct...) else do (Game - Display to (All players) the text: Condition 2 Fail )
and no message comes up not a correct or a fail
 
Level 6
Joined
Sep 27, 2008
Messages
258
ok this is how i did it and nothing pops up
  • WarGreymon Omnimon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Digivolve(Omnimon) (Item)
        • Then - Actions
          • Game - Display to (All players) the text: 1 pass
        • Else - Actions
          • Game - Display to (All players) the text: 1 fail
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Omnimon_Condition
        • Then - Actions
          • Game - Display to (All players) the text: 2 pass
        • Else - Actions
          • Game - Display to (All players) the text: 2 fail
      • Set Caster[8] = (Triggering unit)
      • Set CasterLoc[6] = (Position of Caster[8])
      • Set Digivolve_Owner = (Triggering player)
      • Set HeroLevel_Upgrade = (Level of Caster[8])
      • Set Type1 = (Item carried by Caster[8] in slot 1)
      • Set Type2 = (Item carried by Caster[8] in slot 2)
      • Set Type3 = (Item carried by Caster[8] in slot 3)
      • Set Type4 = (Item carried by Caster[8] in slot 4)
      • Set Type5 = (Item carried by Caster[8] in slot 5)
      • Set Type6 = (Item carried by Caster[8] in slot 6)
      • Unit - Remove Caster[8] from the game
      • Unit - Create 1 Omnimon for Digivolve_Owner at CasterLoc[6] facing Default building facing degrees
      • Set Caster[8] = (Last created unit)
      • Hero - Set Caster[8] Hero-level to HeroLevel_Upgrade, Hide level-up graphics
      • Hero - Give Type1 to Caster[8]
      • Hero - Give Type2 to Caster[8]
      • Hero - Give Type3 to Caster[8]
      • Hero - Give Type4 to Caster[8]
      • Hero - Give Type5 to Caster[8]
      • Hero - Give Type6 to Caster[8]
      • Custom script: call RemoveLocation(udg_CasterLoc[6])
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
What? That's impossible... if-then-elses are made so they can always do stuff...
I do not know what the hell happened if that failed. Perhaps another trigger that gets in the way? Even though I wouldn't know how...

grumpy0001.jpg


Sorry, your user title just reminded me of that :(
 
Level 13
Joined
Oct 25, 2009
Messages
995
What? That's impossible... if-then-elses are made so they can always do stuff...
I do not know what the hell happened if that failed. Perhaps another trigger that gets in the way? Even though I wouldn't know how...

grumpy0001.jpg


Sorry, your user title just reminded me of that :(

I want to ask,where is the trigger?
LOL! It damn funny :)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Some parts of the map are messy.

As I've said before: don't use that many arrays! It's pointless, most of the time!
And using waits inside a loop is a bad idea as well. Using waits in spells is a bad idea in general, although most of the times the easy option and it can work.
Sometimes it is possible that leaks don't get completely removed (spell: Power up to the Very Limit, if the spell is cast twice within 10 seconds, then some effects do not get removed).
Saibaman Bomb has about the same problem, using a wait in between creating and destroying the effect.
HeroPicker leaks.


Well, you're still training... you'll eventually get better, probably :p
 
Level 6
Joined
Sep 27, 2008
Messages
258
i am just slowly putting the map together i haven't really got around to cleaning anything yet or even making sure everything is leak less

and spell: Power up to the Very Limit won't be able to cast that fast i just haven't set any of the cd's yet for any of the spells i was planing on that after i got more hero's cuz it seamed easier to balance that way
 
Status
Not open for further replies.
Top