Scripting for AI boost - any help?

Maps and the art of mapmaking.
Zilonite
Leprechaun
Leprechaun
Posts: 26
Joined: 06 Jan 2006

Scripting for AI boost - any help?

Unread postby Zilonite » 04 Sep 2008, 09:28

Hi all,

Does anyone know how to write scripting command that would add resouces to particular player only in case if that player is AI? Any help appreciated... ;|

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 04 Sep 2008, 10:28

There is a new function in 3.1 patch that allows to learn whether the player is AI or not.

And by the way, on Hero difficulty AI cheats by itself. It has unlimited resources :)

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 04 Sep 2008, 10:28

There is a new function in 3.1 patch that allows to learn whether the player is AI or not.

And by the way, on Hero difficulty AI cheats by itself. It has unlimited resources :)

User avatar
Asheera
Round Table Knight
Round Table Knight
Posts: 4506
Joined: 06 Jul 2008
Location: The Shadows
Contact:

Unread postby Asheera » 04 Sep 2008, 11:41

In 3.1 there is a new function for testing if a particular player is AI ;)

IsAIPlayer(player_id) -- returns 0 if specified player is human, and 1 otherwise


An example to give 10 Wood to Player 1 if it is AI:

Code: Select all

function GiveAIResources()
   if IsAIPlayer(1) then
     SetPlayerResource(1, 0, GetPlayerResource(1, 0) + 10)
   end
end
No matter how powerful one becomes, there is always someone stronger. That's why I'm in a constant pursuit of power, so I can be prepared when an enemy tries to take advantage of me.

Zilonite
Leprechaun
Leprechaun
Posts: 26
Joined: 06 Jan 2006

Unread postby Zilonite » 04 Sep 2008, 15:13

Tnx a lot, got it working :)

Ah, poor, dumb AI, so much headache to make him at least half-decent... :(


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 0 guests