 |
|
kormer
|
|
Good luck, if you need any help just go ahead and ask. I'm struggling my through a scenario of my own.
|
|
|  |
 |
|
heardie
|
|
Slight change: changed from pirates to Robin Hood, so it can work on land. Basically the SLIc function wouldnt work at sea, but it worked on land. Anyway to make this project as open as possible here is the first SLIC, that creates random units when you walk (graciously taken from the Magnificant Samuari Scenario )
code:
if (Random(50) < attackChance) {
attackChance = 0;
int_t tmpRand;
int_t tmpRand2;
int_t tmpNum;
int_t i;
int_t tmpDist;
location_t tmpLoc;
tmpNum = army[0].size * 2;
tmpDist = 1;
tmpLoc = army[0].location;
//Find out how many units you have and spawn units accordingly.
tmpRand = Random(tmpNum) + 1; // Spawn between (1 and tmpNum) + 1 units
for(i = 0; i < tmpNum; i = i + 1) {
tmpRand2 = Random(20); // Random type of bandit
if (tmpRand2 < 8) { // 40% chance of Bandit
CreateUnit(3, UnitDB(UNIT_BANDIT), tmpLoc, tmpDist);
} elseif (tmpRand2 >= 8 && tmpRand2 < 14) { // 30% chance of Bandit Horseman
CreateUnit(3, UnitDB(UNIT_BANDIT_HORSEMAN), tmpLoc, tmpDist);
} elseif (tmpRand2 >= 14 && tmpRand2 < 19) { // 25% chance of Bandit Archer
CreateUnit(3, UnitDB(UNIT_BANDIT_ARCHER), tmpLoc, tmpDist);
} elseif (tmpRand2 == 19) { // 5% chance of Bandit Musketeer
CreateUnit(3, UnitDB(UNIT_BANDIT_MUSKETEER), tmpLoc, tmpDist);
}
}
makeArmies(3);
Message (g.player, 'RHAmbush');
return STOP;
} else {
attackChance = attackChance + 1;
}
//}
}
The only strage thing was
isHumanPlayer[player0] was causing an error. Oh well. Please post all comments on this. The aim is to make money, but also to marry maid marion (though this will not be ripped from the allexander scenario and chilildren will not be involved )
heardie
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:14. Apolyton Time is 00:14. |
top of page
|
| archivepost |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|