Staredit Network

Staredit Network -> UMS Assistance -> [SOLVED] Enabling units after conditions met
Report, edit, etc...Posted by dz187 on 2005-10-31 at 19:30:20
In my Golems map, when someone loses their Golem Factory (bunker) this trigger is executed:

Trigger
Players:
¤ Golem Makers (Players 1-5)
Conditions:
¤ Current Player commands at most 0 Golem Factory
¤ Elapsed scenario time is at least 100 game seconds
Actions:
¤ Center location labled 'Turret' on Anti-Air Golem owned by Current Player at 'Anywhere'
¤ Kill all any unit for Current Player
¤ Disable invincibility for Golem Turret owned by Player 7 at 'Turret'
¤ Enable doodad state for Golem Turret for Player 7 at 'Turret'
¤ Set hit points for 1 Golem Turret owned by All Players at 'Turret' to 100%
¤ End scenario in defeat for Current Player
¤ Preserve Trigger


What it's supposed to do is activate a Floor Missile Trap (Golem Turret) that was hidden underneath the destroyed Golem Factory. Player 7 is a rescuable player so when someone kills another player, they get the Golem Turret. This works perfectly when player 1 or 2 dies. The player who killed them gets the turret, and it fires. For players 3-5 the turret remains in control of player 7 and does not activate, even though players 1-5 share the same exact trigger.


confused.gif confused.gif confused.gif
Report, edit, etc...Posted by NerdyTerdy on 2005-10-31 at 19:39:55
Are you positive that's the exact trigger? I think I see why it's not working for p3-p5, but I don't see why it is working for p1 and p2. I think that p3-p5 are rescuing the turret somehow thus owning it, so that whoever kills them can't take it from p7.. It may have to do with unit placement issues.
Report, edit, etc...Posted by DT_Battlekruser on 2005-10-31 at 19:51:47
All I can think of is that coincidentally the turret is rescued by the capturing player and it just happened to work for players 1 and 2.
Report, edit, etc...Posted by dz187 on 2005-10-31 at 19:55:13
QUOTE(NerdyTerdy @ Oct 31 2005, 05:39 PM)
Are you positive that's the exact trigger?  I think I see why it's not working for p3-p5, but I don't see why it is working for p1 and p2.  I think that p3-p5 are rescuing the turret somehow thus owning it, so that whoever kills them can't take it from p7..  It may have to do with unit placement issues.
[right][snapback]345361[/snapback][/right]



I dont think p3-p5 could be rescuing it themselves because of the Kill all any unit for Current Player trigger... Placement might be an issue, but I was very careful to make sure all the turrets were placed exactly the same.
Report, edit, etc...Posted by NerdyTerdy on 2005-10-31 at 20:00:06
Visually placed the same is much different than using something such as Starforge's Snap to Grid feature which I like to use a lot. Try replacing them and see what happens then post again.
Report, edit, etc...Posted by dz187 on 2005-11-01 at 02:29:44
Ok, I redid the trigger so it doesnt use a rescuable unit anymore

Trigger
Players:
¤ Player 1
Conditions:
¤ Current player kills exactly 1 Golem Factory
¤ 'Kill Factory 1-1' is cleared (player x kills 1 factory)
Actions:
¤ Set 'Kill Factory 1-1'
¤ Give all Golem Turret owned by Player 7 at 'Turret' to Current Player
¤ Preserve Trigger


This new trigger is doing some odd things. It seems that a player's turret is enabled only when killing players numbered lower than themself (p3 is only rewarded for killing p1 or p2).



Player killing
Player killed who yields working turret

P1


P2
p1

P3
p1
p2


P4
p1
p2
p3


P5
p1
p2
p3
p4



Any ideas?
Report, edit, etc...Posted by Oo.Turin.oO on 2005-11-01 at 20:40:37
What is the significance of the switch?
Report, edit, etc...Posted by RedNara on 2005-11-01 at 20:44:27
i bet there is another trigger that goes along with it... tell you the turth i dont know..
Report, edit, etc...Posted by Oo.Turin.oO on 2005-11-01 at 20:55:21
Oh i know why. Its so that it doesn't preserve. If thats all you want to stop it from doing then just remove the preserve. If you want to make it so that you get one turret every time you kill a factory, then you would just have to set kills of factory to 0. You wouldn't need a switch.

ADDITION:
Okay if i read this right...you want whoever kills a golem factory to recieve a turret. So then your trigger should be the following.

Players:
-Player 1

Conditions:
-Current Player kills AT LEAST one Golem Factory

Actions:
-Give 'x number' Golem Turrets at 'location x' to Current Player
-Set Kill of Golem Factory to 0 for Current Player*
-Preserve Trigger (If this occurs every time you kill a factory.)

And then you repeat the trigger for each player.

*Optional if you want the trigger to be preserved. I am also unshure of this trigger because i cannot remember if you can or can't set kills.
Report, edit, etc...Posted by dz187 on 2005-11-01 at 22:36:42
Yeah it's so it doesnt preserve.. but I dont think I can set kills sad.gif
Report, edit, etc...Posted by in_a_biskit on 2005-11-02 at 02:18:19
No you can't set number of kills. You can set razings score if you want.

I find this interesting:
QUOTE(dz187)
Yeah it's so it doesnt preserve
Yet:
QUOTE(dz187)
Preserve Trigger
tongue.gif Note that you do still need the switch with this particular method, even when you take off "Preserve trigger", to prevent multiple players acting on the same trigger.

With your latest method, dz, triggers are run one player at a time - so Player 1's triggers are checked, then Player 2's triggers, then Player 3's, and so on. Could this explain what is happening?

