Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: AI Recall Trigger
AI Recall Trigger
May 10 2013, 12:22 am
By: Omegwavex  

May 10 2013, 12:22 am Omegwavex Post #1



Alright, so a spell im working on is suppose to recall the 4 corners of the arena. The computer has arbitors with full energy and recall researched, so Idk what's wrong. Can someone please tell me how to use the AI recall trigger?

If you need anymore info just post here.



None.

May 10 2013, 12:32 am Lanthanide Post #2



Have you followed the instructions here: http://www.staredit.net/?p=oldwiki&s=94 ?



None.

May 10 2013, 1:37 am lil-Inferno Post #3

Just here for the pie

Make sure you aren't using hero Arbiters.




May 10 2013, 3:52 am Kaias Post #4



Make sure your RunAIScriptAtLocation is run by the player that owns the arbiters.



None.

May 10 2013, 5:24 am NudeRaider Post #5

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

Maybe the condition isn't going off. Check with something noticable like creating a building over water (unplaceable error).




May 10 2013, 2:33 pm Oh_Man Post #6

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

If there are too many sprite animations the recalls won't show. Had this problem myself once.




May 10 2013, 10:25 pm Omegwavex Post #7



Alright, I got the recalls in, but I have another question.

Once the recalls start, there is suppose to be a scout spawning at each corner, then moving clockwise around the map.
I can do all the timing and stuff, just wondering if anyone knows a way so it spawns 1 scout, waits a little while, then spawns another instead of spawn spamming one, and in the end getting like, 50 scouts at 1 corner.

Everytime I use a wait for this, It freezes the trigger, even if its for 50 milliseconds.

Post has been edited 1 time(s), last time on May 10 2013, 10:58 pm by Omegwavex.



None.

May 10 2013, 11:22 pm Moose Post #8

We live in a society.

That sounds like a wait block. Three possible solutions:

1. If you are using the Wait(0)x63 type of hypers, move them to the bottom of the trigger list to prevent (most) related wait blocks.

2. Use switch hyper triggers instead. Example:
"Switch Hypers"
Trigger("Player 8"){ // <-- Can be any player GREATER than the owner of the next trigger, since this player must check triggers SECOND.
Conditions:
    Always();

Actions:
    Wait(0);
    Set Switch("Switch1", set);
    Wait(0);
    Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 7"){  // <-- Can be any player LESS THAN than the owner of the previous trigger, since this player must check triggers FIRST.
Conditions:
    Switch("Switch1", set);

Actions:
    Set Switch("Switch1", clear);
    Wait(0);
    Preserve Trigger();
}

//-----------------------------------------------------------------//


3. Eliminate the waits entirely and switch to death counter (DC) timers.




May 10 2013, 11:23 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

You're running into Wait Blocks.

It is strongly recommended that you use Death Counters as your timers instead of waits which is also the answer to delaying the scout spawns.

Basically Death counters are the equivalent of variables in programming languages. You (mis-)use the death counters of unused units to store and retrieve values. And since with Hyper Triggers you know each trigger loop is 1/8 of a game second it's easy to create a counter with which you can measure time. The counter value becomes equivalent of a certain time span so you can calculate when to spawn a scout.

For example you want to create a scout every 5 (ingame) seconds. What you do is add 1 death for cantina every trigger loop.
When cantina reaches 8 triggers / s * 5s = 40 death counts you reset the death counter of cantina to 0 and create 1 scout.




May 11 2013, 12:02 am Omegwavex Post #10



Thanks guys. My friend gave me a solution to just have a unit timer; everytime a zergling reaches location B, send it back to location A, then do the recalls and scouts.



None.

May 11 2013, 6:48 am 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

That's bad practice. You should wrap your head around the death counter system if you're at least half serious about your map.

Death counters are so much more professional, clean, reliable, precise and resource friendly than physical timers. And once you got the principle down they're even easier to implement.




May 11 2013, 3:40 pm Omegwavex Post #12



I just couldn't find a way to make DC's equal up for the computer and a player. I needed them both to end at the same time, so we just thought that adding one each time he got to Location B was a good solution.



None.

May 11 2013, 8:10 pm NudeRaider Post #13

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

There's is no reason to even them up. Set/Add them for a specific player that'll always be in the game (for example a P8 computer player) and always read them for that player. Players can read/write other player's death counts.

For example:
Trigger
Players
  • Player 7
  • Conditions
  • Player 8 has suffered at least 40 deaths of cantina
  • Actions
  • Set deaths of cantina for Player 8 to 0
  • Create Scout for Current Player at 'Spawn'
  • Preserve Trigger


  • The reason you can't "synch" the counts of different players that you have waits in your map.
    Whenever a wait runs it breaks the current trigger loop and starts a new one, meaning players with a higher number than the player number that ran the wait will run 1 less trigger loop. Or rather the other players will run an extra loop.




    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [2024-4-27. : 9:38 pm]
    NudeRaider -- Ultraviolet
    Ultraviolet shouted: NudeRaider sing it brother
    trust me, you don't wanna hear that. I defer that to the pros.
    [2024-4-27. : 7:56 pm]
    Ultraviolet -- NudeRaider
    NudeRaider shouted: "War nie wirklich weg" 🎵
    sing it brother
    [2024-4-27. : 6:24 pm]
    NudeRaider -- "War nie wirklich weg" 🎵
    [2024-4-27. : 3:33 pm]
    O)FaRTy1billion[MM] -- o sen is back
    [2024-4-27. : 1:53 am]
    Ultraviolet -- :lol:
    [2024-4-26. : 6:51 pm]
    Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
    [2024-4-26. : 6:50 pm]
    NudeRaider -- Vrael
    Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
    sounds like moisture control is often a pressing concern in your city
    [2024-4-26. : 6:50 pm]
    Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
    [2024-4-26. : 6:49 pm]
    Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
    [2024-4-26. : 6:48 pm]
    Vrael -- On this Topic, I could definitely use some Introductions.
    Please log in to shout.


    Members Online: Roy