Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [SOLVED] Creating Neutral Tanks
[SOLVED] Creating Neutral Tanks
May 11 2011, 3:37 pm
By: Inject  

May 11 2011, 3:37 pm Inject Post #1



For my map, I'm attempting to have it so that when a player sieges a tank, it removes the sieged tank, and replaces it with one that is owned by a neutral player (p9?).

My first idea, was to simply give the tank to the neutral player, whenever it sieged, and have it unsiege. I couldn't find a way to make it unsiege, so I tried this, and a variation of it with the Bring command.

Quote
Trigger("Player 1") {
Conditions:
Command("Current Player", "Edmund Duke (Siege Mode)", At Least, 1);
Actions:
Create Unit("Player 9", "Edmund Duke (Siege Tank)", 1, "Anywhere");
Remove Unit At Location("Current Player", "Edmund Duke (Siege Mode)", 1, "Anywhere");
Preserve trigger();
}

Looking at it, I can see that it wouldn't work, but I can't think of any other way for it to happen. Any help would be appreciated.



None.

May 11 2011, 4:33 pm FoxWolf1 Post #2



You need to center a location on the sieged tank, then remove it, and then create the un-sieged one for the neutral player (done by creating it for a regular player, then giving it) at that location.

Post has been edited 1 time(s), last time on May 11 2011, 4:47 pm by FoxWolf1.



None.

May 11 2011, 4:39 pm Ahli Post #3

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

1. You can't create units for players 9-12 with triggers directly.
-> You have to create them for player 1-8 and give it immediately.

2. "Command" is slower in detection that "Bring".

So a solution to your problem would be:
Trigger
Players
  • Player 1
  • Conditions
  • Current Player brings at least 1 Edmund Duke (Siege Mode) to Anywhere
  • Actions
  • Center Location MyLocation on Edmund Duke (Siege Mode) owned by Current Player in Anywhere
  • Remove 1 Edmund Duke (Siege Mode) owned by Current Player at MyLocation
  • Create 1 Edmund Duke (Siege Tank) for Current Player at MyLocation
  • Give 1 Edmund Duke (Siege Tank) owned by Current Player at MyLocation to Player 9
  • Preserve Trigger


  • edit:
    The location myLocation can be any small location. You can reuse it for other stuff where you need to "save" the position temporary.




    May 11 2011, 4:58 pm Inject Post #4



    Thank you! I tried something like that, but was creating units for P9. The tank would just disappear. Again, much thanks.



    None.

    May 12 2011, 3:45 am Lanthanide Post #5



    Quote from Ahli
    2. "Command" is slower in detection that "Bring".
    You sure? I think this is exactly opposite - Command is much faster because it doesn't have to check physical locations, it simply looks up an array that each player has showing how many units they command.

    'Bring' is also weird in that it doesn't always re-scan units before executing, eg you can have an early trigger that changes the units in a particular location, and a later 'bring' trigger for that location will still fire even though the earlier one should have made the condition fail. I had a real issue with this last night when trying to debug an alteration to my map, so ended up replacing bring with a simple death-count system instead.



    None.

    May 12 2011, 11:39 am NudeRaider Post #6

    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 Lanthanide
    Quote from Ahli
    2. "Command" is slower in detection that "Bring".
    You sure? I think this is exactly opposite - Command is much faster because it doesn't have to check physical locations, it simply looks up an array that each player has showing how many units they command.

    'Bring' is also weird in that it doesn't always re-scan units before executing, eg you can have an early trigger that changes the units in a particular location, and a later 'bring' trigger for that location will still fire even though the earlier one should have made the condition fail. I had a real issue with this last night when trying to debug an alteration to my map, so ended up replacing bring with a simple death-count system instead.
    Command may take less CPU time to calculate, but...
    http://www.staredit.net/topic/2754/
    This also tells you why bring doesn't always update and how to prevent it.




    May 12 2011, 9:15 pm Lanthanide Post #7



    Thanks, I was looking for that, thought it was a wiki page and couldn't find it.



    None.

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [10:53 pm]
    Oh_Man -- https://youtu.be/MHOZptE-_-c are yall seeing this map? it's insane
    [2024-5-04. : 1:05 am]
    Vrael -- I won't stand for people going around saying things like im not a total madman
    [2024-5-04. : 1:05 am]
    Vrael -- that's better
    [2024-5-04. : 12:39 am]
    NudeRaider -- can confirm, Vrael is a total madman
    [2024-5-03. : 10:18 pm]
    Vrael -- who says I'm not a total madman?
    [2024-5-03. : 2:26 pm]
    UndeadStar -- Vrael, since the ad messages get removed, you look like a total madman for someone that come late
    [2024-5-02. : 1:19 pm]
    Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
    [2024-5-02. : 1:35 am]
    Ultraviolet -- Vrael
    Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
    Gonna put deez sportballs in your mouth
    [2024-5-01. : 1:24 pm]
    Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
    [2024-4-30. : 5:08 pm]
    Oh_Man -- https://youtu.be/lGxUOgfmUCQ
    Please log in to shout.


    Members Online: Ultraviolet, O)FaRTy1billion[MM]