• 🏆 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!

Gameconstants and Melee Triggers

Status
Not open for further replies.
Level 2
Joined
Jul 16, 2009
Messages
18
Hello all, here to bug you with another one of my questions.

Seems I'm having troubles as to getting the game to accept the fact that my custom added extra townhalls aren't seens as real townhalls, because the melee trigger "Melee - Enforce Victory/Defeat conditons" doesn't read or accept the new gameconstants I've added.

This same problem is making my custom heroes not to be recognised as real heroes, because "Melee - Limit heroes to one per Hero-type". Meaning my custom heroes are spammable as well.

What can I do about this? Do I have to remake the entire triggers in custom triggers? :confused:
 
Level 12
Joined
Dec 10, 2008
Messages
850
First, if you arn't using the normal townhalls, you can change those base ones by changing the model and such. If that doesn't work, I can help with the custom victory/defeat conditions that you'd need.

For the hero ones, theres a special action that lets you limit the training of units and buildings. You could also use the unit/building requirment thing. When the hero is trained, then dummy unit is removed and then that hero cant be trained again. But that probably wont be ideal for you. Heres the limit action.

  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • <Your init actions>
        • Player Group - Pick every player in (All players) and do (Actions)
          • Loop - Actions
            • Player - Limit training of Footman to 1 for (Picked player)
If you have any questions, just ask
 
Level 2
Joined
Jul 16, 2009
Messages
18
First, if you arn't using the normal townhalls, you can change those base ones by changing the model and such.
Sadly it's not that easy. I use the normal ones as well as custom ones. The custom ones are the ones with the problems.

If that doesn't work, I can help with the custom victory/defeat conditions that you'd need.
I'm glad you already helped me so far. That trigger you just gave me seems precisely what I need, only one thing I'm afraid of is that I have at this moment atleast 16 custom heroes planned, so that'd mean they'd all need that same trigger. Wouldn't 16 simular triggers be a memory hog?
(I don't know much about triggers but I guess that can cause memory leaks, yes?)
 
Level 12
Joined
Dec 10, 2008
Messages
850
No, just Copy and paste that line under the player group one, and change the unit to your hero, and there ya go, it will limit it . Just be sure to check that its under the player loop. And you should put EVERYTHING that you plan on having at your map initstaliation in the same trigger, just so you dont have tons and tons of map init triggers.
 
Level 2
Joined
Jul 16, 2009
Messages
18
No, just Copy and paste that line under the player group one, and change the unit to your hero, and there ya go, it will limit it . Just be sure to check that its under the player loop. And you should put EVERYTHING that you plan on having at your map initstaliation in the same trigger, just so you dont have tons and tons of map init triggers.

Alright, so just paste the different heroes under the loop. That should be doable I guess. :thumbs_up:

Now about this: I also have a problem that my custom heroes need custom triggers to get 1 free Town Portal scroll if they are the first hero.
  • Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)

And this still leave the other problem:
  • Melee Game - Enforce victory/defeat conditions (for all players)
This trigger causes a player:
-to be revealed when he doesn't have a town hall.
-lose if he has no buildings.
-win if enemy has no buildings.

How would I make all these into custom triggers?
 
Level 12
Joined
Dec 10, 2008
Messages
850
Ok, I'll edit this post a s I finish them. Heres the scroll one. The condition is the Or (mutiple conditions) thing. Copy and paste them and change the heros. You will need a boolean array called SCROLLBOOL, an item variable, called TempItem, and a point variable called TempLoc. Add the Init trigger stuff to the player group one above, but not in the loop.

  • Hero
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Trained unit)) Equal to Paladin
          • (Unit-type of (Trained unit)) Equal to Archmage
          • (Unit-type of (Trained unit)) Equal to Mountain King
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SCROLLBOOL[(Player number of (Owner of (Trained unit)))] Equal to False
        • Then - Actions
          • Set TempLoc = (Position of (Trained unit))
          • Item - Create Scroll of Town Portal at TempLoc
          • Set TempItem = (Last created item)
          • Unit - Order (Trained unit) to Right-Click TempItem
          • Set SCROLLBOOL[(Player number of (Owner of (Trained unit)))] = True
        • Else - Actions
The init trigger..

  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set SCROLLBOOL[0] = False
      • Set SCROLLBOOL[1] = False
      • Set SCROLLBOOL[2] = False
      • Set SCROLLBOOL[3] = False
      • Set SCROLLBOOL[4] = False
      • Set SCROLLBOOL[5] = False
      • Set SCROLLBOOL[6] = False
      • Set SCROLLBOOL[7] = False
      • Set SCROLLBOOL[8] = False
      • Set SCROLLBOOL[9] = False
      • Set SCROLLBOOL[10] = False
      • Set SCROLLBOOL[11] = False
Edit: I'll finish the others tomorrow and post them, too tired ATM
 
Last edited:
Status
Not open for further replies.
Top