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

Creating trigger help (replace unit)

Status
Not open for further replies.
Level 2
Joined
Oct 9, 2016
Messages
18
Okay so i know exactly what I want to happen. I have implemented a "5th race" into the game but since my computer does not like certain things, I will go back to the basics.

With players locked as Human they start with 5 peasants and town hall. However these peasants cannot do anything and Town hall is edited as "race selector"

What I want is something simple like
-Player Upgrades "race selector" to "Tree of Life"
-Replace all "Peasants" owned by player with "Wisp"
-Create "Entangled Gold Mine"

That is it.
With Undead it would slightly different
-Player Upgrades "race selector" to "Necropolis"
-Replace all "Peasants" owned by player with "Acolyte"
-Remove 2 "Acolyte"
-Create 1 "ghoul"
-Create "Haunted Gold Mine"


I might have to add location just so the game knows which gold mine to entangle or haunt (if any) at which location

I am hoping this would not be too hard to create. (If it was star craft i could make this trigger easily, i unfortunately do not have as much experience with WC3 triggers and it seems far more advanced)
 
Last edited:
Level 5
Joined
May 8, 2009
Messages
87
And i thought was the other way around with starcraft.

Ok i will try to help you but my solution is not the best and probably leaks,but its a start.

Α)first of all you need to make a dammy ability(i made it for you in the map).
Β)then add it on the "race selector" unit\building.
Γ)you will have to delete the trigger function Melee Game - Create starting units (for all players) from the Melee Initialization trigger.
Δ)and you have to place your "race selector building" in the player starting location on the map.
Ε)you also need to make this trigger

  • change race
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Upgrade To Night Elf Race
    • Actions
      • Unit - Replace (Triggering unit) with a Tree of Life using The new unit's default life and mana
      • Unit - Create 5 Wisp for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
And i say again this is not the best way to do it!!!! but only to give you the general idea how it could work!

Download the map
 

Attachments

  • race_sellector.w3x
    16.6 KB · Views: 75
Last edited:
Level 2
Joined
Oct 9, 2016
Messages
18
And i thought was the other way around with starcraft.

Ok i will try to help you but my solution is not the best and probably leaks,but its a start.

Α)first of all you need to make a dammy ability(i made it for you in the map).
Β)then add it on the "race selector" unit\building.
Γ)you will have to delete the trigger function Melee Game - Create starting units (for all players) from the Melee Initialization trigger.
Δ)and you have to place your "race selector building" in the player starting location on the map.
Ε)you also need to make this trigger

  • change race
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Upgrade To Night Elf Race
    • Actions
      • Unit - Replace (Triggering unit) with a Tree of Life using The new unit's default life and mana
      • Unit - Create 5 Wisp for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
And i say again this is not the best way to do it!!!! but only to give you the general idea how it could work!

Download the map
Just to clarify, would i add
Unit - create 1 entangled gold mine for (triggering player) at ((triggering player) start location) ...
or am going to have to do that differently to give the UD and NE players their mines?



And i was referring to SC1.


Great it works (kinda) if I was not using a pre-existing map may work even better. issue however now is the fact that the mine Becomes empty (0 gold) I guess i may be able to find a way to benefit UD and NE by giving them a gold bonus since they will not be able to start mining right away (however much it costs plus the estimated gold they would lose during the build time)
 
Last edited:
Level 5
Joined
May 8, 2009
Messages
87
Try this trigger instead of the other one.

  • change race
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Upgrade To Night Elf Race
    • Actions
      • Unit - Replace (Triggering unit) with a Tree of Life using The new unit's default life and mana
      • Unit - Create 5 Wisp for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
      • Unit - Create 1 Entangled Gold Mine for (Triggering player) at ((Position of (Triggering unit)) offset by (50.00, 50.00)) facing Default building facing degrees
      • Neutral Building - Add 12500 gold to (Last created unit)
With this you spawn an entangled gold mine,and you give it 12500 gold.
same goes for the undead,you need to add the haunted gold mine for them.
 
Level 2
Joined
Oct 9, 2016
Messages
18
Try this trigger instead of the other one.

  • change race
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Upgrade To Night Elf Race
    • Actions
      • Unit - Replace (Triggering unit) with a Tree of Life using The new unit's default life and mana
      • Unit - Create 5 Wisp for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
      • Unit - Create 1 Entangled Gold Mine for (Triggering player) at ((Position of (Triggering unit)) offset by (50.00, 50.00)) facing Default building facing degrees
      • Neutral Building - Add 12500 gold to (Last created unit)
