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

Blight with no blight

Status
Not open for further replies.
Level 2
Joined
Apr 18, 2019
Messages
8
Hello .

I am terrible in writing triggers.

I am trying to build my own campaign with a custom race,
part of the mechanic I want them to have is that they need a crystal generator near them to be active much like Protos in starcraft 2 or even undead in warcraft 3 but instead of needing blight they need an arcane crystal (Pylon ).

I searched the forums and couldn't find something besides the triger for making the buildings need lava instead of blight.

can anyone help me ??

much appreciated for your help thank you
Asterianos
 
Level 9
Joined
Jul 30, 2018
Messages
445
Well, you could basically just check every time a player with said race starts constructing a building if there is this pylon structure nearby.

Something like this:
  • Pylon Requirement
    • Events
      • Unit - A unit Begins construction
    • Conditions
    • Actions
      • Set TempGroup = (Units within 512.00 of TempPoint matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to [Pylon])))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup) Equal to 0
        • Then - Actions
          • Unit - Remove (Constructing structure) from the game
          • Game - Display to (All players) the text: Pylon nearby required
        • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup)
 
Level 2
Joined
Apr 18, 2019
Messages
8
Well, you could basically just check every time a player with said race starts constructing a building if there is this pylon structure nearby.

Something like this:
  • base.gif
    Pylon Requirement
    • joinminus.gif
      events.gif
      Events
      • line.gif
        joinbottom.gif
        unit.gif
        Unit - A unit Begins construction
    • join.gif
      cond.gif
      Conditions
    • joinbottomminus.gif
      actions.gif
      Actions
      • empty.gif
        join.gif
        set.gif
        Set TempGroup = (Units within 512.00 of TempPoint matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to [Pylon])))
      • empty.gif
        joinminus.gif
        if.gif
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • empty.gif
          line.gif
          joinminus.gif
          cond.gif
          If - Conditions
          • empty.gif
            line.gif
            line.gif
            joinbottom.gif
            if.gif
            (Number of units in TempGroup) Equal to 0
        • empty.gif
          line.gif
          joinminus.gif
          actions.gif
          Then - Actions
          • empty.gif
            line.gif
            line.gif
            join.gif
            unit.gif
            Unit - Remove (Constructing structure) from the game
          • empty.gif
            line.gif
            line.gif
            joinbottom.gif
            game.gif
            Game - Display to (All players) the text: Pylon nearby required
        • empty.gif
          line.gif
          joinbottom.gif
          actions.gif
          Else - Actions
      • empty.gif
        joinbottom.gif
        page.gif
        Custom script: call DestroyGroup(udg_TempGroup)


Hello Sabe, thank you so much for your input, I tried to use this trigger but I was unable to make it work , how can I get the action "set tempGroup=" in the trigger? I was looking for it and I couldn't find it.
Thank you for your response
 
Level 9
Joined
Jul 30, 2018
Messages
445
You have to first make a variable of type Unit Group called TempGroup. Then in the trigger editor you use the Set Variable function found under General category.

If you don't know how to make variables, check out this tutorial: Variables
 
Level 1
Joined
Aug 14, 2007
Messages
7
You could give the "Pylons" an Aura and whenever a building is ordered to do something check if it has the fitting buff.
If yes - you do not need to change anything
If not - just order the bulding to stop and create a Error Message for the owner.

:)
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
You could give the "Pylons" an Aura and whenever a building is ordered to do something check if it has the fitting buff.
If yes - you do not need to change anything
If not - just order the bulding to stop and create a Error Message for the owner.
Couple reasons this won't work:
  1. Buffs from auras linger on units once they leave the aura radius and the refresh rate is actually pretty slow.
  2. A unit can be ordered to build something far away while standing near a pylon to get the buff, then walk to that far away location and begin construction.
  3. If point 2. is overcome by checking if the builder has the buff while starting the build process (rather than when ordered), then the issue becomes that units will not be stopped from building until they reach the location and attempt to build. The units should be denied when the order is issued otherwise the player may think the build order went through when in actuality it is cancelled based on range to pylons.
  4. Having an additional buff always active on the UI creates visual clutter and may make it hard to tell which important buffs are actually affecting your units at any given time.
 
Level 1
Joined
Aug 14, 2007
Messages
7
Couple reasons this won't work:
  1. Buffs from auras linger on units once they leave the aura radius and the refresh rate is actually pretty slow.
  2. A unit can be ordered to build something far away while standing near a pylon to get the buff, then walk to that far away location and begin construction.
  3. If point 2. is overcome by checking if the builder has the buff while starting the build process (rather than when ordered), then the issue becomes that units will not be stopped from building until they reach the location and attempt to build. The units should be denied when the order is issued otherwise the player may think the build order went through when in actuality it is cancelled based on range to pylons.
  4. Having an additional buff always active on the UI creates visual clutter and may make it hard to tell which important buffs are actually affecting your units at any given time.
If i understood @Asterianos correctly, he wants the mechanic to work like the Protoss Pylons.
This means, that most of your points do not matter:

1. does not matter, since the buff would be on the buldings themselves (not on the building unit). Buildings generally do not move :D (the buff would still linger if the "Pylon" is destroyed thoug. This can be circumvented by removing the buff from buildings around a destroyed Pylon - if there is another Pylon, the buff will be reapplied be its Aura instantly)

2./3. This is (or would be, if i understood correctly) fine, since Protoss CAN build outside of the Energy field. The building is just not operable until a Pylon is erected nearby. This would work via the buff.

4. Ok I see your point there. But honestly i do not think it would matter much, if the buff is on the buildings instead of the builder. Buildings generally do not have a lot of buffs going on.

Hope i understood you correctly as well, @Pyrogasm :)

Greetz
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
I was under the impression Protoss can’t even build outside of energy fields. If the OP wants that functionality then my points all still stand. Point 4 was with regard to buffs on worker units as I misread and thought you were suggesting that.

Second, what exactly “operable” means is ambiguous. Some buildings do not need to ‘do’ anything to provide benefits to you. For example a farm built out of the buff radius still increases the food cap, but never has to be issued an order to do that. Building a Castle allows production of Gryphon Riders at other buildings but the castle doesn’t have to act to enable that. How do you expect to overcome things like this with a buff based approach? What about a tower that shouldn’t be able to attack without the buff? (Unit attacked event is bad, acquires a target event is a specific unit event.)

Sure you can abort any actions a building without the buff attempts to perform, but that doesn’t cover all the possibilities. You’re ultimately forced into some sort of periodic check to manually enable techs and attacks.
 
Level 2
Joined
Apr 18, 2019
Messages
8
Hello all,
You could give the "Pylons" an Aura and whenever a building is ordered to do something check if it has the fitting buff.
If yes - you do not need to change anything
If not - just order the bulding to stop and create a Error Message for the owner.

:)

sounds like a good suggestions, essentially I am trying to create a new race and I want to make them unique and not just a human/orc and more like a mix of undead and night elf

so without the blight but still need something ( an aura as you suggested sounds amazing because it does that)



the aura should be present in order for the building to be functional, for example if it's a tower it wont be able to attack without it, if it's a barracks it wouldn't be able to train units.
 
Level 1
Joined
Aug 14, 2007
Messages
7
Glad i could help, @Asterianos :)

Nevertheless i want to add, that @Pyrogasm is right in that there are some aspects of this i did not think about. Especially the fact, that buldings without the buff will still eligible for the techtree might be important. :)
(Sorry if i sounded aggressive btw, which was not my intention :) )

Greetz
 
Level 8
Joined
May 21, 2019
Messages
435
Well, you could basically just check every time a player with said race starts constructing a building if there is this pylon structure nearby.

Something like this:
  • Pylon Requirement
    • Events
      • Unit - A unit Begins construction
    • Conditions
    • Actions
      • Set TempGroup = (Units within 512.00 of TempPoint matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to [Pylon])))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup) Equal to 0
        • Then - Actions
          • Unit - Remove (Constructing structure) from the game
          • Game - Display to (All players) the text: Pylon nearby required
        • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup)

This should work, but wouldn't this consume the construction resources as the unit is removed? I'd say that the trigger should be built to refund those resources as well, as judging the exact bounds of an invisible radius is going to be heavily "trial and error" for the player.
 
Level 8
Joined
May 21, 2019
Messages
435
Hello all,
sounds like a good suggestions, essentially I am trying to create a new race and I want to make them unique and not just a human/orc and more like a mix of undead and night elf

so without the blight but still need something ( an aura as you suggested sounds amazing because it does that)

the aura should be present in order for the building to be functional, for example if it's a tower it wont be able to attack without it, if it's a barracks it wouldn't be able to train units.

A tower not attacking may be a bit trickier than a barrack not training units. You could do a periodic event that checks if all towers have the aura, and then replace them with a disabled version of the tower. I am not certain that ordering the tower to stop would reliably prevent it from firing. This would also work for structures that provide food.
 
Last edited:
Level 9
Joined
Jul 30, 2018
Messages
445
This should work, but wouldn't this consume the construction resources as the unit is removed? I'd say that the trigger should be built to refund those resources as well, as judging the exact bounds of an invisible radius is going to be heavily "trial and error" for the player.

Yes, it would indeed consume the resources and they would have to be refunded in the trigger. It was just a fast sketch on how the trigger could work. I think this is way better way to make the trigger than the above-suggested aura things, but the aura could still be added to the Pylon structure for visual purposes so that when the builder has the buff, the player knows it is in range.
 
Level 8
Joined
May 21, 2019
Messages
435
Yes, it would indeed consume the resources and they would have to be refunded in the trigger. It was just a fast sketch on how the trigger could work. I think this is way better way to make the trigger than the above-suggested aura things, but the aura could still be added to the Pylon structure for visual purposes so that when the builder has the buff, the player knows it is in range.

I don't know. This method doesn't disable structures if the pylon is destroyed. I think he wants them to act as "energy beacons", and this approach is more of a construction restrictor, which is kinda what I thought as well when reading "Blight", but doesn't seem to be what he wanted once people started talking about Pylons.
 
Status
Not open for further replies.
Top