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

Looking for help with an advance tigger.

Status
Not open for further replies.
Level 2
Joined
Apr 15, 2008
Messages
5
I am looking for advice, or help with a rather odd tigger. I want certain buildings able to switch from one player to another, much like Arathi Basin in wow. I cannot seem to get the trigger to work on warcraft 3, and I am looking for help.

What I have is:
  • Events:
    • -Unit enters Region X
  • Conditions:
    • -Region X contains unit true <- I believe this is where I am wrong what I want is for the unit to remain alive for 30 sec
  • Actions:
    • Text: "(Player) is assulting the (Building)"
    • Create enviroment (So player, and myself knows it's working)
    • Timer: start timer
I figure I need another tigger to complete it, and here what that is.
  • Events:
    • Timer: Timer Expires
  • Conditions:
    • -(I still want that unit to be alive)
  • Actions:
    • Text "(Player) is has taken the (Building)"
    • Remove enviroment (So player, and myself knows it has worked)
    • Change (Building) to (Color of (owner of(tiggering unit)))
I realize this code is wrong in a couple ways looking at it now, especially the color change action. I also wish to set up a system in which a player gains money/points based on how long they hold a building, but I am not as good with the warcraft triggers as I am the starcraft triggers, ergo, I am in need of advice, and direction.

Any help in regards to this is greatly appreciated.
 
Last edited:
Level 34
Joined
Sep 6, 2006
Messages
8,873
Please use trigger tags.
  • [/trigger1] (without the 1)
  • Look where your trigger information is, there will be a small text icon, copy it and paste it in your trigger tags.
 

Attachments

  • Triggertag.JPG
    Triggertag.JPG
    35 KB · Views: 164
Level 17
Joined
Apr 13, 2008
Messages
1,597
Your code and the way of presenting your problem is very cloudy, but a few things I can tell:

Condition
-Region X contains unit true <- I believe this is where I am wrong what I want is for the unit to remain alive for 30 sec
Action
This is absolutely unnecessary, delete it from the trigger.

What you need to do is to check if the unit is still in the region, you can do this many ways.
Yes, you are going to need other triggers. Here is an example solution

I have no idea what do you want to do with the environment and why. No reason here.

  • Trigger 1
  • Events:
  • -Unit enters region X
  • Conditions:
  • -Owner of triggering unit is not the owner of Blacksmith
  • Actions:
  • -Text, blabla
  • -If there is no timer named 'Blacksmith' Create Countdown Timer for all players named 'Blacksmith' /or something/
  • Trigger 2
  • Events:
  • -Unit leaves region X
  • Conditions:
    • *You will need some, but due to lack of time and lack of input information I'll skip this.
  • Actions:
  • -Text, blabla
  • -Destroy Countdown Timer for all players named 'Blacksmith'
  • Trigger 3
  • Events:
  • -Timer Expires
  • Conditions:
  • Actions:
  • -Change ownership of Blacksmith to assaulting player/team/whatever.
 
Level 2
Joined
Apr 15, 2008
Messages
5
I have have been working with the triggers some more.
castle_assult.jpg

The Assult trigger seems to work fine.
castle_fail.jpg

However the fail message always appears when ever any unit steps away from the region, and that is not right. Although the break in the timer works fine.
castle_taken.jpg

The capture trigger seems to work fine.
castle_held.jpg

And finally I cannot seem to get the bulding to give the player resources.

Perhaps I am still going about it the wrong way, again any advice is very welcome.
 
Level 4
Joined
Jul 23, 2007
Messages
129
To give the player resources, you need a seperate trigger.

Something like this:

  • Extra Cash
    • Events:
    • Every 5 seconds of game time
    • Conditions:
    • Actions:
    • If (Resource Building) belongs to player 1 add 100 to Player 1's current gold, Else do nothing.
    • If (Resource Building) belongs to player 2 add 100 to Player 2's current gold, Else do nothing.
    • If (Resource Building) belongs to player 3 add 100 to Player 3's current gold, Else do nothing.
    • If (Resource Building) belongs to player 4 add 100 to Player 4's current gold, Else do nothing.
    • If (Resource Building) belongs to player 5 add 100 to Player 5's current gold, Else do nothing.
  • [[You get the idea. Repeat the above action for all players who can control the resource building.]]
If nobody owns the building, nothing will happen.

If you have more than 1 resource building, you will need another trigger exactly like this one that refers to that resource building instead.
 
Last edited:
Level 17
Joined
Apr 13, 2008
Messages
1,597
Hi, I've some free time now, sorry, last time I posted here I was about to go somewhere so I didn't post in detail.
So,
if I were you I would make two Real type variable, let me explain.
Team1NearCastle indicates the number of the Team1's troops in the Castle Flag region (or how you call it)
Team2NearCastle indicates the number of the Team2's troops in the Castle Flag region (or how you call it)
Both are real type variables.

Unit enters the region:
  • Events
  • A unit enters Castle flag
  • Conditions
  • Actions:
  • If - Conditions
    • Owner of Castle is an ally of entering unit
  • Then Actions
    • Set Team1NearCastle=Team1NearCastle+1
  • Else Actions
    • Set Team2NearCastle=Team2NearCaste+1
Unit leaves the region:
  • Event
  • Unit leaves Castle Flag
  • Conditions
  • Actions
  • If - Conditions
    • Owner of Castle is an ally of leaving unit
  • Then Actions
    • Set Team1NearCastle=Team1NearCastle-1
  • Else Actions
    • Set Team2NearCastle=Team2NearCaste-1
Unit dies in region:
  • Event
  • Unit dies at Castle Flag
  • Conditions
  • Actions
  • If - Conditions
    • Owner of Castle is an ally of dying unit
  • Then Actions
    • Set Team1NearCastle=Team1NearCastle-1
  • Else Actions
    • Set Team2NearCastle=Team2NearCaste-1;
If one of the teams' prescence becomes 0:
  • CastleDominance
  • Events
  • Team1NearCastle becomes 0
  • Team2NearCastle becomes 0
  • Conditions
  • Actions
  • If - Conditions
    • Team1NearCastle > 0
    • - Then Do actions
      • --Make Team 2 conquer the castle, you know, create the timers, ping the map, send the transmission and everything you want to.
      • --If it's already in the hands of Team 2 then stop the capturing process of Team 1, if it was initiated.
    • - Else Do actions
      • --Make Team 1 conquer the castle
      • --If it's already in their hands then stop Team 2 capturing it
Okay, I did hurry a little bit, if something is not clear then post your problems and I'll help. I hope I didn't forget anything.
 
Status
Not open for further replies.
Top