With this you spawn an entangled gold mine,and you give it 12500 gold.
same goes for the undead,you need to add the haunted gold mine for them.
hmm, well then maybe i should do that for each player, I think i should make the map though, I want one with waterways for Naga movement, but not completely trump other race movements (I have been using hurricane Isle, but that is nit what I want. Too restrictive, and with zepplins it removes the naga's racial benefit anyway.)

do you have a suggestion for a map (that supports 8 players)
 
Level 5
Joined
May 8, 2009
Messages
87
not for each player,but you need to do it for each race you planing to add.this trigger for example works for the night elfs,no matter the player.
if you want to add the undead just add a new ability and change the units you want to spawn.

i will suggest to finish up your triggers first and then work on the terrain,so you won't get frustrated by the workload of the terrain edit and focus more on the gameplay mechanics.and if you are planing to release your map it will be best to make a unique terrain and not from the ingame maps.players will like more a new map rather an old one,in this way you also free your self from the maps restrictive zones that may have.
 
Last edited:
Level 2
Joined
Oct 9, 2016
Messages
18
not for each player,but you need to do it for each race you planing to add.this trigger for example works for the night elfs,no matter the player.
if you want to add the undead just add a new ability and change the units you want to spawn.

i will suggest to finish up your triggers first and then work on the terrain,so you won't get frustrated by the workload of the terrain edit and focus more on the gameplay mechanics.and if you are planing to release your map it will be best to make a unique terrain and not from the ingame maps.players will like more a new map rather an old one,in this way you also free your self from the maps restrictive zones that may have.
Guess I am gonna have to watch some map making tutorials (I made this map years ago before my computer caught fire and I lost everything (And I don;t even talk to the people who helped me on the maps never mind asking if they still have the maps) But all i did was make teh naga race, others made the triggers and we had a few guys who were mapmakers in SC and worked on the WC maps we played on Had between 25-30 maps, went form 1v1-10 man FFA (Which could also be 5v5, or 4v4, we havd 3v3v3 maps, 2v2v2v2 maps, basically we had multiple maps for everything. Some maps favored naga while some did not.)
 
Level 2
Joined
Oct 9, 2016
Messages
18
is there a way to keep the triggers as they are but have some build a mine above them and others below? I think that if all mines are below some player may have a natural defense using the mine as part of a wall off. (Or vice versa with all above)
 
Level 5
Joined
May 8, 2009
Messages
87
Try this

  • change race
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Upgrade To Night Elf Race
    • Actions
      • Set Random_number = (Random integer number between 1 and 4)
      • Unit - Replace (Triggering unit) with a Tree of Life using The new unit's default life and mana
      • Unit - Create 5 Wisp for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Random_number Equal to 1
        • Then - Actions
          • Unit - Create 1 Entangled Gold Mine for (Triggering player) at ((Position of (Triggering unit)) offset by 600.00 towards 90.00 degrees) facing Default building facing degrees
          • Neutral Building - Add 12500 gold to (Last created unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Random_number Equal to 2
            • Then - Actions
              • Unit - Create 1 Entangled Gold Mine for (Triggering player) at ((Position of (Triggering unit)) offset by 600.00 towards 0.00 degrees) facing Default building facing degrees
              • Neutral Building - Add 12500 gold to (Last created unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Random_number Equal to 3
                • Then - Actions
                  • Unit - Create 1 Entangled Gold Mine for (Triggering player) at ((Position of (Triggering unit)) offset by 600.00 towards 180.00 degrees) facing Default building facing degrees
                  • Neutral Building - Add 12500 gold to (Last created unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Random_number Equal to 4
                    • Then - Actions
                      • Unit - Create 1 Entangled Gold Mine for (Triggering player) at ((Position of (Triggering unit)) offset by 600.00 towards 270.00 degrees) facing Default building facing degrees
                      • Neutral Building - Add 12500 gold to (Last created unit)
                    • Else - Actions
                      • Do nothing
You also need to make an integer variable,
if you don't know how, read this tutorial.

But Remember my triggers are probably leak!!!
I Strongly advise you to read this tutorial and also this one about leaks.
 
Last edited:
Level 2
Joined
Oct 9, 2016
Messages
18
THAT, is a BIG trigger.

I am really wishing my team was still with me. They knew how to do this stuff. They knew how to work abilities and trigger sand we had map makers. I was just the guy with the vision. If i had a hero in mind, they would make the abilities. If I had a unit in mind they would make the unit. If we could not find the model on line or in game, then we would look at other options.

They also agreed with me that Changing the far seer spirit animals into other things than just wolves was fun. Some maps would be pigs others would be wolves, No change in what the did, just aesthetic changes.
 
Level 8
Joined
Jan 28, 2016
Messages
486

Wouldn't there still be a chance for the entangled gold mine to spawn in a location you wouldn't want?

If the start locations of each player are at fixed positions in the map (placed in the World Editor manually) and are always the same, then couldn't you make it so that each mine also spawns in the same specific position? For example: Player 1 starts in the top-right corner, therefore create the mine even closer to the corner to avoid blocking the entrance.

All of this depends on the layout of your map and if the start locations of each player are predetermined.
 
Level 2
Joined
Oct 9, 2016
Messages
18
Wouldn't there still be a chance for the entangled gold mine to spawn in a location you wouldn't want?

If the start locations of each player are at fixed positions in the map (placed in the World Editor manually) and are always the same, then couldn't you make it so that each mine also spawns in the same specific position? For example: Player 1 starts in the top-right corner, therefore create the mine even closer to the corner to avoid blocking the entrance.

All of this depends on the layout of your map and if the start locations of each player are predetermined.
i noticed that as well. I am thinking I will have to make locations and have something like
"Player one has "tree of life" at Location 1. Create "Entangled gold mine" at Location 2"
Do the same for each player.

The issue is that since it is not just a normal melee map and i am instead using map settings, start positions will be predetermined. (i am just hoping i can make it so it can be FFA or 1v1 or 2v2 or 3v3 or 4v4 or 2v2v2 or 2v2v2v2 without having to make 7 upload of the same map. (if not I am kinda screwed)

I'm hoping that if it is a 4v4 map but players are doing a 3v3, that the race selector will only show up for the players in game and not have 1 extra for each team.
 
Level 5
Joined
May 8, 2009
Messages
87
Wouldn't there still be a chance for the entangled gold mine to spawn in a location you wouldn't want?

True but i tried to make an easy trigger for him to avoid going to such detail ex. per player triggers.and i am not saying that i am some kind of trigger master, quite the opposite i am a noob. but since he said he finds it difficult to make it, i thought "what the heck lets help the man". so yea i agree with you. (i am not trying to be ironic,its just that my english sucks)

THAT, is a BIG trigger.

I know man but if you are going to do your project you must know that this is nothing compared to what other maps have in side them,imagine walls of triggers even for the simplest things. i have dyslexia and believe me this is frustrating,to the point i give up all the time.but this is something you need to conquer in order to continue.
 
Level 2
Joined
Oct 9, 2016
Messages
18
I know man but if you are going to do your project you must know that this is nothing compared to what other maps have in side them,imagine walls of triggers even for the simplest things. i have dyslexia and believe me this is frustrating,to the point i give up all the time.but this is something you need to conquer in order to continue.
Yea yea I know. I mean DotA is a prime example of walls of triggers. Humans vs Orcs (which was a DotA copy where you could save your character) probably had even more triggers. Battleships Pro, again, another big one.

This one is basic in comparison. As the only trigger I am working on is race selection and getting the units or it along with a gold mine. As stated though, I will probably have to lock players in place and make a trigger for each race and each player. (bringing it up to a whopping 40 triggers. (80 if i can't put both gold mine and units in the same triggers now that i want the gold mine to spawn in certain areas.))

The rest of the map is simply making Naga a playable race. Workers, Units, Heros... heroes will be the tough part. While I do have Sea Witch, that is only 1/X heroes (Aiming for 6/race along with a special flying dragon hero purchased at the dragon roost at tier 3)
Also giving orc Goblin tinker, giving UD Dark ranger, and not sure if I will just reskin some of the others and hand them to the other races, or if I will build some from scratch. Tinker are Dark ranger are staying simply due to being my favorite heroes.
 
Status
Not open for further replies.
Top