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

Problem with Tech Tree / Dependency

Status
Not open for further replies.
Hello ! I'm big fan of the World Editor but I've some problems.
I'm creating a set of new races, I wanted to add my new heroes, town halls and altars in the game constants in their respective equivalent dependency type (Equivalent dependency - Altars/Town Halls/Heroes).

1) When I train one of my heroes in the altar he his still available, like a simple unit.

2) The main buildings of my new races are not including like town halls. After a few minutes the game say "Build a town hall or you will be reveal".

I saw that in some other maps (like those of @Ujimasa Hojo ) It work correctly.

Some can help me please ?

PS: I've the last patch 1.28.5
 
Level 6
Joined
Oct 9, 2017
Messages
116
Hello ! I'm big fan of the World Editor but I've some problems.
I'm creating a set of new races, I wanted to add my new heroes, town halls and altars in the game constants in their respective equivalent dependency type (Equivalent dependency - Altars/Town Halls/Heroes).

1) When I train one of my heroes in the altar he his still available, like a simple unit.

2) The main buildings of my new races are not including like town halls. After a few minutes the game say "Build a town hall or you will be reveal".

I saw that in some other maps (like those of @Ujimasa Hojo ) It work correctly.

Some can help me please ?

PS: I've the last patch 1.28.5
Can i get a screenshot of your map or object data that you are having trouble with?
 
Sorry, It's in French, but the hero is the "Naga Royal Garde" ("Garde royal Naga" in french).

tech tree problem.png
 
Level 6
Joined
Oct 9, 2017
Messages
116
  • Player - Limit Unit for Player
or something like that.
The custom hero aren't influenced by the default Melee limiter per Hero, so you need to limit the manually for ALL players (use Player Group - All Players for this).
He wants the hero to no longer show in altars
Meaning A trigger gotta get rid of it when its used
I dont think limit A Unit will remove it.
 
It will do. I develop altered melee so I am aware of this issue.
The 3 hero limit sure works if you put the heroes in it's EQV in the gameplay constant, but not for the one hero limit.

Here's the code piece, taken from my altered melee map :
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • Set PickedPlayer = (Picked player)
      • Player - Limit training of General to 1 for PickedPlayer
      • Player - Limit training of Magician to 1 for PickedPlayer
      • Player - Limit training of Ambusher to 1 for PickedPlayer
      • Player - Limit training of Emperor to 1 for PickedPlayer
      • Player - Limit training of Scholar (Magus Agreement) to 0 for PickedPlayer
      • Player - Disable Invisible Move for PickedPlayer
      • Player - Disable Invisible Move (Elite) for PickedPlayer
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (PickedPlayer controller) Equal to User
          • (Race of PickedPlayer) Equal to Human
        • Then - Actions
          • Unit Group - Pick every unit in (Units owned by PickedPlayer) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is A structure) Equal to True
                • Then - Actions
                  • Unit - Replace (Picked unit) with a Manor using The old unit's relative life and mana
                • Else - Actions
                  • Unit - Replace (Picked unit) with a Worker using The old unit's relative life and mana
        • Else - Actions
Ignore the Scholar, it's for an upgrade.
Once you train the hero, you cannot train another, exactly like the original melee heroes. If you need a field proof, you can check Night Empire in my signature.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
If you take a look at the JASS code of the initialization actions, you can see that for every standard melee hero, training is limited to 1. This means every custom hero needs to be manually limited to 1 as well.
Furthermore the action "Create starting units for a/all player" also gives this player a free hero token, so that they do not have to pay gold or lumber for their first trained hero. If you do not want to include this action in your initialization trigger, because you want to create starting units for custom races as well, you can use this function as custom script:
call SetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_HERO_TOKENS, bj_MELEE_STARTING_HERO_TOKENS)
replace whichPlayer with the player, you want to give a free hero token. For example Player(0), if you want to give Player 1 a free hero token.
 
A new problem !!!
Now there is a problem with my Town Hall. I added my Town Hall, Spire and Citadel (Town Halls of my Blood Elf race) to the Gameplay Constant att Dependency Equivalent - Tier 1/2/3 Hall, but when I start the game and I take my race, the game say I don't have a Town Hall and I will be revealed.
Maybe someone can help me again please ?
 
Level 3
Joined
Mar 8, 2011
Messages
32
A new problem !!!
Now there is a problem with my Town Hall. I added my Town Hall, Spire and Citadel (Town Halls of my Blood Elf race) to the Gameplay Constant att Dependency Equivalent - Tier 1/2/3 Hall, but when I start the game and I take my race, the game say I don't have a Town Hall and I will be revealed.
Maybe someone can help me again please ?

Now this is just a wild shot but does your build have the classification "town hall" in the "stats - Unit classification"? if not that could be an issue that might cause this, if you copied a human town hall for these buildings this should not be the case though
 
Now this is just a wild shot but does your build have the classification "town hall" in the "stats - Unit classification"? if not that could be an issue that might cause this, if you copied a human town hall for these buildings this should not be the case though

Yes I copied the Human buildings, I already added twon hall classification, but it doesn't work :/
 
Retera write a script to fix the issue. You can search for the Altered Melee tutorial at Tutorial section or use my signature to get to 'Night Empire' map and extract the script from the map header and copy the custom script in the Melee Initialization trigger while delete the default 'Melee Game - Set Victory/Defeat Conditions' or something like that.
 
Status
Not open for further replies.
Top