| 01-13-2005, 01:47 AM | #1 |
I on my footman map now and the problem is i dunno where to start doing AI trigger cause there have 4 team T_T dunno how to lead em to each other base and order unit own by comp back to it's base when it low hp could anyone know jass help me ![]() |
| 01-13-2005, 02:07 AM | #2 | |
Guest | Quote:
I believe you can use GUI. As each unit is created, you can 'issue order to attack move to a point' - that point being the enemy base. Getting them to come back may be slightly harder, but you could measure their health, and if it is less than a certain percentage (there is a condition in the GUI for this), then 'issue order to move to a point' - this time the point being the home base. Since I often put a player's 'starting location' within the player's team's base, the point will be the unit's owner's starting location. I know this is not JASS, but hopefully it helps somewhat. |
| 01-13-2005, 02:18 AM | #3 |
So for trigger i can do everything u mean but it's will cause lag by checking % life of unit and there 4 team so i dont know how to order comp to attack another 3 team >_< anyway thx for help ;) |
| 01-13-2005, 02:40 AM | #4 | ||
Guest | Quote:
You're perfectly right re the lag with checking % health however. If anyone has any suggestions, I would love to hear them too - especially cause I could do with a good trigger that solves this problem. Quote:
I really don't see the problem you have with the attack trigger - perhaps I misunderstand what you are requiring. Let's look at the problem from Team 1. From what you are saying, you want units to be created in Team 1's base, and will march out to attack one of the other three bases ie to attack either Team 2, 3, or 4. Now I don't know what units you are sending etc and whether there is to be equal armies to be sent out to attack each of the three teams or what so here's a few scenarios and hopefully one of them is what you need: A. Given that units are created for Team 1. There is an equal number of units sent to each of the three enemy teams. Well, that's easy - just create a unit, issue order to attack team 2, as described previously; then create a unit, issue order to attack team 3; create a unit, issue order to attack team 4. Rinse and repeat, or so they say... B. Units created randomly attack one of the three enemy teams - ie in each wave, there may be 4 units from Team 1 attacking Team 2, 5 attacking Team 3, and 6 attacking Team 4, the exact number of units being random. Well, that's like in A above, except after each created unit, you will need to add an action to set a variable integer as a random number between 2 and 4 - this random number determines whether the unit created attacks Team 2, 3, or 4. C. Your problem is in sending the units to attack the next team after the base of the first team is destroyed - scenario is that units attacking Team 2 move on to attack Team 3 once Team 2 is defeated. One way to do it could be to use a waypoint system - Kattana's Waypoint System comes to mind. That's JASS. But since I'm incompetent in JASS, to put it mildly, this would be my way of doing it: Say team 2 is defeated when their castle is destroyed. I would create a region smaller than the castle and put it within the ground that the castle is standing in - let's call it Waypoint2. Thus the only way units can stand in this region is if the castle is destroyed. Units attacking team 2 are told to attack-move to this region. Thus you can create a trigger that says: E: Unit enters waypoint2 C: triggering unit belongs to player 1 (or team 1 or whatever) A: Issue order to triggering unit to attack move to waypoint3 Waypoint3 is the equivalent to Waypoint2 but for Team 3's base. D. The problem is in getting a unit that has gone back to Team 1 to heal to go out and attack again. Well...as you pointed out accurately, my methods regarding this are likely to become laggy...but the idea is to make a region around the fountain of health or wherever the healing spot is, and measure the health of units within this region...if their health is 100% then to assign a place to attack... Admittedly, my solution for case D is inadequate - if anybody can help out here I would appreciate it since I could use a solution for this sort of case as well. Sorry it's so long, but hopefully something in there is exactly what you are looking for... |
| 01-13-2005, 05:41 AM | #5 | |
Quote:
1-My map is a footman map type so it's allow 12 player to play with 4 team(each team has 3 player) 2-I done everything about spawn unit or upgrade so now the only problem is create AI >_< 3-With 4 team then it's really hard to order comp attack which team from 3 another team(it's not hard but may it's will take alot of trigger to order em and may cause lag too >_<) -I have think of something now so may i will create 1 unit and give unit an point ability so that when he point where it's will order all unit own by comp attack move to there ^_^ -I have read all u post it's really good but i cant apply so thanks anyway ^_^ |
| 01-13-2005, 02:13 PM | #6 |
what i did for a temp AI on my footies map, because they spawn using the "factory abilty" the one the pocket facory has, the units actually follow the waypoint. So at map intialization, i just set a waypoint for the center for the computer players and then the computer players just run out there and fight... if one wins, it sits around until more come... i am going to fine tune it a bit more... but its good enough... also share control to other players... i suggest using a trigger. |
| 01-13-2005, 11:46 PM | #7 | |
Quote:
|
| 01-14-2005, 05:09 AM | #8 |
you base it off the factory ability... you can do it numerous ways. all you do is set the leash range to 9999999 (thats how far they go until they die, the 9999999 is pretty much the whole map) also you need to set the duration to 0 (that makes them permanant) and make it summon the units you want. you can a have a seperate ability for each unit summoned, or you could have in levels eg. Code:
Lvl1 = peon, Lvl2 = Grunt, Lvl 3 = Raider. Lvl1 = peasant, Lvl 2 = Footmen, Lvl3 = Knight. what i personally did was create a spawn ability for each unit, and then added the option to "quick spawn" units for base defense... which basically made the units spawn 2 times quicker but would die if they left the base (leash range 1100). All i did was make the ability 2 levels, and made a dummy ability called "spawn change" which changed the lvl of the abilt. if you want, my msn is [email protected], add me and i can arrange to show u my footies map im making (no where near done) |
| 01-15-2005, 02:51 AM | #9 |
>_< so unlucky that i aldready made unit spawn by trigger and it's work well so now i dont need change it the only problem is making an good AI with less trigger T_T anyway thanks for help |
| 01-15-2005, 10:53 AM | #10 |
i still recomend that you change to using the factory, it makes it a whole lot easier and the units follow the spawn point. mayeb you should post this in the AI section if you want more complex results |
