I have two triggers - one is an AI RESPONSE and the other is a UNIT RESURRECTION.
The AI RESPONSE trigger works like this: if a player's hero attacks something it is not supposed to, there are penalties and guards are provoked into attacking.
The UNIT RESURRECTION trigger works like this: if a player's hero dies, it is resurrected and receives a temporary behavior which makes that hero invulnerable but unable to attack for a short time.
BOTH OF THESE TRIGGERS WORK
HERE IS THE PROBLEM: When a player's hero dies and is resurrected, the AI RESPONSE trigger no longer fires FOR THAT HERO, while working for all other heroes that have NOT been resurrected. The AI RESPONSE trigger does ABSOLUTELY NOTHING when the resurrected hero attacks something it is not supposed to. I do not know why because the unit that resurrects is the same as the unit that dies.
I checked the unit resurrection trigger with and without the added behavior and it did not help. Please look at the triggers and see if you can discover the problem. Or, perhaps, someone could give me a suggestion.
AI RESPONSE TRIGGER
Unit-AnyUnitisattackedLocalVariablesPlayer:AttackingPlayer=(Emptyplayergroup)<PlayerGroup>Conditions((Triggeringunit)isHallucination)==trueActionsVariable-SetPlayer:AttackingPlayer=(Playergroup((Ownerof(AttackingUnit))))UI-Display"Your hero attacked an imposter! - C..."forPlayer:AttackingPlayertoSubtitleareaSound-PlayMusicAlert:Clone(AnySoundtrackIndex)forPlayer:AttackingPlayer(withcueAnyCue)andDoNotmakedefaultSound-SetMusicsoundtracktoplayOnceforPlayer:AttackingPlayerUnit-Set(AttackingUnit)Life(Percent)to(((AttackingUnit)Life(Percent)(Current))-40.0)Ping-Pingtheminimapat(Positionof(AttackingUnit))for(Allplayers)over8.0seconds,usingthecolor(100%,0%,0%)PlayerGroup-PickeachplayerinPlayer:AttackingPlayeranddo(Actions)ActionsPlayer-Makeplayer7treatplayer(Pickedplayer)asEnemyGeneral-Wait20.0GameTimesecondsPlayer-Makeplayer7treatplayer(Pickedplayer)asAlly
UNIT RESURRECTION
Unit-AnyUnitdiesLocalVariablesConditionsAndConditions((Unittypeof(Triggeringunit))hasHeroicattribute)==true((Triggeringunit)isHallucination)==false(Player(Ownerof(Triggeringunit))Vespene)>0ActionsPlayer-Modifyplayer(Ownerof(Triggeringunit))Vespene:Subtract1Unit-Create1(Unittypeof(Triggeringunit))forplayer(Ownerof(Triggeringunit))at(Startlocationofplayer(Ownerof(Triggeringunit)))facing270.0degrees(NoOptions)Unit-Add1Hero-Sanctuaryto(Lastcreatedunit)from(Lastcreatedunit)Camera-Panthecameraforplayer(Ownerof(Triggeringunit))to(Positionof(Lastcreatedunit))over1.0secondswithExistingVelocity%initialvelocity,0%deceleration,andDoNotusesmartpanningGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Player(Ownerof(Triggeringunit))Vespene)==0ThenUI-Display(("Player "+(Text((Ownerof(Triggeringunit)))))+" has one (1) life remaining.")for(Allplayers)toSubtitleareaSound-PlayDialogue_TransmissionStartfor(Allplayers)(at100.0%volume,skipthefirst0.0seconds)Else
When you say "AI response" no longer functions, do you mean that the trigger never fires? Or certain aspects of the trigger don't work (aka, do you see the UI display)?
We need to figure out whether the "AI response" trigger stops working, or if the trigger simply doesn't fire when you're using your newly resurrected unit. Try using two units placed on the map to begin with, then get one of them killed and resurrected. Does the "AI response" trigger still work with the second pre-placed unit and not the resurrected unit?
You can also try isolating the conditions. Set up two new triggers, one with condition ((Triggering unit) is Hallucination) == true and the other with condition ((Attacking Unit) is Hallucination) == false, then put in a UI display to all players for each trigger and see if one or both of them does not work.
Let me rephrase. The AI response trigger works perfectly, but when a unit dies and is resurrected, it does not fire at all (no aspect of the trigger seems to work) for that resurrected unit. Nonetheless, the trigger continues to work as it should for units that have not been killed yet.
This does not make sense to me because the resurrected unit is the same as the unit that was killed.
You can also try isolating the conditions. Set up two new triggers, one with condition ((Triggering unit) is Hallucination) == true and the other with condition ((Attacking Unit) is Hallucination) == false, then put in a UI display to all players for each trigger and see if one or both of them does not work.
Do this, and figure out what aspect is no longer working. Maybe for some reason the resurrected unit is failing the hallucination check?
General-If(Conditions)thendo(Actions)elsedo(Actions)If(Player(Ownerof(Triggeringunit))Vespene)==4ThenUI-Display"Your hero has four (4) lives remain..."for(Playergroup((Ownerof(Triggeringunit))))toSubtitleareaSound-PlayDialogue_TransmissionStartfor(Playergroup((Ownerof(Triggeringunit))))(at100.0%volume,skipthefirst0.0seconds)ElseGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Player(Ownerof(Triggeringunit))Vespene)==3ThenUI-Display"Your hero has three (3) lives remai..."for(Playergroup((Ownerof(Triggeringunit))))toSubtitleareaSound-PlayDialogue_TransmissionStartfor(Playergroup((Ownerof(Triggeringunit))))(at100.0%volume,skipthefirst0.0seconds)ElseGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Player(Ownerof(Triggeringunit))Vespene)==2ThenUI-Display"Your hero has two (2) lives remaini..."for(Playergroup((Ownerof(Triggeringunit))))toSubtitleareaSound-PlayDialogue_TransmissionStartfor(Playergroup((Ownerof(Triggeringunit))))(at100.0%volume,skipthefirst0.0seconds)ElseGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Player(Ownerof(Triggeringunit))Vespene)==1ThenUI-Display"Your hero has one (1) life remainin..."for(Playergroup((Ownerof(Triggeringunit))))toSubtitleareaSound-PlayDialogue_TransmissionStartfor(Playergroup((Ownerof(Triggeringunit))))(at100.0%volume,skipthefirst0.0seconds)Else
should look like this
SetTempLives=Player(Ownerof(Triggeringunit))VespeneGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(TempLives)>0ThenUI-Display"Your hero has four (TempLives) lives remain..."for(Playergroup((Ownerof(Triggeringunit))))toSubtitleareaSound-PlayDialogue_TransmissionStartfor(Playergroup((Ownerof(Triggeringunit))))(at100.0%volume,skipthefirst0.0seconds)Youmaywanttoactuallyrevivetheheroatthispoint?
Remove the Uncommandable condition at the top of the trigger.
Let me rephrase. The AI response trigger works perfectly, but when a
unit dies and is resurrected, it does not fire at all (no aspect of the
trigger seems to work) for that resurrected unit. Nonetheless, the
trigger continues to work as it should for units that have not been
killed yet.
This does not make sense to me because the resurrected unit is the same
as the unit that was killed.
What is not firing? Which trigger..... Im assuming if the resurection is working then the resurection trigger is working fine right?
Agro Trigger Notes
Remove the conditions on the trigger they are unneeded (they may also be returning false) but you really dont need them
Player - Make player 7 treat player (Number of players in Player: Attacking Player) as Enemy
should be
Player - Make player 7 treat player (Owner of (Attacking Unit)) as Enemy
ok i am new to the map making so cant you make the last 4 if states something like this
UI - Display "Your hero has"+ArrayOfNumberNames[Vespene]+Vespene+"lives remain..." for (Player group((Owner of (Triggering unit)))) to Subtitle area
Sound - Play Dialogue_TransmissionStart for (Player group((Owner of (Triggering unit)))) (at 100.0% volume, skip the first 0.0 seconds)
For your problem,
Your created units is not Hallucination
Unit - Create 1 (Unit type of (Triggering unit))-> ((Triggering unit) is Hallucination) == false
If i am wrong dont be harsh pls i said i am newbie : )
Edit About If states:Ok @soulcarverr was first but he has a miner bug : )
Xentios is right about displaying the amount of vespene. SoulCarveRR missed the spelled out letter "four". But that's not relevant to the problem.
In response to Xentios's suggestion, the resurrected unit is not a hallucination and it's not supposed to be. The "AI response" is checking that the attacking unit is not a hallucination, and in this case the resurrected unit is the attacking unit. I have read through the trigger a few times and can't find anything obviously wrong. Pottfish will have to figure this one out on his own, but we can provide some suggestions to help solve it.
General-If(Conditions)thendo(Actions)elsedo(Actions)If(Player(Ownerof(Triggeringunit))Vespene)==4ThenUI-Display"Your hero has four (4) lives remain..."for(Playergroup((Ownerof(Triggeringunit))))toSubtitleareaSound-PlayDialogue_TransmissionStartfor(Playergroup((Ownerof(Triggeringunit))))(at100.0%volume,skipthefirst0.0seconds)ElseGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Player(Ownerof(Triggeringunit))Vespene)==3ThenUI-Display"Your hero has three (3) lives remai..."for(Playergroup((Ownerof(Triggeringunit))))toSubtitleareaSound-PlayDialogue_TransmissionStartfor(Playergroup((Ownerof(Triggeringunit))))(at100.0%volume,skipthefirst0.0seconds)ElseGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Player(Ownerof(Triggeringunit))Vespene)==2ThenUI-Display"Your hero has two (2) lives remaini..."for(Playergroup((Ownerof(Triggeringunit))))toSubtitleareaSound-PlayDialogue_TransmissionStartfor(Playergroup((Ownerof(Triggeringunit))))(at100.0%volume,skipthefirst0.0seconds)ElseGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Player(Ownerof(Triggeringunit))Vespene)==1ThenUI-Display"Your hero has one (1) life remainin..."for(Playergroup((Ownerof(Triggeringunit))))toSubtitleareaSound-PlayDialogue_TransmissionStartfor(Playergroup((Ownerof(Triggeringunit))))(at100.0%volume,skipthefirst0.0seconds)ElseshouldlooklikethisSetTempLives=Player(Ownerof(Triggeringunit))VespeneGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(TempLives)>0ThenUI-Display"Your hero has four (TempLives) lives remain..."for(Playergroup((Ownerof(Triggeringunit))))toSubtitleareaSound-PlayDialogue_TransmissionStartfor(Playergroup((Ownerof(Triggeringunit))))(at100.0%volume,skipthefirst0.0seconds)Youmaywanttoactuallyrevivetheheroatthispoint?
Remove the Uncommandable condition at the top of the trigger.
@Pottfish: Go
What is not firing? Which trigger..... Im assuming if the resurection is working then the resurection trigger is working fine right? Agro Trigger Notes
Remove the conditions on the trigger they are unneeded
Actually, I need the uncommandable part as there are other units in the game, some of which are uncommandable.
Yes, the revival trigger always works fine. The problem is that the AI response trigger does not fire for units that have been revived. Oh, and thanks for the code suggestion... I was looking for a way to make it shorter.
Did you see my suggestions for the "Comp Ai Threat response" trigger..... when you say AI trigger its confusing since you didnt label them or anything...
Your saying that the "comps units" need to be halucinations.....
which is kinda pointless...
Your also setting the wrong players to be an "enemy" of player 7
OK... I made changes to the triggers, updated the thread with them, and made the thread more clear. The problem still persists.
I used some of Soulcarverr's suggestions and it did not solve the problem (although it made the triggers a lot better). I am sooo confused I have nooo idea what the problem could be.
Oh, and I have to assign the attacking player to a variable and then use that variable because the wait condition makes the trigger forget.
I also have one more question about something else...
I understand how to create a random unit for a random player. However, I am struggling because I need to ensure that none of the random units are created more than once. I also need to figure out how to make each unit spawn at a random region (there are six players, units and regions).
There must be a simplistic way to do this with variables but I cannot figure it out. I think if I can figure out how to do this, it may solve the original problem I still have...
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have two triggers - one is an AI RESPONSE and the other is a UNIT RESURRECTION.
The AI RESPONSE trigger works like this: if a player's hero attacks something it is not supposed to, there are penalties and guards are provoked into attacking.
The UNIT RESURRECTION trigger works like this: if a player's hero dies, it is resurrected and receives a temporary behavior which makes that hero invulnerable but unable to attack for a short time.
BOTH OF THESE TRIGGERS WORK
HERE IS THE PROBLEM: When a player's hero dies and is resurrected, the AI RESPONSE trigger no longer fires FOR THAT HERO, while working for all other heroes that have NOT been resurrected. The AI RESPONSE trigger does ABSOLUTELY NOTHING when the resurrected hero attacks something it is not supposed to. I do not know why because the unit that resurrects is the same as the unit that dies.
I checked the unit resurrection trigger with and without the added behavior and it did not help. Please look at the triggers and see if you can discover the problem. Or, perhaps, someone could give me a suggestion.
AI RESPONSE TRIGGER
UNIT RESURRECTION
@Pottfish: Go
When you say "AI response" no longer functions, do you mean that the trigger never fires? Or certain aspects of the trigger don't work (aka, do you see the UI display)?
We need to figure out whether the "AI response" trigger stops working, or if the trigger simply doesn't fire when you're using your newly resurrected unit. Try using two units placed on the map to begin with, then get one of them killed and resurrected. Does the "AI response" trigger still work with the second pre-placed unit and not the resurrected unit?
You can also try isolating the conditions. Set up two new triggers, one with condition ((Triggering unit) is Hallucination) == true and the other with condition ((Attacking Unit) is Hallucination) == false, then put in a UI display to all players for each trigger and see if one or both of them does not work.
@SkrowFunk: Go
Let me rephrase. The AI response trigger works perfectly, but when a unit dies and is resurrected, it does not fire at all (no aspect of the trigger seems to work) for that resurrected unit. Nonetheless, the trigger continues to work as it should for units that have not been killed yet.
This does not make sense to me because the resurrected unit is the same as the unit that was killed.
Do this, and figure out what aspect is no longer working. Maybe for some reason the resurrected unit is failing the hallucination check?
@Pottfish: Go
Revive Trigger Notes
Please learn how to code better
This bit here:
should look like this
Remove the Uncommandable condition at the top of the trigger.
Agro Trigger Notes
Player - Make player 7 treat player (Number of players in Player: Attacking Player) as Enemy
should be
Player - Make player 7 treat player (Owner of (Attacking Unit)) as Enemy
ok i am new to the map making so cant you make the last 4 if states something like this
UI - Display "Your hero has"+ArrayOfNumberNames[Vespene]+Vespene+"lives remain..." for (Player group((Owner of (Triggering unit)))) to Subtitle area Sound - Play Dialogue_TransmissionStart for (Player group((Owner of (Triggering unit)))) (at 100.0% volume, skip the first 0.0 seconds)
For your problem, Your created units is not Hallucination Unit - Create 1 (Unit type of (Triggering unit))
-> ((Triggering unit) is Hallucination) == falseIf i am wrong dont be harsh pls i said i am newbie : )
Edit About If states:Ok @soulcarverr was first but he has a miner bug : )
@Xentios: Go
Xentios is right about displaying the amount of vespene. SoulCarveRR missed the spelled out letter "four". But that's not relevant to the problem.
In response to Xentios's suggestion, the resurrected unit is not a hallucination and it's not supposed to be. The "AI response" is checking that the attacking unit is not a hallucination, and in this case the resurrected unit is the attacking unit. I have read through the trigger a few times and can't find anything obviously wrong. Pottfish will have to figure this one out on his own, but we can provide some suggestions to help solve it.
Actually, I need the uncommandable part as there are other units in the game, some of which are uncommandable.
Yes, the revival trigger always works fine. The problem is that the AI response trigger does not fire for units that have been revived. Oh, and thanks for the code suggestion... I was looking for a way to make it shorter.
@Pottfish: Go
Did you see my suggestions for the "Comp Ai Threat response" trigger..... when you say AI trigger its confusing since you didnt label them or anything...
Your saying that the "comps units" need to be halucinations.....
which is kinda pointless...
Your also setting the wrong players to be an "enemy" of player 7
OK... I made changes to the triggers, updated the thread with them, and made the thread more clear. The problem still persists.
I used some of Soulcarverr's suggestions and it did not solve the problem (although it made the triggers a lot better). I am sooo confused I have nooo idea what the problem could be.
Oh, and I have to assign the attacking player to a variable and then use that variable because the wait condition makes the trigger forget.
I also have one more question about something else...
I understand how to create a random unit for a random player. However, I am struggling because I need to ensure that none of the random units are created more than once. I also need to figure out how to make each unit spawn at a random region (there are six players, units and regions).
There must be a simplistic way to do this with variables but I cannot figure it out. I think if I can figure out how to do this, it may solve the original problem I still have...