Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Replicating Triggers
Replicating Triggers
Jan 13 2008, 5:33 pm
By: fm47  

Jan 18 2008, 10:11 pm fm47 Post #21



actually, i posted wrong >_< what I had was

player 1
C: player 8 suffers 0 death
A: center location on hero
A: add death counter for player 8

repeat for player 2, 3, and 4.
On player 8, the computer player

C: current player suffered at exactly 4
A: set death counter to 0



Quote from NudeRaider
Lol... that won't work right. The wait(0) forces to sc to execute the next center location in the NEXT trigger loop. Here's an example what might happen when hyper triggers are running: Trigger loop 1: P1's triggers: Spell: Heal yourself (P1): Set HP of all [men] of P1 @ 'global' to 100% P8's triggers haven't fired yet, so the location is NOT CENTERED ON ANYTHING YET. P2's triggers: Spell: Kill foes (P1): Kill all [men] by 'foes' @ 'global' P8's triggers haven't fired yet, so the location is NOT CENTERED ON ANYTHING YET. P8's triggers: Move Location on [men] by P1 (wait(0)) Trigger loop 2: P1's triggers: Spell: Heal yourself (P1): Set HP of all [men] of P1 @ 'global' to 100% This one will work, as the location IS centered on P1 (coincidentially) P2's triggers: Spell: Kill foes (P1): Kill all [men] by 'foes' @ 'global' The spell works, as the location is centered on P1 (coincidentially) P8's triggers: ... continue after wait: Move Location on [men] by P2 Trigger loop 3: P1's triggers: Spell: Heal yourself (P1): Set HP of all [men] of P1 @ 'global' to 100% This won't work, as the location IS centered on P2 P2's triggers: Spell: Kill foes (P1): Kill all [men] by 'foes' @ 'global' The spell won't work, as the location is centered on P2 P8's triggers: Move Location on [men] by P1 (wait(0)) Trigger loop 4: ==&gt; repeat from trigger loop 2 As you can see it works every 2nd trigger loop (and even less reliable with more players). Why don't you just use the triggers I have suggested? (Center location trigger owned by human players, executing for current player). You won't find an easier solution for a jumping location.

because i'm not entirely clear on what you're saying xD I'm not sure why all the healing is going on and the killing



None.

Jan 18 2008, 11:44 pm NudeRaider Post #22

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

Quote from fm47
because i'm not entirely clear on what you're saying xD I'm not sure why all the healing is going on and the killing
Oh man.... ITS JUST AN EXAMPLE. I could have taken ANY trigger.
But I tried to use something that makes sense (at least a bit) so you can better imagine what is happening. Thought that would be better then just theorizing...

Post has been edited 1 time(s), last time on Jan 18 2008, 11:53 pm by NudeRaider.




Jan 18 2008, 11:50 pm NudeRaider Post #23

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

Quote from fm47
actually, i posted wrong >_< what I had was

player 1
C: player 8 suffers 0 death
A: center location on hero
A: add death counter for player 8

repeat for player 2, 3, and 4.
On player 8, the computer player

C: current player suffered at exactly 4
A: set death counter to 0
As you already noticed, this won't work either when not all players are present. You could fix it though, but why?

I posted a very simple solution. And this is the last time I tell you to use it.

If you don't understand what I did in Post #14, the tell me and I'll give more explanation, but stop ignoring it!




Jan 19 2008, 2:19 pm fm47 Post #24



On #14:
"As you can easily see P2's kill spell will not take effect, as the location was already moved on P2."

Why would it not work if it's on P2?

And WOW i posted my trigs wrong again... basically a death counter is added when the trigger hits player 8, the computer player. As it cycles through again, it checks which player has the corresponding death counter condition and centers to that.
P1 = 0dc
p2 = 1dc
p3 = 2dc
p4 = 3dc
once it hits 4dc it resets to 0.

ALSO, I'm not trying to ignore your suggestion, and I understand it's just an example, but I suppose I'm just slow, could you write out the trigs more specifically?



None.

Jan 19 2008, 4:30 pm NudeRaider Post #25

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

I don't know how to write this general rule easier, I guess you just have to learn it.

For the global follow location you have to know trigger order:
First are ALL triggers of Player 1 checked, then ALL of P2, and so on.
That is valid despite the fact that you see another order in scmd if you mark the triggers of every player.
If there's a trigger owned by P2 above another of P1, P2's trigger is NOT executed before ALL of P1's triggers are done.

Now when you have a jumping location you have to execute all spells or w/e that take place at a player OWNED BY THAT SAME player.

Ok here the same example with more details: P1 is Force1 and enemy to P2 which is Force2.
P1's triggers:

1st trigger:

Players:
P1, P2
Condition:
Always
Actions:
Move location labelled 'global' on [men] owned by Current Player
preserve trigger

