HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Triggers for Neutral Mines

10-10-2003, 07:58 AM#1
callys
I am making an AOS-style map and I have noticed that in some maps like Riftwar when a building is destroyed it is restored to the other team with partial or full health. On my map each player is given a set amount of gold per sec (like all aos), when the mine falls I want that gold per sec and a newly restored mine to be transferred to the other team. I am pretty in the dark over the triggers to do this. Any help here?
10-10-2003, 09:06 AM#2
Illithid
It varies from map to map that uses a system like this, but from what I have heard recently, people feel that it is better to not actually destroy the building and rebuild it but, rather, have a check to see if the building falls below a set amount of hitpoints and if it does the unit will change control. If the building is destroyed there is a small chance that a unit can enter its location and prevent the building from reappering in the same location. To do this the triggers will go something like this.

Untitled Trigger 002
Events
Unit - (mine) Is attacked
Conditions
(Life of (Attacked unit)) Less than or equal to 300.00
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Attacking unit)) is an ally of (Team 1 computer player) is equal to true
Then - Actions
Unit - Change ownership of (mine) to (Team 1 computer player) and Change color
Trigger - Turn on (Team1gold)
Trigger - Turn off (Team2gold)
Else - Actions
Unit - Change ownership of No unit to (Team 2 computer player) and Change color
Trigger - Turn on (Team2gold)
Trigger - Turn off (Team1gold)
Unit - Set life of No unit to 100.00%

Team1gold
Event
Every 5 seconds
Action
Player Group - Pick every player in (All allies of Team 1 computer player) and do (Actions)
Loop - Actions
Player - Add 10 to (Picked player) Current gold

Team2gold
Event
Every 5 seconds
Action
Player Group - Pick every player in (All allies of Team 2 computer player) and do (Actions)
Loop - Actions
Player - Add 10 to (Picked player) Current gold

couple things of note, the building that people are fighting over, try to make sure its hitpoints can't fall to a point where someone can kill it with a single attack or spell. You might want to put code in to prevent people from attacking the building while it belongs to their ally.