Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home3/tedson/public_html/metalshard/header.php on line 14

Warning: Cannot modify header information - headers already sent by (output started at /home3/tedson/public_html/metalshard/header.php:14) in /home3/tedson/public_html/metalshard/header.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /home3/tedson/public_html/metalshard/header.php:14) in /home3/tedson/public_html/metalshard/header.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /home3/tedson/public_html/metalshard/header.php:14) in /home3/tedson/public_html/metalshard/header.php on line 25

Warning: Cannot modify header information - headers already sent by (output started at /home3/tedson/public_html/metalshard/header.php:14) in /home3/tedson/public_html/metalshard/header.php on line 26
Pocket PC Forum page 1 topic 689 at MetalShard
MetalShard, inc.
Pocket PC and Windows Games and Software

Pocket War (Game) Forum




This is a message in the Pocket War (Game) forum. If you would like to reply to this subject then fill in your reply in the box at the bottom of the page and click the Reply button. To get back to the main page for this forum click the Topics button.

Subject - Work around for setting default movement for Human Players Only
Pages: [1] Messages 1 - 2 of 2
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";
}
else
{
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.

CHANGE:

setDefaultMove( unit, "explore" );

TO:

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.

Thanks,

Andy
Posted By: Andrew (2007-03-21 15:17:28)

Here is the file...
Pages: [1] Messages 1 - 2 of 2




Reply


Attach File (zip and pwg files only)


you must be logged in to post
 
Copyright 2003-2010 MetalShard, inc. Games for Windows and Pocket PCs pocket war forums, automation software freegames