| 06-17-2003, 06:09 PM | #1 |
I want to make a buy system in my map like this: When player kills X units he will gain one peon in a region where he can buy special units with his peons. Like. If "3" peons enter region .... then he will summon that unit. How do i do so that he needs to walk in with 3/4/2 no more, no less peons to get the unit he wants? Event -Unit enters region X. Condition -Something like must be 3 units but how? Action - Create 1 X(unit) for owner of unit(entering unit) at (owner of entering unit) players start location. Plz. help me with the condition. |
| 06-17-2003, 06:19 PM | #2 |
Make an integer condition number of units in xx region = xx number |
| 06-17-2003, 06:22 PM | #3 |
I really wouldn't worry yourself too much about the condition.. Just do something like this... Three triggers. Trigger 1 : Code:
//EVENT Unit Enters a region; //ACTIONS Set totalunits equal to totalunits + 1; Trigger 2 : Code:
//EVENT Unit leaves a region; //ACTIONS Set totalunits equal to totalunits - 1; Trigger 3 : Code:
//EVENT Totalunits equal to 3; //ACTIONS Kill 3 Peons in Region; totalunits equal to totalunits - 3; Create 1 Special Unit for Triggerring Player in Region2; How's that look? |
| 06-17-2003, 06:37 PM | #4 |
Why make 3 triggers when you can make 1? Make 3 - if actons - with 3 different integer conditions checking that checks the number of peons in the region. When you have a peon slave you can make the peon follow you if you want I can send you a map with an example that includes the buy trigger? |
| 06-17-2003, 07:24 PM | #5 |
Yes, plz send me a map with the buy script because i don't understand a shit of wath playamarz say. The trigger he say i can use don't exist in my we. That i know for sure. |
| 06-17-2003, 08:11 PM | #6 |
Typon if you knew that for sure than you really don't know we that well.. And I was using very very very basic triggering to boot. Don't mean to be harsh about it, but look in we under units. It's there :) There is a reason however in why I chose three triggers as opposed to the classic "if statement".. It's because I deal with computer speed relation and having three triggers in this instance would make the map run smoother. Why you may ask? When doing the triggers.. They only execute when either... a) Unit enters a region b) Unit leaves a region c) Integer = an amount. And they only execute when needed... And when they are executed.. They perform miniscule tasks.. Now.. I know your's would only call when a unit would enter the region as well.. And that's fine.. But if you look at my third trigger... It has more than one action... For this to be one trigger.. It would have to look like this. Code:
//EVENT Unit enters a (region name placed here); //CONDITIONS Units in (region name placed here) is greater than 1; //ACTIONS if(units in(region name placed here) equal to 2) then Remove 2 Peons from (region name placed here) Else Do Nothing if(units in(region name placed here) equal to 2) then Create 1 Berserk Footman in (region name placed here) Else Do Nothing //and so on for each number... So... I'm just offerring a quicker method.. Yea it's a couple of extra triggers.. But would save time. Plus it's easier to find a trigger than code inside of a trigger... Either way though typon.. it would work for you. |
| 06-18-2003, 11:17 AM | #7 |
Here is the map. The map uses a dialog menu. Though I haven't added a number of slave trigger so now you are able to sell unlimited slaves even if you have 2. Try the map out and say what you think! :D |
