| 01-30-2006, 07:04 PM | #1 |
Greetings. For certain reasons, I'd like to prevent a slot that's been filled by a computer player from performing even the most basic AI functions, like returning to its guard position. Using the AI action to make each unit ignore its guard position is inadequate because it stops whatever the unit may be doing when the action is issued. Thanks for any help you can provide. |
| 01-30-2006, 07:36 PM | #2 |
Make neutral use the slot instead of computer? |
| 01-31-2006, 05:01 AM | #3 |
It's meant to replace a player. Any of the player slots can be filled with a computer, but the blasted Guard Position is a serious setback to being able to actually play with that player as an ally. |
| 01-31-2006, 05:40 AM | #4 |
Have you tried using the Jass function RemoveGuardPosition and/or RemoveAllGuardPositions ? I believe the latter just calls the former on all units currently owned by the relevant player, so if you make new units you might need to remove their guard position also. |
| 01-31-2006, 06:50 AM | #5 | |
Actually, yes. Quote:
And I looked, but did not find. This is the contents of common.j which contains the function to ignore guard position: JASS://============================================================================ // Computer AI interface // native StartMeleeAI takes player num, string script returns nothing native StartCampaignAI takes player num, string script returns nothing native CommandAI takes player num, integer command, integer data returns nothing native PauseCompAI takes player p, boolean pause returns nothing native GetAIDifficulty takes player num returns aidifficulty native RemoveGuardPosition takes unit hUnit returns nothing native RecycleGuardPosition takes unit hUnit returns nothing native RemoveAllGuardPositions takes player num returns nothing //============================================================================ PauseCompAI is the only one that looked fruitful to me, but setting a player number to "false", no matter what else it may have done, did not prevent it from recognizing the guard position, so evidently there's no lovin' to be had from this. However, I don't know a darn thing about AI. I hope someone does, and has a suggestion. Anything would be great. |
| 01-31-2006, 07:26 AM | #6 | |
Quote:
|
| 01-31-2006, 12:11 PM | #7 |
I think the computer AI is supposed to take over when the player leaves, and therefore it becomes a problem. |
| 01-31-2006, 01:32 PM | #8 |
nope, when a player leaves no matter if you set the controller of the player to MAP_CONTROL_COMPUTER the computer ai will not do anything. I think that the return to guard place is actually an order, what if you detect that order and reorder the unit correcty? |
| 01-31-2006, 04:14 PM | #9 | |
Quote:
If returning to the guard position is an order, I could issue the command to lose the guard position at that time, which would be ideal. I'll test; thanks Vex! |
| 01-31-2006, 10:29 PM | #11 |
you should use BJDebugMsg(I2S(GetIssuedOrderId())) instead. Most likelly those orders don't have orderstrings |
| 02-01-2006, 12:29 AM | #12 |
My standard setup for debugging maps is this one: Trigger: This way its easy to see which orders have orderstrings and which dont. I also made an order-browser multiboard once, where i can browse through all the ids and strings with up- and down-key. |
| 02-01-2006, 07:24 AM | #14 |
Could you not just ignore guard position when the unit spawns and then manually order it to move to rally point? Surely there's a function that gives you the rally location of a building? |
| 02-01-2006, 07:33 AM | #15 |
That was the previous solution. However, there are gaping flaws in the older triggers that I have which do just that, mostly revolving around players setting allied players' rally points and queued rally point positions. More foolproof triggers would require substantial work and would still never be as trustworthy as using Blizzard's hardcoded rally point system. It is because of this that I'm pursuing using that system despite the obstacles. |
