HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

AI script request.

03-17-2004, 04:58 PM#1
Alfryd
I was hoping that someone more familiar with the game's AI scripts coulkd answer a little request of mine- I want an AI script that does nothing. Is this as simple a matter as cleaning out common.ai, human.ai, etc. entirely, or are there various functions included in these files that the game engine expects to be present and need to be dummied up, to avoid a crash? Thank you for your time.
03-17-2004, 06:27 PM#2
AIAndy
hmm, I guess you need a script that only contains an empty function main.
But why would you need an empty AI script ?
03-17-2004, 07:26 PM#3
Alfryd
Actually, after a little experimentation, it seems that completely blank substitutes for common, human.ai and so forth will do the trick nicely.
As for why I would want an empty AI script, basically I need the main map script to have complete control over half the players' units, and I don't want to have to bother with interscript communication (not yet, at any rate.) So I need the standard AI lobotomised to avoid interference with my own orders.
Actually- there is one thing I'd like the script to do. How would you access and set the names of particular players?
03-18-2004, 12:49 AM#4
AIAndy
Why do you start an AI script, if you actually don't want one ?
And why would you want to set the names from AI instead of from trigger? The native is SetPlayerName.
03-18-2004, 09:39 AM#5
Alfryd
I don't want to start an AI script. I want to STOP the AI behaviour for common and human.ai, which interferes with my own script's orders.
At any rate. Is there any function for retrieving a player's name?
03-18-2004, 12:25 PM#6
AIAndy
GetPlayerName

Unless you started an AI script, there should be no AI script running. That is what makes me wonder.
So unless you somewhere have a trigger that starts the AI script human.ai, emptying human.ai will not achieve anything.
03-19-2004, 11:07 AM#7
Alfryd
It seems to be achieving *something.* All I had was an allied human computer player. When I created various units for that player, they would be moved without my orders to just above my 'town hall'. Importing a blank common and human.ai semed to fix this.
Mind you, this was on the same map where I was declaring a lot of custom constants and globals in an imported common.j, and only in test-map mode at that. Maybe that has an effect on AI script initialisation.
03-20-2004, 02:00 AM#8
AIAndy
The just above the town hall looks a lot like the behaviour of an AI script so I guess somewhere in your code such a script is started. Maybe you are using some part of the standard melee triggers ?
03-22-2004, 09:16 AM#9
Alfryd
After looking through the code, I'm fairly certain I'm not. The whole thing is pretty much entirely custom JASS script. I'm using one GUI trigger to call a few setup functions, and the occasional calls to Blizzard.j functions, but no standard melee triggers. But thanks anyways.