• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Help with making "Vassals"

Status
Not open for further replies.

Hoplite

H

Hoplite

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.
 
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)
 
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!
 
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))) + !))
 
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.
Back
Top