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

[General] A couple of problems from a beginner

Status
Not open for further replies.
Level 3
Joined
May 19, 2009
Messages
38
Hello, I played Warcraft 3 for many years but just started making my own maps a couple of days ago.

I encountered a few basic problems and can't solve them myself. Can anyone lend me a hand?

1. (Solved)I want to make Necropolis able to produce corpses after an upgrade. So I added a 'Create Corpse' ability to it, with a prerequisite linking to a technology. But during my test, the Necropolis always has the ability, whether or not I research that required technology. I even tried to disable 'create corpse' ability from 'Scenario - Upgrade Properties' and that didn't work either.

2. I want to add a button to the Necropolis. When I click the button, it will display a full page of items for sale. What should I do?

3. (Solved) I used customized Necropolis (replacing the original one). When I upgrade it to Hall of the Dead, I can't train a second hero. It says a Hall of the Dead is required. I believe I already set the Gameplay Constants ('Techtree - Dependency Equivalents Tier 2 Hall) linking to it.

4. (Solved) It seems that I can still train the same hero twice since they don't disappear after I trained him. How to restrict on that?

5. (Solved) Hall of the Dead does not attack, even if it has a damage panel.

6. (Solved) First, I need a rather clean Necropolis, shown in the pic below.
1.png

After researching graveyard technology, I want these 4 upgrades shown on the command card.
2.png

I tried to first disable these upgrades in 'Scenario - Upgrade Properties'. While I was trying to enable them in Trigger Editor, I didn't find any options related to it. Is there any alternative method?

That's all the problems I have so far. I have uploaded my map here. Thanks anyone in advance!
 

Attachments

  • Master.w3x
    22.9 KB · Views: 51
Last edited:
Problem 3 is because you don't modify the respective hero's requirement. Make sure it points to the right Halls of the Dead. Use Ctrl+D to check if the ID is correct.

Problem 4 is solved with Player - Limit Training of Unit in triggers.

Problem 6 is in the Player stuff, it's max tech upgrade or something like that.
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
1. I want to make Necropolis able to produce corpses after an upgrade. So I added a 'Create Corpse' ability to it, with a prerequisite linking to a technology. But during my test, the Necropolis always has the ability, whether or not I research that required technology. I even tried to disable 'create corpse' ability from 'Scenario - Upgrade Properties' and that didn't work either.
Use this method; Remove create corpse from your necropolis (base and upgraded version). Create this trigger.
  • Graveyard
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • (Researched tech-type) Equal to Graveyard (Tech)
    • Actions
      • -------- False by Default, True when a player has upgraded the tech --------
      • Set GraveyardTech[(Player number of (Triggering player))] = True
      • -------- Give our already built-necropolis the Create Corpse ability --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to (Triggering player)
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of (Picked unit)) Equal to Necropolis (AllTech)
                  • (Unit-type of (Picked unit)) Equal to Halls of the Dead (AllTech)
                  • (Unit-type of (Picked unit)) Equal to Black Citadel (AllTech)
            • Then - Actions
              • -------- Give the ability --------
              • Unit - Add Create Corpse (Tech) to (Picked unit)
            • Else - Actions
GraveyardTech will be used as a flag to determine whether a player has upgraded the tech or not. After that we immediately give the Create Corpse ability to the necropolis that we already built previously. Next, create another trigger to make sure every necropolis we will build later is getting the Create Corpse ability.
  • Graveyard2
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Necropolis (AllTech)
          • (Unit-type of (Triggering unit)) Equal to Halls of the Dead (AllTech)
          • (Unit-type of (Triggering unit)) Equal to Black Citadel (AllTech)
      • GraveyardTech[(Player number of (Triggering player))] Equal to True
    • Actions
      • Unit - Add Create Corpse (Tech) to (Triggering unit)
2. I want to add a button to the Necropolis. When I click the button, it will display a full page of items for sale. What should I do?
You mean like spellbook?

3. I used customized Necropolis (replacing the original one). When I upgrade it to Hall of the Dead, I can't train a second hero. It says a Hall of the Dead is required. I believe I already set the Gameplay Constants ('Techtree - Dependency Equivalents Tier 2 Hall) linking to it.
You should modify the Techtree Requirements in your heroes as well.

4. It seems that I can still train the same hero twice since they don't disappear after I trained him. How to restrict on that?
  • HeroesLimit
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Trained unit)) Equal to Death Knight
          • (Unit-type of (Trained unit)) Equal to Lich
          • (Unit-type of (Trained unit)) Equal to Dreadlord
          • (Unit-type of (Trained unit)) Equal to Crypt Lord
    • Actions
      • Player - Limit training of (Unit-type of (Trained unit)) to 0 for (Triggering player)
5. Hall of the Dead does not attack, even if it has a damage panel.
It does, try create an enemy unit nearby, it will attack. The attack button doesn't show up because "Combat - Attack 1 - Show UI" is False in object editor.
 
Level 3
Joined
May 19, 2009
Messages
38
Many thanks to both of you! I'm almost there.

You mean like spellbook?
Yeah like a spellbook. You click it and all buttons disappear, items buttons appear for sale.

