script parse error:
Type mismatch for paramter 2 at line X
Token:-1, Text:')'
with;
orderDroidObj(droid, DORDER_BUILD, derrick); // someFunction(para1, para2, para3) Right?
/////////////////////////////////////////////
...also, here is an earlier attempt...
script parse error:
Type mismatch for paramter 2 at line 102
Token:-1, Text:')'
...and the code...
// check if HQ exists, if not... build one
structureBuilt(playerHQ, player);
if (false)
{
orderGroupObj(buildGroup, DORDER_HELPBUILD, playerHQ); // Line 102
}
But this gives me an idea... Can a group be given and order as a whole? (yes, DORDER_HELPBUILD is a droid order, I know lol) What I'd like to have done is to give a group of trucks an order to build a building (playerHQ to start). I have been attemting to use;
orderGroupObj(GROUP, order, BASEOBJ)
Give all the units in the group an order with an object
Now yes... its a droid order for a group. My problem is that I know of no other orders. Only droid orders are listed in Scriptlang. Are there Group Orders? I have already tried some different combos of that. And of course none worked. Or perhaps I'm barking up the wrong tree, lol. Any help would be... well... helpful
>>> UPDATE <<<
I now use;
Code: Select all
/////////////////////////////////////////////////////////////////////
// Build and upgrade Factories <- !!! Does NOT upgrade ATM !!!
event buildAndUpgradeFactories(buildAndUpgradeFactoriesTr)
{
if( (player == selectedPlayer) or (not myResponsibility(player)) )
{
setEventTrigger(buildAndUpgradeFactories, inactive);
}
else
{
tempx = (128*mapWidth);
tempy = (128*mapHeight);
numFactories = numStructsByTypeInArea(player, factory, baseX,baseY, tempx,tempy); // type mismatch error on 'factory'
boolResult = structureBuilt(playerHQ, player);
while( (boolResult == TRUE) and (numFactories < 5) ) // this should loop five times... we'll see.
{
buildX = baseX;
buildY = baseY;
boolResult2 = pickStructLocation(factory, ref buildX, ref buildY,player);
if(boolResult2 == TRUE)
{
initIterateGroup(buildGroup);
droid = iterateGroup(buildGroup);
while(droid != NULLOBJECT)
{
if(droid.order == DORDER_NONE or droid.order == DORDER_RTB)
{
orderDroidStatsLoc(droid, DORDER_BUILD,factory, buildX,buildY);
}
droid = iterateGroup(buildGroup);
}
}
}
}
}