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.
    [07:43 am]
    NudeRaider -- Vrael
    Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
    Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
    [2024-4-29. : 6:36 pm]
    RIVE -- Nah, I'm still on Orange Box.
    [2024-4-29. : 4:36 pm]
    Oh_Man -- anyone play Outside the Box yet? it was a fun time
    [2024-4-29. : 12:52 pm]
    Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
    [2024-4-29. : 11:17 am]
    Zycorax -- :wob:
    [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
    Please log in to shout.


    Members Online: Ultraviolet, Roy