You should modify the Techtree Requirements in your heroes as well.
OK I modified it and linked it to the new hall of the dead. But when I test the map, I could train heroes without any requirement. Am I doing this correctly?
Capture.PNG
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
1. i guess that spell works differently ull have to trigger adding it to the buildings if u have the research

2. you will have to use a dummy unit that the shop is that is placed under the building when its spawned. and a dummy ability that will select this dummy shop unit when casted

3. somthing is wrong in the techtree in your object editor. make sure the heros have them added

4.
  • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
5. i believe the hall of the deads attack is different and will attack if enemy nearby units are nearby.

6. im not sure what ur asking
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
Many thanks to both of you! I'm almost there.


Yeah like a spellbook. You click it and all buttons disappear, items buttons appear for sale.


OK I modified it and linked it to the new hall of the dead. But when I test the map, I could train heroes without any requirement. Am I doing this correctly?
View attachment 293111
You are doing it correctly. You forgot to add those heroes to your Altar of Darkness.

Here's for your reference. I modified your map a bit.
 

Attachments

  • Master.w3x
    24.8 KB · Views: 32
Level 15
Joined
Jul 9, 2008
Messages
1,552
@millzy that won't work with custom heroes. You might be interested in seeing it's behind the scene code :p

alright then haha id rather not see the bj code lol. so it only appeals to the default heros. good to know.


this is the trigger your after
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • Player - Limit training of Heroes to 1 for (Picked player)
 
Level 3
Joined
May 19, 2009
Messages
38
I noticed that you all have a better view of the trigger editor than me. How to expand it?
expand.PNG
 
Last edited:
Level 3
Joined
May 19, 2009
Messages
38
alright then haha id rather not see the bj code lol. so it only appeals to the default heros. good to know.


this is the trigger your after

Thank you for the reply. My trigger looks like this but I can still train any number of heroes and they don't require high-level town halls. Is that because I am training customized heroes? Thanks!
hero.PNG
 
Level 3
Joined
May 19, 2009
Messages
38
You are doing it correctly. You forgot to add those heroes to your Altar of Darkness.

Here's for your reference. I modified your map a bit.

Thanks for the edit. Your modified map works perfectly. But I wonder if it's possible for customized heroes? I found a lot of problems with customized heroes. Thanks!
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
I'm not sure if this line works for custom heroes
  • Player - Limit training of (Unit-type of (Trained unit)) to 0 for (Triggering player)
but I think it does (well, it should). In case it doesn't, replace it with this one.
  • Player - Make (Unit-type of (Trained unit)) Unavailable for training/construction by (Triggering player)
I currently have no time to do some tests so I leave it to you.
 
Level 3
Joined
May 19, 2009
Messages
38
I'm not sure if this line works for custom heroes
  • Player - Limit training of (Unit-type of (Trained unit)) to 0 for (Triggering player)
but I think it does (well, it should). In case it doesn't, replace it with this one.
  • Player - Make (Unit-type of (Trained unit)) Unavailable for training/construction by (Triggering player)
I currently have no time to do some tests so I leave it to you.

Thanks for the suggestion.

I made a trigger that looks like this. And I tried both methods. Unfortunately neither is working. Is there anything I did wrong?

hero.PNG
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
Use the "Unit - A unit Finished training a unit" instead because I think it will bug out when you cancel the training.

Have you put your custom heroes in the gameplay constants?
gameplay constants.png


Edit:
I did another testing. It works with this event.
  • Unit - A unit Finished training a unit
Don't forget to change the gameplay constants. :)
 
Last edited:
Level 3
Joined
May 19, 2009
Messages
38
Use the "Unit - A unit Finished training a unit" instead because I think it will bug out when you cancel the training.

Have you put your custom heroes in the gameplay constants?
View attachment 293200

Yes, I did add them to the gameplay constants.
The reason why I disable heroes from training as soon as the training began is that if I have 2 altars, I can train the same hero simultaneously. I also added a trigger for cancelling. I think that should prevent bugs.

I have uploaded my current map. You can find more details there if you have some spare time.
hero2.PNG
 

Attachments

  • Master.w3x
    24.8 KB · Views: 38
Level 22
Joined
Aug 27, 2013
Messages
3,973
Check out my last post, I edited it.
It'll work with
  • Unit - A unit Finished training a unit
because as soon as you train your hero, it won't be able to be trained in any other altar. The very reason you added them to gameplay constants as well. So it definitely won't cause any bug.

Here's a test map in case you're not sure.
Both actions work as well, just choose which one you want.
  • Player - Make (Unit-type of (Trained unit)) Unavailable for training/construction by (Triggering player)
  • Player - Limit training of (Unit-type of (Trained unit)) to 0 for (Triggering player)
 

Attachments

  • Master.w3x
    25.9 KB · Views: 34
Level 3
Joined
May 19, 2009
Messages
38
Check out my last post, I edited it.
It'll work with
  • Unit - A unit Finished training a unit
because as soon as you train your hero, it won't be able to be trained in any other altar. The very reason you added them to gameplay constants as well. So it definitely won't cause any bug.

