• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Help with making "Vassals"

Status
Not open for further replies.
Level 1
Joined
Nov 20, 2007
Messages
5
A major feature of a map I am trying to create is that when a player's home city is destroyed, it is in fact captured and forced to ally whomever hurt the building to less than 500 hp. I am, however, quite new to scripting and this is a bit over my head. Here is what I have so far, but when tested doesn't work.

----------
Events
Unit (city) life becomes Less than 500.00
Conditions
Actions
Player - change color of Player 3 to color of triggering player, changing color of existing units
Player - make triggering player treat player 3 as an ally with shared vision
Player- Make player 3 treat Triggreing player as an ally with shared vision and full shared units
Game - Display to all players the text - "City has been subjegated!"
----------

I have a very limited understanding of variables within the world editor and I feel this is where the answer lies. Does anyone have any possible suggestions? Would be much appreciated.
 
Level 11
Joined
Aug 25, 2006
Messages
971
Here ya go.
  • Town
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to TownBuilding
      • (Life of (Attacked unit)) Less than or equal to 500.00
    • Actions
      • Unit - Change ownership of (Attacked unit) to (Owner of (Attacking unit)) and Change color
      • Unit - Set life of (Attacked unit) to 100.00%
Replace TownBuilding with the unit type you want this trigger to effect. Then just add Game - Display text to player group (force)
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Just for your basic understanding, Triggering player/unit is the player/unit who made the trigger to work (the Event in other words).

Since you have no player/unit that made the trigger work there is no way Triggering Player/unit condition/action will work.
 
Level 1
Joined
Nov 20, 2007
Messages
5
Thank you very much the both of you. Here is what I ended up with;

  • City Captured
    • Event
      • Unit - City is Attacked
    • Conditions
      • Life of Attacked unit Less than 500
      • Attacked unit Equal to City
    • Actions
      • Player - Change color of player 3 (Teal) to (Color of (Owner of (Attacking Unit))), Changing color of existing units
      • Player - Make (Owner of Attacking Unit treat Player 3 (Teal) as an Ally with Shared Vision
      • Player - Make Player 3 (Teal) treat (Owner of (Attacking unit)) as an Ally with Shared Vision and full shared units
      • Game - Display to (All players) the Text: The City has been subjugated!
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
You could just do "A unit is attacked" since you put the condition of "Attacked unit equal to City".

And do you have a number of city's on the map ? because if you do this will make it that when you capture 1 all of them will become your color.

And last thing, this won't make the buildings yours, only your color.

And last last thing, I would suggest just for cooler things to make the text also show who captured the city.
  • Game - Display to (All players) the text: (The City has been subjugated by + ((Name of (Owner of (Attacking unit))) + !))
 
Level 1
Joined
Nov 20, 2007
Messages
5
I very well could haha. Each city is a different object for each civilization (its reflected on this in the actual trigger but I just typed city to save time and possible confusion) so no worries there. I know it won't make the building the players, it forces the other player to ally with the conqueror and thus be "subjugated" to fight with them. I didn't really make that part clear in my first post; my apologies.

Excellent idea with the name of attacking unit string! Will definitely be implementing that one as well. :thumbs_up:

Thanks again.
 
Status
Not open for further replies.
Top