|Posted By: Andrew (2007-03-21 15:06:34) |
You can set the default movement for units (non-AI) by modifying the city.js.
Similar code could be used for ports, factories and air bases (stingers only!).
Its a pretty broad brush. You can apply it to entire unit types, not individual units.
It will not work with games already started.
Code as follows:
You will modify the "function createUnit( unit );"
Find the "if( !isBlank( unit ) ) return true" line.
Add the following below it:
// Based on the player type human or computer, create and
// fill the default move variable.
// NOTE: Not doing this will cripple the AI.
var ajmDefaultMove = "";
if( getPlayerType( player ) == "computer" )
ajmDefaultMove = "explore";
ajmDefaultMove = "stop";
Further down below the SWITCH statement modify the individual cases of units you want to modify by changing the following line in the case statements.
setDefaultMove( unit, "explore" );
setDefaultMove( unit, ajmDefaultMove );
REMEMBER TO BACK UP YOUR ORIGINAL FILE!!!!
This should do it.
I have tested this somewhat.
Any feedback would be much appreciated.
I will post my modified city.js for anyone who is interested.