Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Wait blocks wrecking RPG map
Wait blocks wrecking RPG map
Dec 24 2010, 1:20 am
By: The_UrChai  

Dec 24 2010, 1:20 am The_UrChai Post #1



My map needs hyper triggers to work well and I have a spell that goes like such: It follows the observer and keeps creating scouts at that location to attack.

Conditions: Blah Blah cast spell stuff
Actions: Center location over (spellcaster)
Create 1 (spell centerer) at location
Center location over (spell centerer)
Create 2 (spell attackers) at location
wait 200ms
Kill 2 (spell attackers)
Center location over (spell centerer)
Create 2 (spell attackers) at location
wait 200ms
Kill 2 (spell attackers)
Preserve trigger

The wait triggers make it really slow and long.
I heard you can use death counters to avoid wait blocks but I'm not sure how to go about doing this.



None.

Dec 24 2010, 3:10 am Jesusfreak Post #2



First you need a death counter, preferably something not used in your map. Ie, Cantina.

Make a trigger saying that

Conditions:
Current Player suffers at least 1 deaths of Cantina
Actions:
Modify deaths for Current Player: Add 1 for Cantina
Preserve Trigger

Now, 11.9 (about 12) death counts is equal to one second with hypertriggers. So, 2.4 death counters is equal to 200 milliseconds... hrm, that might be a problem. May have to round a bit, if that's ok with you.

Conditions:
Current Player suffers at least 4 deaths of Cantina
Actions
(do whatever the spell is supposed to do)
Modify deaths for Current Player: Set to 0 for Cantina (or set to 1 if you want the timer to restart)
Preserve trigger


I don't think I explained it very well... gah :(.



None.

Dec 24 2010, 3:24 am The_UrChai Post #3



That's what I thought. I'll need to break up the trigger into multiple parts because of the multiple waits correct? What I want is for it to do the first part of the spell then do it again so it'll look like:
SPELL
Conditions: cast spell (built zealot at location)
Actions:set switch (death counter)
Kill zealot at location
preserve trigger
DEATH COUNTER
Conditions: switch death counter is set
action: add 2 for unused unit
preserve trigger

SPELL ACTIONS:
Condition: deaths is 2 unused unit for current player
Actions do spell attack
set deaths to 3 of unused unit for current player
preserve trigger

SPELL ACTIONS: (I want it to attack twice per spell cast)
Conditions: Deaths 5 for unused unit
Actions: Spell attack
clear switch Death counter
preserve trigger



None.

Dec 24 2010, 4:20 am Vrael Post #4



If you're properly using hyper triggers in your map, each trigger cycles runs after ~ 1/12 of a second, roughly 84ms, so we typically use the conversion rate 12 death counts = 1 second. So 168ms = 2 DC, and 252 ms = 3 DC. Unfortunately you can't do exactly 200ms, but who can tell the difference. I'll use 168ms instead. The way I would set up your triggers is like this:

Code
Conditions:
Exactly 0 deaths of DC
Bring 1 zealot to Spell area

Actions:
Set DC to 5
Center Spell Location
Create 2 Spell Unit @ Spell Location
preserve trigger


Code
Conditions:
Exactly 3 deaths of DC

Actions:
Center Spell Location
Kill 2 Spell Unit @ Spell Location
Create 2 Spell Unit @ Spell Location
preserve trigger


Code
Conditions:
Exactly 1 deaths of DC

Actions:
Center Spell Location
Kill 2 Spell Unit @ Spell Location
preserve trigger


Code
Conditions:
Current player has suffered at least 1 deaths of DC

Actions:
Subtract 1 deaths of DC for current player
preserve trigger




None.

Dec 24 2010, 5:20 am The_UrChai Post #5



It works great! except I was busy adding the triggers before your advice Vrael, so I used an add unit death instead of a subtract unit death. I ended up using the wait trigger for the last spell attack to add a sort of spell duration variability to make it interesting. Well that should be the most complicated of my spells so all thats left is the time consuming spells and balancing it all. :D



None.

Dec 24 2010, 10:20 pm DavidJCobb Post #6



Wait -- you're using deaths for Current Player, and it's not breaking? Because I used the Deaths condition and Set Deaths action for Current Player units in a vehicle system I made a long time ago, and it seemed to treat Current Player like a separate (extended) player.

Also, guys, we have a "trigger" BBCode. Just press the "Trigger" button, and you can type stuff in to get a formatted Trigger.

