• 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.

[Trigger] Certain cutscene playing because you used to be allied with a player

Status
Not open for further replies.
Level 5
Joined
Aug 18, 2013
Messages
85
I really need help in making a trigger in which this happens. I'll explain.

1) You're allied with Gordon leader of China
2) Gordon's alliance with you expires
3) Gordon declares war on you and invades you
4) Gordon asks to duel your king
5) A cutscene plays with certain dialogue indicating betrayal and betrayal music

Normally a duel with another king wouldn't play this music or dialogue.

Question: What I want to know is what is the best way to keep track of someone being your ally at one point in time but is no longer your ally so if he ever fights you there is a sense of a former friend betraying you? Personally I'd use a destructable or something. But I know people on this forum know better ways.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
I'm not sure I completely understand what you want, if you simply want to know if certain player is ally or enemy of another player, then there is a boolean comparison in conditions window.

  • Conditions
    • (Player X is an ally of Player Y) Equal to True
    • (Player X is an enemy of Player Y) Equal to True
 
Level 5
Joined
Aug 18, 2013
Messages
85
Sorry. No.

I meant a trigger to check if someone was allied to you BEFORE. You had an alliance with them BEFORE.

Is that impossible? The only way I can think of to accomplish this is like a barrel that gets created once you ally someone and if you're attacking them later it checks if this barrel exists and checks if you're allied or not.

If you're not allied it will play "betrayal music".

So I want to know how do you make a trigger check this. Is my trigger idea okay?
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
You can't really check something that was in the past. You can only check the current state.

Now for the trigger itself - it really depends on your execution of things. You could for example create a boolean variable with name like Players_were_allied and when you make them enemies, you change the boolean value to true, as they were allies before becoming enemies.

However if you only have triggers which change alliances back and forth, as in: Allied -> Enemies -> Allied -> enemies and so on, then you don't need any boolean really, because if you make a check
  • (Player X is an ally of Player Y) Equal to True
and this returns false, then it means that currently Player X is enemy with Player Y, so they previously had to be allies.
 
Level 2
Joined
Sep 21, 2013
Messages
22
You could use timers and store a boolean array variable which is either true or false depending on if there is an alliance (Making it multidimensional (there are tutorials) or using hashtables). Every X seconds it checks to see if the alliance is equal to the boolean, and if it isn't, then do your thing.

Basically going off a bit of what nichilus said.
 
Status
Not open for further replies.
Top