| 09-19-2002, 04:35 PM | #1 |
I have to problems with my triggers on a custom map that seem to be absolutely beyond my understanding. 1. I´m not sure how define User-Players that are really playing, but i need it to do dynamic assignment of the number of Heroes, every player gets. I tried to define it by creating a Player Group Array Set MarinePlayers[1]=(All players matching((((Matching Player) slot status) Equal to Is playing) and (((Matching Player) controller) Equal to User))) This Array[Index=1] should contain all User Players, actually playing, but it doesn´t seem to work. 2. I have a trigger that checks every 30 secs if the Food used of a Computer player is Equal or Less than 12. If so, new Units are spawned. The problem is, that I control the Units by putting them into a Group Array (Name[1], Name[2],...Name[16]) which works quite a while. But after some time no new units seem to be put into the existing Groups. Seems to me like the Groups are full, though I tried to remove all Units from all Groups before adding the new ones. I tried to remove them with: For each (Integer A) from 1 to 16, do (Unit Group - Pick every unit in "Name"[(Integer A)] and do (Unit Group - Remove (Picked Unit) from "Name"[(Integer A)])) Pick adresses Dead Units as well, but it doesn´t work. I´d be glad for some competent help. If it helps, I would send u the Map. Thx Gozai |
| 09-19-2002, 04:51 PM | #2 |
1. the function "AND" (as well as "OR") is bugged that it doesn't work sometimes. This could be a possible cause of your problem. Try not to use AND or OR in any triggers. 2. I heard that unit group is limited up to 12 units, just like you can only choose at most 12 units at the same time when you are playing. Though I have not tested this out myself. |
| 09-19-2002, 06:22 PM | #3 | |||
Guest | Quote:
In what way do you think they're full? If you're using Unit Group commands to order them, then there is a limit of 12 units that will actually be ordered. If you want to order them all you need to use Pick Every Unit in [unit group] and do [action] to picked unit. Quote:
How is it not working? Are they not being removed from the group? Quote:
I don't know where you got that idea, but they work fine. |
| 09-19-2002, 06:31 PM | #4 |
Guest | Your first problem seems to work fine for me. Can you give any more details on what isn't working? |
| 09-19-2002, 08:54 PM | #5 |
I don't think unit groups are capped at 12... On one of my maps, I have a unit group of 27 units, and it works perfectly. |
| 09-19-2002, 09:26 PM | #6 | |
Quote:
>1. Don´t made such experience yet. >2. I´m pretty sure that info is wrong, since i work with an Group Array with 1- 16, which works fine up to a certain point. |
| 09-19-2002, 09:32 PM | #7 | |
Quote:
> Seems so, since the new created Units just stand in their Spawn Regions and do nothing. But that happens only after a while, when before all spawns had successfully been ordered to do something. That´s why Í think, the Groups are "full" (=> containing more than 12 Units). |
| 09-19-2002, 09:46 PM | #8 | |
Quote:
2 things aren´t working. 1. I have a Unit placed on the map, and I have a Trigger saying Make (Unitname) Rescuable by MarinePlayers[1] The assignment of the players into MarinePlayers[1] is made through Event - Map Initialization The command "Make Rescuable...." later, while game is running. In a LAN game with a friend I (Player Red) can rescue the Unit, he (Player Blue) can´t. 2. I made a dynamic assignment of Heroes, depending of the number of players. ( 8 Players: 1 Hero per Player; 7 Players: Player 1 gets a second and so on. It seem to work (=LAN) but when you play alone and choose to play e.g. Blue instead of Red, than you´ll get 1 Hero and Red get´s 7, though Red is not in game. |
| 09-20-2002, 01:27 AM | #9 |
1. You guys really don't know AND and OR are bugged?!:eek: I had the experience. You can also do some search or check out the "maps & mod section" in warcraftiii.net. I think it is quite well known. Maybe the reason is that AND and OR does work sometimes but not the others. No one know yet in which situation they work or not work. So my suggestion is that try to use them only if necessary, if not neglecting them completely. 2. Sorry about the second question that I just read the information somewhere and didn't test it, so there was some decrepancy from the real problem. :p |
| 09-20-2002, 01:37 AM | #10 | ||
Quote:
Better not try to answer this again as I don't have much experience about the rescuable function, :p though I think it may have something to do with alliance or enemy status. Quote:
This is a bit troublesome and will need some semi-complicated logic sequence to make it work. Briefly, don't assignment the units to "player 1" directly. Instead, at the beginning of the game: Set CtrlPlayer(1) = the first player that are playing Set CtrlPlayer(2) = the second player that are playing ........ After all that, use CtrlPlayer(n) to assign the units and do the rest of the things in the game. |
| 09-20-2002, 08:25 AM | #11 | |||
Guest | Quote:
Rescuable doesn't work in MP. Only 1 player will be able to rescue the units (as you've experienced). You'll have to create triggers to simulate this, either with Unit withint range, or unit enters region events. Quote:
How is this related to your first problem exactly? I don't understand why you're trying to create a player array for 1, and if you are properly adding all players who are playing, and the slot is user, then there should only be 1 player in the group. What is the trigger that you're using to create the Hero units? Quote:
Funny that nobody on WC3Campaigns, War3pub, or Battle.net that I know of has experienced this. AND and OR have worked perfectly every time I use them (and I use the ALL the time). When they posted this in their big list of bugs that aren't really bugs, we called them on it and go no responce. If you can find me an example in a map, or a thread then I could see what they hell they consider to be bugged about them, then maybe I'd believe it. I can't search because "AND OR BUG" are 3 words with less than 4 letters. |
| 09-20-2002, 03:23 PM | #12 | |
Quote:
1. If "Make Unit Rescuable" doesn´t work in MP, I´m content. I just refused to use the "Unit Enter Region" method as long as I had to take into consideration that I simply made a mistake. So if your information is reliable, I can close this file. - Thank you - 2. I need a way to determine how many User Players are playing, to assign the number of Heroes every Player gets. Since none of the definitions given by W3E seem to cover this selection exactly, I decided to create a Player Group Array (>MarinePlayers[1]) with Set MarinePlayers[1]=(All players matching((((Matching Player) slot status) Equal to Is playing) and (((Matching Player) controller) Equal to User))) ....Seems to work.... I set the number of Heroes for each player by ACTION: Player Group - Pick every player in MarinePlayers[1] and do (Unit - Create 1 "CustomUnit" for (Picked player) at (Random Point in "Start Region" <gen>) facing....) ACTION: If (((Number of players in MarinePlayers[1]) Less than 9) and ((Number of players in MarinePlayers[1]) Greater than 3)) then do (For each (Integer A) from 1 to (8 - (Number of players in MarinePlayers[1])), do (Unit - Create 1 "Custom Unit" for (Player((Integer A))) at (Random point...)) ACTION: .....Action for 3 players.... ACTION: .....Action for 1-2 players.... Effect: see above |
| 09-20-2002, 03:56 PM | #13 |
Neither and nor or is bugged. Like everyone else who understands the logic of these functions, I am pretty sure they always work. Excerpt from Blizzard.j: Code:
//===========================================================================
function GetBooleanAnd takes boolean valueA, boolean valueB returns boolean
return valueA and valueB
endfunction
//===========================================================================
function GetBooleanOr takes boolean valueA, boolean valueB returns boolean
return valueA or valueB
endfunctionThese are the functions that are used when you use and or or via GUI. There's absolutely nothing wrong with them. The only reason it isn't working could be that you have no programming experience and are using them totally wrong. Like DOM I want to see a proof for your allegation. |
| 09-20-2002, 06:49 PM | #14 | |
Guest | Quote:
Well, you're using a For Loop and Integer A to give units to players. At this point, you're not using your Player group in any way. You're always telling it to give the unit(s) to Player(1) on the first loop, then Player(2) etc. Try it in MP and move into the Player 5 slot and I think you'll notice that it is bugged then too (Only Red and Blue will get units). If you want to fix this fairly easily without changing your triggers too much, what you want to do is create a Player Array (there is no reason for your Group to be an Array BTW) at at initialization do something like: For 1 to 12 do If (player(integerA)) is playing and (player(integerA) controlled by user then Run - Add Player else do nothing Trigger: Add Player Actions: Set PlayerArray[PlayerCount] = Player(IntegerA) Set PlayerCount = PlayerCount + 1 (PlayerCount should be an initial value of 1) Then in your triggers that create the units, use PlayerArray[IntegerA] instead of (player(integerA)). |
| 09-21-2002, 02:00 PM | #15 |
superiki and drunkom: Here is the link you want: http://mods.warcraftiii.net/article....1&action=part1 If you guys still don't belief, try to ask around at warcraftiii.net instead. I remember people there had some big discussion about this issue. But then I think I had gone too far. If AND and OR works 90% of the time and not in 10%, which is likely the case now, you can still use them but if thing goes wrong, think about them as a possible cause. Hmmm.....concerning about programming experience, I'd say when I first started programming, there were still several years that warcraft 1 is out. Of course, knowing several programming languages doesn't make me know every languages, (in fact, I don't know JASS and not going to learn it) but the logic behind all of them are more or less the same. :cool: |
