|
Thread: Scripting for AI boost - any help? | |
|
Zilonite
Famous Hero
|
posted September 04, 2008 10:47 AM |
|
|
Scripting for AI boost - any help?
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...
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted September 04, 2008 12:12 PM |
|
|
If AI cheats are not enought for you, then... we have a trouble. There is no known function which returns player controller. You may want to try IsComputer (ATTACKER) combat script placed somewhere at the beginning.
There is also GetPlayerState() function, however I did not find out what type of argument does it need and what it gives in return.
|
|
Asheera
Honorable
Undefeatable Hero
Elite Assassin
|
posted September 04, 2008 01:17 PM |
|
|
Actually, 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:
function GiveAIResources()
if IsAIPlayer(1) then
SetPlayerResource(1, 0, GetPlayerResource(1, 0) + 10)
end
end
____________
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted September 04, 2008 01:30 PM |
|
|
Ok, I think I'll have to install this 3.1 then
|
|
Asheera
Honorable
Undefeatable Hero
Elite Assassin
|
posted September 04, 2008 03:04 PM |
|
|
You didn't install it yet?
____________
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted September 04, 2008 04:24 PM |
|
|
It was just yeasterday when I saw NCF for patch 3.1
I'm also afraid that my NCF editor now won't work at all
|
|
SimonaK
Promising
Supreme Hero
|
posted September 04, 2008 09:31 PM |
|
Edited by SimonaK at 21:33, 04 Sep 2008.
|
Quote: It was just yeasterday when I saw NCF for patch 3.1
I'm also afraid that my NCF editor now won't work at all
NCF editor 3.0 works in 3.1 environment even if it still crashs sometimes
for same reasons that before.
morevoer, unknown reasons.
After some research of my share, it seems that editor crashs with slot 300 and high.
but I'm really not sure.
In fact, I don't know why editor has a bug.
it must find the bug's explication before updating to NCF editor 3.1
Don't forget too: H5's rmg crashs in NCF .exe
This is probably unfixable.
NCF hacking EXE can have limit.
This limit is maybe reached about editor.
|
|
SimonaK
Promising
Supreme Hero
|
posted September 04, 2008 09:53 PM |
|
Edited by SimonaK at 21:57, 04 Sep 2008.
|
Quote: Actually, 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
function GiveAIResources()
if IsAIPlayer(1) then
SetPlayerResource(1, 0, GetPlayerResource(1, 0) + 10)
end
An example to give 10 Wood to Player 1 if it is AI:
end
yes!
does exist a function to skip turn and another to timing?
then, we could create a script for AI when it take a too long time to play.
example:
function KickAITurn()
if IsAIPlayer(1) And TimeElapsed() >= 600 then
SkipTurn(1)
end
end
|
|
Zilonite
Famous Hero
|
posted September 05, 2008 08:02 PM |
|
|
Tnx everyone for help! "IsAIPlayer" works quite well
|
|
|