Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [SOLVED] Ally States
[SOLVED] Ally States
This topic is locked. You can no longer write replies here.
Aug 2 2011, 3:42 pm
By: Oh_Man  

Aug 2 2011, 3:42 pm Oh_Man Post #1

Find Me On Discord (Brood War UMS Community & Staredit Network)

Usually when you are allied with someone you can still attack them using CTRL+A. However, if you spam preserve the alliance you can stop this; the unit plays the attack animation but no damage is dealt (or at least that is what I thought).

I am having a problem where I want a unit to be attackable but only through CTRL+A. Unfortunately the CTRL+A method is not working (no damage is dealt, only the animation plays), it seems as if the Ally trigger is on preserve, though I know for a fact it is not. If I make the unit an enemy or even just Neutral it is attacked automatically (this is not what I want I want it to be like a switch, so CTRL+A attack only.

So what am I missing in my knowledge here??

Thanks in advance,
Oh_Man.




Aug 2 2011, 4:03 pm Sacrieur Post #2

Still Napping

That's because your attacking an ally of your ally iirc.

Post has been edited 1 time(s), last time on Aug 3 2011, 12:46 am by Sacrieur.



None.

Aug 2 2011, 4:03 pm Dem0n Post #3

ᕕ( ᐛ )ᕗ

What's the trigger for making the players allied?




Aug 2 2011, 4:15 pm Oh_Man Post #4

Find Me On Discord (Brood War UMS Community & Staredit Network)

Quote from name:Dem0nS1ayer
What's the trigger for making the players allied?
Player 1
Always
Set Player 8 to Ally.

Quote from Sacrieur
That's because your attacking an ally of your ally iirc.
This could well be it, so how does that work?




Aug 2 2011, 6:44 pm Azrael Post #5



If the alliance status of any two players is being preserved, regardless of which players they are or what the status is being changed to, then all players experience the inability to manually target allies.

Units will still be able to attack enemies though, since it doesn't require Ctrl+A.

It sounds like you have an alliance status being preserved somewhere, maybe one unrelated to the computer player.




Aug 2 2011, 11:33 pm Lanthanide Post #6



I have this in my map, but I am going to implement a system so that alliance doesn't need to be preserved, but I can still turn it back on whenever I detect the player has changed it.

It's pretty easy to do actually. If you know that P1-4 should always be allied, and P5-8 should always be allied, have a DC called "ally group" or some-such. Set this to 10 for P1-4, and set it to 100 for P5-8. You also need some additional triggers to monitor when players are actually present in the game (whether they never started, or left half way through), you can store this in player DCs or in switches if you want. Have these alliance checkers at the top of the trigger list so the rest of your triggers that depend on alliance status are correctly set up by the time they are executed.

So for players 1-4 you would have a trigger like this:
1. If allies ally group exactly 30, do nothing (alliance is correctly set)
2. If allies ally group is at most 29 and player 1, 2, 3, 4 are still in the game, set alliance for p1, p2, p3, p4
3. If allies ally group is at least 31 and player 1, 2, 3, 4 are still in the game, set alliance for p1, p2, p3, p4

This is the bare skeleton of what's required. The when checking "allies" death count it adds up the values for all of your allies, but does not include yourself. So while the "ally group" DC of the force would be 40 in total, your "allies" score would only be 30.

#1 is what we expect to see.
#2 means the player has un-allied with someone they should be allied with, so reset the alliance.
#3 means the player has allied with someone they should *not* be allied with, so reset the alliance.

If your player alliance is allowed to change during the game at a certain point, like half way through you change from alliance of 1,2,3,4 to 1,2 and 3,4, then you simply need to have 2 sets of these checking triggers for each phase of the game.

Post has been edited 1 time(s), last time on Aug 3 2011, 12:00 am by Lanthanide.



None.

Aug 2 2011, 11:59 pm Ahli Post #7

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Let's sum it up: There has to be an action constantly running that allies someone with someone.
Search in your trigger code for that action and you should have all possible triggers running.
If you don't know if that thing runs, create & kill a unit in that trigger as debug output.

To detect a player changing an alliance status you have to check for a change of the properties of foes or allies. I prefer detection of the changing player with foes, but both works.

Lanthanide detects "disappearing" allies due to unallieing.




Aug 3 2011, 12:41 am Azrael Post #8



Quote from Ahli
There has to be an action constantly running that allies someone with someone.

Or unallies.




Aug 3 2011, 3:22 am TiKels Post #9



Quote
ctrl+a
What is ctrl+A?

Do you guys mean A+click?



"If a topic that clearly interest noone needs to be closed to underline the "we don't want this here" message, is up to debate."

-NudeRaider

Aug 3 2011, 3:45 am Azrael Post #10



That is what I assumed was meant.




Aug 3 2011, 3:46 am ClansAreForGays Post #11



Quote from TiKels
Quote
ctrl+a
What is ctrl+A?

Do you guys mean A+click?
lol, I can't believe I read it that way too until u pointed it out




Aug 3 2011, 4:21 am rockz Post #12

ᴄʜᴇᴇsᴇ ɪᴛ!

Lanthanide has one way which works.

You have to detect when someone is not on the correct alliance status. I usually use "foes" and "allies" as the player, so I can detect when player 1 is a foe by some unique identifier for player 1 (command a certain number of units, brings a certain number of units to a location, has a specific number of deaths of some unit, etc...).

That way you only reset the alliance status whenever the player manually resets the alliance status.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Aug 3 2011, 8:26 am Oh_Man Post #13

Find Me On Discord (Brood War UMS Community & Staredit Network)

Yeh OK so I can remove the preserve ally to get rid of that cancelling attack effect. The reason I had it in the first place was because I wanted to prevent trolling from players manually attacking each other. People can still do this while being allied, so Lanth's method doesn't work for this.

I guess, if I want to have attackable switches, I am going to have to do away with my current anti-troll method.

Thanks all.




Aug 3 2011, 6:17 pm Azrael Post #14



Well, you could keep the preserve ally state for anti-trolling and make a separate system for attacking the target unit manually. You can keep the player allied to the computer around these units, except when the player does something specifically to indicate they want to attack them, then unally the player from the computer.

One method you could consider would be EUD selection detection. Whenever someone has one of the units selected, they are unallied from the computer, and the rest of the time they are allied to it.




Aug 4 2011, 9:54 am Oh_Man Post #15

Find Me On Discord (Brood War UMS Community & Staredit Network)

You don't have to select a unit to Manually Attack it. I think I can use some triggers to disable the anti-troll when they are in areas where there are switches. That is probably the best option available to me unless ppl have any other ideas.




Aug 4 2011, 5:49 pm TiKels Post #16



You could do (I think it's called target detection or something?) it's the system that samsizzle used in his map Urban (I think he renamed it now?).

Basically detect when a player targets another player and be like NOU.



"If a topic that clearly interest noone needs to be closed to underline the "we don't want this here" message, is up to debate."

-NudeRaider

Aug 5 2011, 1:41 am Aristocrat Post #17



Simple, make the unit you want to be attacked a Player 12 unit, and put a burrowed zerg unit underneath that. Give players a unit with splash damage. Whenever a player force attacks the player 12 unit, the splash damage kills the burrowed zerg unit, triggering the switch system.

(Although, in all honestly, if you are making a switch system you only need Player 12 units.)



None.

Aug 24 2011, 8:37 pm Oh_Man Post #18

Find Me On Discord (Brood War UMS Community & Staredit Network)

Can't force attack neutral units when ally states are being preserved.
Also I can't use splash damage due to how my map is.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:05 am]
Vrael -- I won't stand for people going around saying things like im not a total madman
[01:05 am]
Vrael -- that's better
[12:39 am]
NudeRaider -- can confirm, Vrael is a total madman
[10:18 pm]
Vrael -- who says I'm not a total madman?
[02:26 pm]
UndeadStar -- Vrael, since the ad messages get removed, you look like a total madman for someone that come late
[2024-5-02. : 1:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
Please log in to shout.


Members Online: C(a)HeK