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

Unit Trigger Question

Status
Not open for further replies.
Hello,

I got a map in the finishing phases that has Siege Towers as a controllable unit. However I am having a hard time figuring out what trigger system that I need to use for the following,

Player A (attacker) owns a siege tower (may own more to replace destroyed ones) around the fortress there are small markers for were siege towers go. I want a trigger system to basiclly once the Tower reaches the position it place the lowering drawbridge animation, than allowing troops to use it to get to the wall. Any troops that get near it, with the exception of Mounted Units, beats(Ogers, Tauren, etc.), and siege weapons would begin to appear on the wall, similar to the waygate minus the teleporting animation.
I also got the same idea for Siege Ladder's minus the Draw bridge animation.

I also would like to know how to do the following

also for this map the Attacker has to build there own "fort" I looking for a trigger system or something like that so every building costs Wood and Stone as a resource. Player has both a Stone Manson and Lumber mill, the Player has a Granary for storing food and a stock pile for wood and stone. Farms produce food for the Granary. If the Granary is destroyed all food production is halted same with the stock pile (kind of if you lost your main building in a standard warcraft 3 match.
In order to create units you need "peasants" 1 spawns every 3 seconds with a maximum of 25 spawned at a time. the more "homes you have the faster your peasants spawn example 1 home = 1 peasants per 3 second, 4 homes = 4 peasants per 3 seconds

if anyone has some ideas or example that can help me out that would be great.

Thank you.
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
I made you the first system here. maybe if I have have time later I will do the other one too.

Edit:

wow, pretty lucky that me and doomblade didn't work on the same thing even though we posted like a minute apart...

I was kind of in a rush before - I hope was I did is clear enough from the map.

just to clarify - the huge obelisks represent the siege towers. I didn't spend much time on the aesthetics...

I thought of making the towers lock into place, but wasn't sure if you still wanted them to be able to e mobile/functional, so I didn't

you will obviously have to add corresponding values to the triggers in your map for all of your towers. If anything else is unclear just ask...
 

Attachments

  • Siege System.w3m
    21.2 KB · Views: 14
Last edited:
Level 12
Joined
Feb 5, 2018
Messages
521
  • Custom Build Cost
    • Events
      • Unit - A unit Begins construction
    • Conditions
    • Actions
      • Set VariableSet PlayerNumber = (Player number of (Owner of (Triggering unit)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Constructing structure)) Equal to Farm
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • Stone[PlayerNumber] Less than 15
                  • Wood[PlayerNumber] Less than 30
            • Then - Actions
              • -------- Stone and Wood are integer variables that are currently set to 0 --------
              • -------- Triggering unit reference is to the unit building the structure --------
              • Unit - Order (Triggering unit) to Stop.
              • -------- --------
              • Unit - Remove (Constructing structure) from the game
              • -------- This is not required for this trigger to work, it just makes it a bit more fancy --------
              • -------- We could check invidually for wood and stone to make the errormessage refer to just not enough wood/stone --------
              • Custom script: if udg_ErrorSound == null then
              • Custom script: set udg_ErrorSound = CreateSoundFromLabel( "InterfaceError",false,false,false,10,10)
              • Custom script: endif
              • -------- --------
              • Set VariableSet ErrorSound = Error <gen>
              • Set VariableSet ErrorMessage = Not enough resources
              • Set VariableSet ErrorPlayer = (Owner of (Triggering unit))
              • -------- --------
              • Custom script: if GetLocalPlayer() == udg_ErrorPlayer then
              • Custom script: call ClearTextMessages()
              • Custom script: call DisplayTimedTextToPlayer( udg_ErrorPlayer, 0.52, 0.96, 2.00, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+udg_ErrorMessage+"|r" )
              • Custom script: call StartSound(udg_ErrorSound)
              • Custom script: endif
            • Else - Actions
        • Else - Actions

I made an example trigger with custom resources and added an error message too. :)

EDIT: I made a change for the trigger to be MPI so it checks the player number so we can check each players resource pool invidually.
 

Attachments

  • HelpMapForHive.w3m
    18.6 KB · Views: 13
Last edited:
Thank you both for the help.

Just one question for both of you. how easy or hard would it be to have these trigger systems also work for the AI? The map I am making is a castle builder so the all player and PC's would use MassiveMaster Fortification buildings if they are playing as human. the map is meant to as a Warcraft 3 style to the stronghold firefly games. I have left a link to the game the map is inspired by below

Stronghold 2: Steam Edition on Steam (steampowered.com)

basically besides these 2 triggers the player has a lord if said lord dies player/pc loses so all there remaining units and building die with them
what type of trigger will all me to do that with the lord and the remain units and buildings?
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
to have these trigger systems also work for the AI?
do you mean to have the systems themselves operate, or to have an AI that knows how to use the systems (and basically play your game)

the first is very easy - pretty much just as is. if you mean to create a custom AI that knows how to play your map (assuming it's pretty different from standard melee) - that is a much bigger project.
what type of trigger will all me to do that with the lord and the remain units and buildings?
this is freehand, but something like this:

event -
a unit dies

conditions-
unit is of unit type overlord

actions:
pick all units in unit group (units belonging to owner of killed unit) and do:
kill unit.

should be very simple.
 
do you mean to have the systems themselves operate, or to have an AI that knows how to use the systems (and basically play your game)

the first is very easy - pretty much just as is. if you mean to create a custom AI that knows how to play your map (assuming it's pretty different from standard melee) - that is a much bigger project.
Not exactly what I trying to do with these triggers is to have the ai use the like the player would build walls, siege tower basically doing what the player would do with these.

However if that's not easily to do is it possible to to have the ai Ignore the triggers Or for the Player to be identified at the start to choose there own race
so if player 1 and 2 are actual players they will get a message to choose a race Classic or "Stronghold Style" than depending on which they choose they than choose a race elves, orcs, etc. Where as the Ai just plays normal style. is that possible?
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
However if that's not easily to do is it possible to to have the ai Ignore the triggers Or for the Player to be identified at the start to choose there own race
like I said, building a custom AI for your game is probably a big job (I don't completely understand the nature of your map). The default (if you touch nothing in the starting trigger) is for the AI to behave like it would in normal melee - and ignore all of your triggers.
so if player 1 and 2 are actual players they will get a message to choose a race Classic or "Stronghold Style" than depending on which they choose they than choose a race elves, orcs, etc. Where as the Ai just plays normal style. is that possible?
definitely possible. look up tutorials for creating custom races, there is a lot of info on how to do this.
 
definitely possible. look up tutorials for creating custom races, there is a lot of info on how to do this.
do you recommended one for a "beginner"? I only made maps that melee so I heading in to "uncharted water" so to speak as far as I am concerned. if you have one you recommended I like to see it. I am reinstalling my reforge rn so i can test these trigger out.
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
Ok forget that, it seems pretty simple - I have never done exactly this, but I think you just need to do this:

A. create a dialog that asks the player what mode they want to play in - Basics of a Dialog

B. if they want to play in your mode - give them your starting units, and take away the regular starting units.

the problem that this can cause - is that the player will then lose the game, or at least be revealed if they do not have a town hall. that is why you also need to either shut off that function (the victory/defeat trigger that is part of the melee init trigger), or use retera's system here.

I suggest at least skimming over this to see other issues you could encounter. like I said, I have never done this so I may be missing something.
 
Status
Not open for further replies.
Top