2nd trigger:
Players:
P1
Condition:
what ever triggers this fictional spell
Actions:
Comment("Spell: Heal yourself (P1)")
Set HP of all [men] of P1 at 'global' to 100%
any action that will make the condition untrue
preserve trigger

P2's triggers:

1st trigger:
Players:
P1, P2
Condition:
Always
Actions:
Move location labelled 'global' on [men] owned by Current Player
preserve trigger

2nd trigger:
Players:
P2
Condition:
what ever triggers this fictional spell
Actions:
Comment("Spell: Kill foes (Force1 = P1)")
Kill all [men] owned by 'force 1' at 'global'
any action that will make the condition untrue
preserve trigger

Note: I could as well remove the healing trigger for P1 as being NOT cross player it is working just fine.

As you can easily see P2's spell will not kill any 'foes' as the location is centered on himself (by his 1st trigger) instead on P1, which is in this case the target.
If you need something like that (cross player spell) you must set a dc or w/e and execute the spell for the target player the next trigger cycle.

Change P2's trigger like this:

2nd trigger:
Players:
P2
Condition:
what ever triggers this fictional spell
Actions:
Comment("Spell: Kill all enemies (Force 1 = P1)")
Set deaths of Force 1 to 1 for 'Kill spell'
any action that will make the condition untrue
preserve trigger

AND add a trigger like this for P1:

3rd trigger:
Players:
P1
Condition:
Current Player has suffered at least 1 deaths of 'Kill spell'
Actions:
Comment("Spell: Kill all enemies (Force 1 = P1)")
Kill all [men] owned by Current Player at 'global'
Set deaths of Current Player to 0 for 'Kill Spell'
preserve trigger


If you keep that in mind you can easily replace you 6-8 locations following each player with one global location that jumps around the players.




Jan 19 2008, 4:36 pm NudeRaider Post #26

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

Quote from fm47
On #14:
"As you can easily see P2's kill spell will not take effect, as the location was already moved on P2."

Why would it not work if it's on P2?
Because the location is on P2 but the trigger tries to kill P1's units.
" Kill all [men] owned by 'P1' at 'global' "
Ofc, when P1 is coincidentially beneath P2 it WOULD work, though optional spell FX would be centered on P2.




Jan 20 2008, 9:43 am fm47 Post #27



Ok, I kind of understand your thing now. So if I did just the part where the move location occurs, set it on all the players I want, place it at the very top of the player's trig list, it should center the location there before running through its list, then?

also, lets say I simply want the location to jump from player 1, 2, 3, then 4 heroes. That's all it does, nothing else. Then let say they're in a scenerio where they have to pick up data disks owned by computer player 8. If any of the players 1-4 bring their hero to a data disk, it would remove the disk and display "Data Retrieved".



None.

Jan 20 2008, 11:53 am who Post #28



First have a centering trigger

Players: Force 1
C:
bring at least 1 hero to anywhere
A:
center location global on hero owned by current player
preserve trigger

Then:

Players: Force 1
C:
P8 brings data disk to global
A:
remove data disk at global
display text "Data Retrieved!"
preserve trigger



None.

Jan 20 2008, 1:00 pm fm47 Post #29



Quote from someone09
First have a centering trigger Players: Force 1 C: bring at least 1 hero to anywhere A: center location global on hero owned by current player preserve trigger Then: Players: Force 1 C: P8 brings data disk to global A: remove data disk at global display text "Data Retrieved!" preserve trigger

Would this make it move on one player, check for data disk, move onto another player, check for disk again, so on so forth?



None.

Jan 20 2008, 3:08 pm NudeRaider Post #30

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

No, the trigger runs for the first player of force 1 then removes the disk, so the condition can't be met by the other players.

That means only 1 player can see the text.
Avoid that, by setting a dc for force1 instead of displaying the text
and make another trigger that checks for that dc and then displays the text (and possibly other actions) for the individual players.




Jan 20 2008, 4:41 pm fm47 Post #31



Ok, that's what I turned out doing. Hey, thank you guys for all your help =) Soon my map will be testable, i'll be posting it on the appropriate forum (whichever it was)



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:31 pm]
Vrael -- :wob:
[08:42 pm]
Ultraviolet -- :wob:
[2024-5-08. : 10:09 pm]
Ultraviolet -- let's fucking go on a madmen rage bruh
[2024-5-08. : 10:01 pm]
Vrael -- Alright fucks its time for cake and violence
[2024-5-07. : 7:47 pm]
Ultraviolet -- Yeah, I suppose there's something to that
[2024-5-06. : 5:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[2024-5-06. : 5:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[2024-5-06. : 5:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[2024-5-06. : 3:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[2024-5-06. : 12:51 am]
Oh_Man -- definitely EUD
Please log in to shout.


Members Online: DiearAnother, jun3hong, Ultraviolet