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

Need help with win condition settings please

Status
Not open for further replies.
Level 1
Joined
Nov 15, 2019
Messages
2
Hey, so basically what I want to do is make it where if I use my hero to use a soul gem item on an enemy hero, it captures the enemy hero (or at least their soul) in the gem, but I want to know is there a way to set that exact action as a win condition ? Like, once you capture the enemy hero that whole enemy team or player is defeated. Is that possible, and if so, can anyone please tell me how> Because im sure it has something to do with setting the right types of triggers and actions but i cant seem to figure out which ones to use if thats the way to do it, or if its even possible. But please let me know any ideas, any info would be greatly appreciated. I've only JUST now figured out how to make waygates work properly and how to make NPC creep characters hold and drop specific items and it's been a LONG night trying to figure this stuff out, so any help would be really great, Thanks.
 
Level 1
Joined
Nov 15, 2019
Messages
2
I would also like to try to figure out a way to set it up so that I dont have to use hundreds of creeps on my map but I want to make it so that a good number of them respawn repeatedly over and over after death after a short period of time, like every 3-5 minutes or so, and also so that they always drop gold when they die everytime, not just the first or last time you kill them. Basically I want to make them farmable for gold, and have them set to respawn over and over so monster hunting can be a viable source of income. Again, any ideas would be greatly appreciated. Thanks.
 
Level 9
Joined
Sep 20, 2015
Messages
385
For the winning condition you have to trigger ti manually completely.

I would create a boolean varaible called Hero_soul_captured. And set it to an array variable so it becomes. Hero_soul_captured[array] .


Now you can use the array to make a variable for every player in the map.

Assuming all the custom spell stuff is done for the Capture soul ability, every time a hero is captured you can set the variable to true, and make defeat for the player.

  • Untitled Trigger 003
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Capture_Soul
    • Actions
      • Game - Defeat (Owner of (Target unit of ability being cast)) with the message: Defeat!
So waht this trigger do is that when the Capture soul ability is casted on a unit, the player that contol the unit loses the game.

This does not consider the boolean array i mentioned earlier. That's because that is for another way to do it.


  • Untitled Trigger 003
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
      • (Hero_soul_captured[array] Equal to True
    • Actions
      • Game - Defeat Player(array) with the message: Defeat!
In this way the game checks every 2 seconds if the boolean condition is true, when it is, the player lose the game.




For the other problem (the creep respawn and gold) you can easiliy search on this site for answers, i'm sure there are other threads that are about that same problem
 
Level 39
Joined
Feb 27, 2007
Messages
5,010
I want to make it so that a good number of them respawn repeatedly over and over after death after a short period of time, like every 3-5 minutes or so
If you are not currently and never plan to use a Unit Indexer in your map then you can follow this tutorial line-for-line: Creep Respawn (GUI). However, it will probably not work for a 3-5 minute respawn because it pulls the unit's custom value from the dead unit which would definitely have decayed and been removed by then. I would suggest using this indexer (GUI Unit Indexer 1.4.0.0) and modifying the triggers in that tutorial slightly:

  • Events
    • Game - UnitIndexEvent Becomes Equal to 3.00
  • Conditions
  • Actions
    • Set CreepRespawn_BaseTime = 180.00 //3 minutes by default
    • Custom script: set bj_wantDestroyGroup = true //cleans the unit group leak in the next line
    • Unit Group - Pick every unit in (Units owned by Neutral Hostile Matching (<your matching conditions)) and do (Actions)
      • Loop - Actions
        • Set CV = (Custom value of (Picked Unit))
        • Set CreepRespawn_Point[CV] = (Position of (Picked Unit))
        • Set CreepRespawn_Face[CV] = (Facing angle of (Picked Unit))
        • Set CreepRespawn_Type[CV] = (Unit type of (Picked Unit))
        • Set CreepRespawn_Time[CV] = CreepRespawn_BaseTime //could assign different times to different units or unit types
  • Events
    • Unit - A unit dies
  • Conditions
    • CreepRespawn_Type[(Custom Value of (Triggering Unit))] not equal to No Unit
  • Actions
    • Custom script: local unit udg_CreepRespawn_TempUnit //change to match your variable name but keep the udg_ prefix
    • Set CV = (Custom value of (Triggering Unit))
    • Unit - Create 1 CreepRespawn_Type[CV] for (Owner of (Triggering Unit)) at CreepRespawn_Point[CV] facing CreepRespawn_Face[CV] degrees
    • Set CreepRespawn_TempUnit = (Last created unit)
    • Set CV2 = (Custom value of (CreepRespawn_TempUnit))
    • Set CreepRespawn_Point[CV2] = CreepRespawn_Point[CV]
    • Set CreepRespawn_Face[CV2] = CreepRespawn_Face[CV]
    • Set CreepRespawn_Type[CV2] = CreepRespawn_Type[CV]
    • Set CreepRespawn_Time[CV2] = CreepRespawn_Time[CV]
    • Unit - Hide CreepRespawn_TempUnit
    • Wait CreepRespawn_Time[CV2] game-time seconds
    • Unit - Unhide CreepRespawn_TempUnit
    • Unit - Play CreepRespawn_TempUnit's birth animation
    • //add any special effects you want here
    • Set CreepRespawn_TempUnit = (No unit)
Here I've locally shadowed a global unit variable so it doesn't get overwritten during the wait: local udg_. The points do not leak because the data is just shifted to another index in the array and will be reused, no new data is being created.
 
Status
Not open for further replies.
Top