I suspect that you have triggers for each player which go along the lines of: "If my bunker dies, then give turret to player 7 and defeat me." Then if a player with higher number than you dies, then your "give me your turret" trigger fires before that player's "defeat me" trigger (since triggers are checked player by player), so you're trying to grab a turret from player 7 before it has been given to player 7.

To make sure that the "defeat me" trigger is always given enough time to fire before the "give me your turret" trigger fires, you can: (i) Insert a "Wait 0 milliseconds" action sometime before you give the turret, or (ii) Add the condition, "Player 7 commands at least 1 turret".

Veritaserum's method works if you change the conditions and actions to affect razings score rather than kills number, and bunkers are the only things that can give razings score. (Do turrets give razings score?) In this case, you still need some method such as mentioned above to make sure that (i) you can find which turret to give, and (ii) the trigger won't activate before another required trigger (such as the "defeat me" trigger) under a different player activates.

But your method should also work, if my hunch is correct.
Report, edit, etc...Posted by Red2Blue on 2005-11-02 at 03:26:01
Okay so what im hearing is that you want to make it so you have the turret to be given to the player that suceeds in killing the bunker.

Okay. Theres a few ways in doing this.

The easiest way that I can think of is:

SET-UP
=====
-Setting a switch for each active player retaining one switch ('activep#' set for each active player.
-Creating a bunker for each active player.

ACTION
=====
-When a player# sucessfully razes one bunker, and if a player# suddenly has a set switch for 'activep#' but does not have a bunker, activate a switch based on the conditions of:

(under player 1 tab)
Player 1 has 1 raze of bunker.
Player 1 commands at least one bunker.
Player 2 switch 'activep2' set.
Player 2 commands 0 bunker.

With the actions:

Clear 'activep2'
Give all 'turret' owned by all players at 'player 2 location' to Player 1
Set kills of bunker for current player to 0
(and then whatever triggers here, like removing units etc.)

thats it.

Create a trigger every player.

The trigger must be for each player tab.

There are other ways of doing this, but this is just the easiest to understand way.

I know there are certain times when a two players kill two bunkers at a time, but those cases are too rare and will happen 1/100000000000 games.

The idea here is that only one bunker must die at a time so that two of these triggers do not occur at the same time and because ONLY one bunker can be killed at a time and ONLY one player has the switch set but does not command a bunker, the trigger guarntees that the player who kills the bunker will recieve the turret the losing player holds. Clearing the activep# switch ensures that the turrets aren't given away at the same location twice.
Report, edit, etc...Posted by Oo.Turin.oO on 2005-11-02 at 19:22:47
QUOTE(dz187 @ Nov 1 2005, 07:36 PM)
Yeah it's so it doesnt preserve.. but I dont think I can set kills sad.gif
[right][snapback]346603[/snapback][/right]

If its so it doesn't preserve then just do this:
QUOTE(Veritaserum @ Nov 1 2005, 05:55 PM)
Oh i know why. Its so that it doesn't preserve. If thats all you want to stop it from doing then just remove the preserve. If you want to make it so that you get one turret every time you kill a factory, then you would just have to set kills of factory to 0. You wouldn't need a switch.

ADDITION:
Players:
-Player 1

Conditions:
-Current Player kills AT LEAST one Golem Factory

Actions:
-Give 'x number' Golem Turrets at 'location x' to Current Player

And then you repeat the trigger for each player.
[right][snapback]346439[/snapback][/right]

Report, edit, etc...Posted by in_a_biskit on 2005-11-03 at 00:33:32
- Red2Blue: You cannot "set kills of bunker to 0". You can set razings score if you want, though this might be practical only if turrets don't give razings score.

- Veritaserum: dz187 wants to make triggers to the effect of "when a player X kills the bunker belonging to player Y, defeat player Y and give Y's turret to X". As I understand it, when he said "so it doesn't preserve", he more accurately meant "so that although the trigger is checked by all human players, it will only fire for one of them", rather than "so that each player can only obtain one turret". He was planning to make a separate trigger for the first bunker death, then the second, the third, fourth and fifth.

- dz187: You have a pretty good idea about how to do this, but your condition "current player kills exactly n bunker" doesn't quite work because the second bunker being killed doesn't necessarily mean that some player has exactly 2 kills.

The way you're currently trying to do this is:
  1. When a player dies, defeat them and give their turret to p7.
  2. Give the p7 turret to the player that killed the bunker.
___________

A integrated version of Veritaserums' method into yours seems good to me - if killing turrets doesn't contribute to razings score. 3 triggers along the lines of:
  1. All human players
    if command at most 0 bunker
    then give turret to p7 and kill all units for current player (no preserve)
  2. All human players
    if razings score at least/exactly 150 and p7 command at least 1 turret
    then subtract 150/set to 0 razings score and give 1 p7 turret to current player (preserve)
  3. All human players
    if command at most 0 bunker and p7 command at most 0 turret
    then defeat (no preserve)
__________

Red2Blue's method works, but likewise requires that killing turrets do not contribute to razings score. (Would someone mind testing to see if turrets contribute to razings score or not, please?) If turrets do contribute to razings score, you might try adding the trigger:
- All human players
if razings score exactly {turret score}
then set razings score to 0 (preserve)
Report, edit, etc...Posted by dz187 on 2005-11-03 at 03:47:14
Thanks in a biskit, i needed the player 7 commands 1 turret condition! I'll be sure to upload Golem Madness balanced when I get the last bugs out of it.

Solved.

Just uploaded to my server, let me know if you find any bugs biggrin.gif

http://www.globalanarchy.org/golems.zip
Next Page (1)