Here's a test map in case you're not sure.
Both actions work as well, just choose which one you want.
  • Player - Make (Unit-type of (Trained unit)) Unavailable for training/construction by (Triggering player)
  • Player - Limit training of (Unit-type of (Trained unit)) to 0 for (Triggering player)

Well, I changed my trigger to 'a unit finished training a unit'. It did work. I can't train that hero anymore.

But just as I suspected, If I have 2 altars and a L2 Base, I can train the same heroes at the same time. That's a major flaw.

But anyway, problem solved. Thanks for that:)
hero3.png
 
Level 3
Joined
May 19, 2009
Messages
38
What, I couldn't train the same hero at the same time, though. Have you tried my test map?

This time I tried your test map. Same result.

The key is that you need to upgrade the necropolis, build a ziggurat and 2 altars before you can train 2 heroes at the same time.
hero4.png
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
This time I tried your test map. Same result.

The key is that you need to upgrade the necropolis, build a ziggurat and 2 altars before you can train 2 heroes at the same time.
View attachment 293209
Oh right. My bad, I didn't think to that extent. Hmm, I'll see if I can find a workaround for this.

Edit:
This is the workaround I came up with, might not be the best but at least work for now.
  • Heroes
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Limit training of Lich (Tech) to 1 for (Picked player)
          • Player - Limit training of Death Knight (Tech) to 1 for (Picked player)
          • Player - Limit training of Dreadlord (Tech) to 1 for (Picked player)
          • Player - Limit training of Crypt Lord (Tech) to 1 for (Picked player)
 
Level 3
Joined
May 19, 2009
Messages
38
Oh right. My bad, I didn't think to that extent. Hmm, I'll see if I can find a workaround for this.

Edit:
This is the workaround I came up with, might not be the best but at least work for now.
  • Heroes
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Limit training of Lich (Tech) to 1 for (Picked player)
          • Player - Limit training of Death Knight (Tech) to 1 for (Picked player)
          • Player - Limit training of Dreadlord (Tech) to 1 for (Picked player)
          • Player - Limit training of Crypt Lord (Tech) to 1 for (Picked player)

Wow that did work! Good Job!! Many thanks!!!
 
6. Use this action at map init :
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • Player - Set the max research level of Unholy Strength to 0 for (Picked player)
Put all upgrades in the loop. When graveyard research is finished, run another trigger (use Unit - Unit finishes research event and check the research tech-type) and enable all the upgrade for the specific player (use Triggering Player)
 
Level 3
Joined
May 19, 2009
Messages
38
6. Use this action at map init :
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • Player - Set the max research level of Unholy Strength to 0 for (Picked player)
Put all upgrades in the loop. When graveyard research is finished, run another trigger (use Unit - Unit finishes research event and check the research tech-type) and enable all the upgrade for the specific player (use Triggering Player)

This works! Many thanks!!
 
Level 3
Joined
May 19, 2009
Messages
38
Use this method; Remove create corpse from your necropolis (base and upgraded version). Create this trigger.
  • Graveyard
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • (Researched tech-type) Equal to Graveyard (Tech)
    • Actions
      • -------- False by Default, True when a player has upgraded the tech --------
      • Set GraveyardTech[(Player number of (Triggering player))] = True
      • -------- Give our already built-necropolis the Create Corpse ability --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to (Triggering player)
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of (Picked unit)) Equal to Necropolis (AllTech)
                  • (Unit-type of (Picked unit)) Equal to Halls of the Dead (AllTech)
                  • (Unit-type of (Picked unit)) Equal to Black Citadel (AllTech)
            • Then - Actions
              • -------- Give the ability --------
              • Unit - Add Create Corpse (Tech) to (Picked unit)
            • Else - Actions
GraveyardTech will be used as a flag to determine whether a player has upgraded the tech or not. After that we immediately give the Create Corpse ability to the necropolis that we already built previously. Next, create another trigger to make sure every necropolis we will build later is getting the Create Corpse ability.
  • Graveyard2
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Necropolis (AllTech)
          • (Unit-type of (Triggering unit)) Equal to Halls of the Dead (AllTech)
          • (Unit-type of (Triggering unit)) Equal to Black Citadel (AllTech)
      • GraveyardTech[(Player number of (Triggering player))] Equal to True
    • Actions
      • Unit - Add Create Corpse (Tech) to (Triggering unit)

You mean like spellbook?


You should modify the Techtree Requirements in your heroes as well.


  • HeroesLimit
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Trained unit)) Equal to Death Knight
          • (Unit-type of (Trained unit)) Equal to Lich
          • (Unit-type of (Trained unit)) Equal to Dreadlord
          • (Unit-type of (Trained unit)) Equal to Crypt Lord
    • Actions
      • Player - Limit training of (Unit-type of (Trained unit)) to 0 for (Triggering player)

It does, try create an enemy unit nearby, it will attack. The attack button doesn't show up because "Combat - Attack 1 - Show UI" is False in object editor.

May I ask how you expand the triggers? Mine looks like a total mess especially when IF or OR are used.
expand-png.293176
 
Status
Not open for further replies.
Top