Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: trigger works for some units
trigger works for some units
Oct 5 2009, 8:02 pm
By: okeee  

Oct 5 2009, 8:02 pm okeee Post #1



When a unit enters a location, the hitpoints should be reduced and a message should appear once, everytime the unit enters that location.

trigger:
Quote
IF:
switch X is cleared
player brings 1 unit Y to location X
THEN:
set hitpoints for all unit Y at location X to 50%
display: 50%
set switch X
preserve trigger

IF:
switch X is set
player brings exactly 0 units to location X
THEN:
clear switch X
preserve trigger

This works ok for 1 unit, but when more units in a group to that area, 8, then it works with only about 4 of them. If I send them out of the area and back in, usually its still the same units that are affected, but sometimes 1 extra is affected. I have no idea why this is, shouldnt they all be affected?



None.

Oct 5 2009, 8:53 pm NudeRaider Post #2

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

The reason is that your trigger fires before all units are inside and doesn't refire until all units have left.

You could add a timer once you detect the units, (or just wait 1 trigger loop if you don't use hyper triggers) and then in a 2nd trigger set the hp if the timer hits 0 (or just put it above the detection trigger)




Oct 6 2009, 11:28 am okeee Post #3



I'll check that out.
Can you disable the detecting abilities of some of the buildings, for example I want zerg cerebrate to be unable to detect cloaked units.



None.

Oct 6 2009, 11:53 am NudeRaider Post #4

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Units can be blinded, but with buildings you're out of luck. Even when you remove the vision of the player, the detection will still work when he receives vision from another player. If he has no vision at all detection is useless ofc, if that helps.

Or just give the cerebrate to another player. A neutral player perhaps. Make the original player's color green, and you don't even notice it on the minimap when you give it to P9. Don't forget to set the alliances to P9 accordingly.




Oct 7 2009, 7:34 am okeee Post #5



I set player 1 alliance to player 9: allied victory, but player 1 keeps attacking the player 9 building. I checked it in another map, but there it did not attack. So why could the ally setting not work? I havent allied to player 9 with any of the other players.



None.

Oct 7 2009, 9:00 am rockz Post #6

ᴄʜᴇᴇsᴇ ɪᴛ!

Allied victory is a different setting than ally, isn't it? Just set them to ally, not AV.



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

Oct 7 2009, 11:08 am okeee Post #7



It doesnt make a difference, player 1 is still attacking player 9.



None.

Oct 7 2009, 3:52 pm Kaias Post #8



Quote from rockz
Allied victory is a different setting than ally, isn't it? Just set them to ally, not AV.
Allied victory gives the order to ally the player it specifies and checks 'allied victory' for you.
Ally gives the order to ally the player specified and unchecks 'allied victory' for you.



None.

Oct 7 2009, 4:53 pm NudeRaider Post #9

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Play as P1 and see if P9 has red circles. If yes, you didn't ally properly

Create a NEW trigger:
P1:
Always
Set P9 to Ally
Preserve (only needed to prevent other triggers from interfering)

Make sure this trigger is the last in the trigger list.

If that doesn't help, post the map




Oct 8 2009, 3:32 pm okeee Post #10



I played as player1 and player9 has a yellow circle and is still attacked, but just once.

If I use the preserve trigger, again player9 is attacked just once.
So is there some alliance trigger that I didnt set up correcty or could it be anything else? What would be the purpose of putting trigger at the bottom?
Maybe player 9 part of some force? I did set alliance of the human player to enemy of force 3 (computer player1).



None.

Oct 8 2009, 5:53 pm NudeRaider Post #11

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Uhm, I actually meant the cursor, not the selection circles. If I'm not mistaken the circles are also red for P9-11 when you set no alliances.

I wanted it placed at the bottom to make sure that no other trigger firing after it can change the alliance.

P9+ are not part of forces, they are neutral players.

But I see now what your problem is. The alliance is fine, but for a split second the units still fire at it. I have that too in a map of mine. I don't know the reason or how to fix it. But I suspect it has something to do with giving the units, or a delay at the very map start.
You can avoid that by preplacing the units at map start for neutral and then give them to the players.
If you're giving the units to P9 then you might want to give the attacker units too. Or move them, so they can't shoot.




Oct 8 2009, 11:00 pm Ahli Post #12

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

Quote from NudeRaider
But I see now what your problem is. The alliance is fine, but for a split second the units still fire at it. I have that too in a map of mine. I don't know the reason or how to fix it. But I suspect it has something to do with giving the units, or a delay at the very map start.
You can avoid that by preplacing the units at map start for neutral and then give them to the players.
If you're giving the units to P9 then you might want to give the attacker units too. Or move them, so they can't shoot.
Didn't you give the reason yourself? (triggers don't run instantly at map start, preplaced units can fire at each other.)
other solution for map start thing: check preplaced unit's invincibility.




Oct 9 2009, 10:12 am rockz Post #13

ᴄʜᴇᴇsᴇ ɪᴛ!

triggers DO run instantly at start. I haven't been bothered to test how and why some maps which spam the alliance from the start still have units which attack. There's either a 1 frame delay (likely) or I'm remembering things incorrectly. I seem to recall whenever I put my alliance triggers first, they tend to run and don't let any attacks go off.



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

Oct 9 2009, 11:20 am okeee Post #14



I'm not sure why player9 keeps getting attacked without using the preserve trigger. playing as player1, there is a green cursor for player9 buildings and then the attack is only once.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:59 am]
zsnakezz -- >:)
[04:59 am]
zsnakezz -- :)
[04:58 am]
zsnakezz -- somebody gets it
[04:58 am]
zsnakezz -- and its not all just numbers in my file screen
[04:57 am]
zsnakezz -- thank you for your comment though, good to know some people out there tried my map out
[04:57 am]
zsnakezz -- just kidding
[04:57 am]
zsnakezz -- ultra you have any thought or notes on undead invasion?
[2024-5-31. : 2:36 pm]
Wing Zero -- Bop em
[2024-5-31. : 2:36 pm]
Wing Zero -- Mods
[2024-5-29. : 9:40 pm]
Ultraviolet -- :wob:
Please log in to shout.


Members Online: Rawflesh0615, Oh_Man, Roy