• 🏆 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] 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 25
Joined
Sep 26, 2009
Messages
2,402
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 25
Joined
Sep 26, 2009
Messages
2,402
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