unit shop help
Apr 28 2009, 7:49 pm
By: melnikov  

Apr 28 2009, 7:49 pm melnikov Post #1



hi
i made this map. when i bring Jim Raynor(m) in location 0, it gives me the barracks and when jimmy is not at location 0, it must return the barracks to neutral but it doesn't do it.
i cannot understand where is the problem :flamer:

Quote
Trigger("All players"){
Conditions:
Command("Current Player", "Any unit", At most, 0);

Actions:
Defeat();
}

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

Trigger("All players"){
Conditions:
Command("Non Allied Victory Players", "Buildings", At most, 0);

Actions:
Victory();
}

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

Trigger("Player 1","Player 2"){
Conditions:
Bring("Current Player", "Any unit", "Location 0", Exactly, 1);

Actions:
Give Units to Player("Player 12", "Current Player", "Terran Barracks", 1, "Location 1");
}

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

Trigger("Player 1","Player 2"){
Conditions:
Command the Least At("Jim Raynor (Marine)", "Location 0");

Actions:
Give Units to Player("Current Player", "Player 12", "Terran Barracks", 1, "Location 1");
}

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


Attachments:
test.scx
Hits: 1 Size: 38.82kb

Post has been edited 1 time(s), last time on Apr 28 2009, 7:57 pm by melnikov.



None.

Apr 28 2009, 7:54 pm MadZombie Post #2



I'm not exactly a master mapper but for something as small as this maybe you should jsut post the triggers pertaining to it. Some people are lazy to actually have to dl it. :D



None.

Apr 28 2009, 8:10 pm Biophysicist Post #3



Quote
Command the Least At("Jim Raynor (Marine)", "Location 0");
Change to Bring("Current Player", "Jim Raynon (Marine)", "Location 0", Exactly, 0)



None.

Apr 29 2009, 12:54 am Falkoner Post #4



Quote from name:TassadarZeratul
Quote
Command the Least At("Jim Raynor (Marine)", "Location 0");
Change to Bring("Current Player", "Jim Raynon (Marine)", "Location 0", Exactly, 0)

He's right, this is the issue, to explain it, when everyone brings 0 units to the location, no one has the least units there, so unless you have another Jim Raynor at that location for every other player as well, this trigger won't work.



None.

Apr 29 2009, 11:54 am melnikov Post #5



Quote from name:TassadarZeratul
Quote
Command the Least At("Jim Raynor (Marine)", "Location 0");
Change to Bring("Current Player", "Jim Raynon (Marine)", "Location 0", Exactly, 0)
i tried it but it doesn't work. when jimmy is not at location 0, the barracks are again mine.



None.

Apr 29 2009, 1:00 pm 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

Look, the triggers are really easy: 2 brings

<Player owning the raynor>
C: Current Player brings at least 1 raynor to beacon
A: Give All Barracks at barracks owned by Neutral to Current Player

<Player owning the raynor>
C: Current Player brings at most 0 raynor to beacon
A: Give All Barracks at barracks owned by Current Player to Neutral

You can add a condition "Current Player brings at least 1 barracks to barracks" to the 2nd trigger to avoid unnecessary trigger firing, but that's optional.




Apr 29 2009, 5:04 pm melnikov Post #7



Quote from NudeRaider
<Player owning the raynor>
C: Current Player brings at most 0 raynor to beacon
A: Give All Barracks at barracks owned by Current Player to Neutral
it doesn't work.



None.

Apr 29 2009, 5:16 pm NudeRaider Post #8

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

It does. Do it EXACTLY like the triggers I posted.

There's no magic to it, triggers do what you're telling them.
If you tell the trigger to give the barracks from current player to neutral when 0 raynor are at the beacon location, then it will do just that.

Make sure though there's no other triggers interfering. For example, another player other than Current Player grabbing the Barracks. If you need that I can adjust the trigger accordingly.




Apr 29 2009, 5:53 pm melnikov Post #9



now when i bring Jimmy at location 0(beacon), i cannot get the barracks.
why? :flamer:

Attachments:
test.scx
Hits: 1 Size: 39.49kb



None.

Apr 29 2009, 6:11 pm 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

You use Neutral Players instead of Neutral.




Apr 29 2009, 6:18 pm Pigy_G Post #11



Quote
Do it EXACTLY like the triggers I posted.
Except add a preserve trigger.

Post has been edited 1 time(s), last time on Apr 29 2009, 9:29 pm by NudeRaider. Reason: removed wrong correction



None.

Apr 29 2009, 6:24 pm melnikov Post #12



i added a preserve trigger and it works.
arigato, mr. Pigy_G :)



None.

Apr 29 2009, 9:39 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

Just to make sure you understand it:
Preserve trigger prevents triggers from getting deleted from memory after they have run once.
So if you need it to fire only one time for the whole duration of the map, you can leave it.
If the triggers should fire every time the condition becomes true, then you need the 'preserve trigger' action.

When triggers are posted it's usually assumed that you know that and add it on your own if it's necessary.

Quote from Pigy_G
Quote
Do it EXACTLY like the triggers I posted.
Except add a preserve trigger.
The trigger will work just fine without it, but only once.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:02 pm]
NudeRaider -- PSA: ASUS apparently decided their RMA department needs to "become profitable" and for a while now outright tries to scam customers. They were called out on it a year ago, promised to change, but didn't. https://www.youtube.com/watch?v=7pMrssIrKcY so my recommendation: Stop buying ASUS, and if you already have and need something RMA'd, make sure to not let them bully you into paying.
[03:08 pm]
Oh_Man -- example of wat u mean?
[05:59 am]
NudeRaider -- *is
[05:17 am]
NudeRaider -- despite all its flaws the sound design its fantastic
[2024-5-14. : 10:29 pm]
Oh_Man -- homeworld 3 = massive disappointment
[2024-5-14. : 10:05 am]
Moose -- ya
[2024-5-14. : 5:23 am]
zsnakezz -- yes
[2024-5-12. : 8:51 pm]
l)ark_ssj9kevin -- Are you excited for Homeworld 3?
[2024-5-12. : 8:44 pm]
l)ark_ssj9kevin -- Hi Brusilov
[2024-5-12. : 4:35 pm]
O)FaRTy1billion[MM] -- Brusilov
Brusilov shouted: Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
my server that was hosting it died
Please log in to shout.


Members Online: 2madisone4322rh3