Trigger
Players
  • Player 2
  • Force 3
  • Conditions
  • Current Player has suffered 3 deaths of Terran Marine.
  • Actions
  • Preserve trigger.




  • None.

    Dec 25 2010, 12:47 am The_UrChai Post #7



    Quote from DavidJCobb
    Wait -- you're using deaths for Current Player, and it's not breaking? Because I used the Deaths condition and Set Deaths action for Current Player units in a vehicle system I made a long time ago, and it seemed to treat Current Player like a separate (extended) player.
    Well it works for me. Haven't really gotten to test multiplayer.



    None.

    Dec 25 2010, 12:50 am Kaias Post #8



    Quote from DavidJCobb
    Wait -- you're using deaths for Current Player, and it's not breaking? Because I used the Deaths condition and Set Deaths action for Current Player units in a vehicle system I made a long time ago, and it seemed to treat Current Player like a separate (extended) player.

    Also, guys, we have a "trigger" BBCode. Just press the "Trigger" button, and you can type stuff in to get a formatted Trigger.

    Trigger
    Players
  • Player 2
  • Force 3
  • Conditions
  • Current Player has suffered 3 deaths of Terran Marine.
  • Actions
  • Preserve trigger.
  • Current player works just fine.

    Your Demo trigger would be run once for each player in Force 3 and Player 2 (Player 2 at most once if also in Force 3) in the order of first player to eighth player (whichever are in trigger owners) each time with that player owner in place of current player.

    But I'm sure you know all that.



    None.

    Dec 25 2010, 1:54 am DavidJCobb Post #9



    Quote from Kaias
    Quote from DavidJCobb
    Wait -- you're using deaths for Current Player, and it's not breaking? Because I used the Deaths condition and Set Deaths action for Current Player units in a vehicle system I made a long time ago, and it seemed to treat Current Player like a separate (extended) player.

    Also, guys, we have a "trigger" BBCode. Just press the "Trigger" button, and you can type stuff in to get a formatted Trigger.

    Trigger
    Players
  • Player 2
  • Force 3
  • Conditions
  • Current Player has suffered 3 deaths of Terran Marine.
  • Actions
  • Preserve trigger.
  • Current player works just fine.

    Your Demo trigger would be run once for each player in Force 3 and Player 2 (Player 2 at most once if also in Force 3) in the order of first player to eighth player (whichever are in trigger owners) each time with that player owner in place of current player.

    But I'm sure you know all that.
    I know how Current Player works. It just didn't seem to work with DCs when I used it. The trigs ran for each player in the game, but when it came to the DCs, it seemed to use the same counter for all players -- as if Current Player were given its own DCs.



    None.

    Dec 25 2010, 6:07 am NudeRaider Post #10

    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

    DJC please don't confuse shadow. DCs for Current Player is a standard method we're using for years. It's definitely working.
    When you got a problem with them, make a thread about it and we'll solve the problem but please refrain from spreading false rumors.




    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [02:24 am]
    razorback9423 -- Immortal Hardened Shields (idk how to recreate them, maybe weapon_damage.cpp)
    [02:24 am]
    razorback9423 -- Let shields regenerate first before health
    [02:23 am]
    razorback9423 -- Increase armor while burrowed
    [02:23 am]
    razorback9423 -- Here are some GPTP ideas
    [11:05 pm]
    Suicidal Insanity -- NudeRaider
    NudeRaider shouted: Suicidal Insanity so it is true, but still silly
    You still have not explained why not dropping support for mac users is silly
    [06:57 pm]
    Ultraviolet -- Sometimes we need reminders of our childhood wisdom ;)
    [05:00 pm]
    KrayZee -- Ultraviolet
    Ultraviolet shouted: KrayZee Seems like you already know the answer. Don't feed the trolls
    Funny that you write that. Someone just told me the exact same thing but about another person in that same forum who is acting pretty dumb. :bleh:
    [04:32 pm]
    Ultraviolet -- KrayZee
    KrayZee shouted: How does one deal with a narcissist who is making things up, exaggerates their statements using words like "worst experience in my life" as to put emphasis in declaring trivial things, can't admit they are wrong and likes to escalate a situation that wasn't even a problem in the first place? I'm already at the point of just straight up ignoring this person and reporting em to forum moderators.
    Seems like you already know the answer. Don't feed the trolls
    [04:20 pm]
    NudeRaider -- Suicidal Insanity
    Suicidal Insanity shouted: There was a blue post to that effect, why would it be silly?
    so it is true, but still silly
    [04:20 pm]
    NudeRaider -- Suicidal Insanity
    Suicidal Insanity shouted: There was a blue post to that effect, why would it be silly?
    not sure if there's a misunderstanding, because obviously blue posts can be silly as well.
    Please log in to shout.


    Members Online: Roy, Vanezaq60, Vassilaq1, DarkenedFantasies, SiberianTiger, Zoan, nowicjusz128630