 |
|  |
 |
|
heardie
|
|
Well thats an interesting title for a change 
Anyway I'm stick with a 'dilly of a pickle'*. I want to make it that when player[0] (you) takes over player[2]'s city[0] the city is destroyed. How cna this be done. I waas thinking along these lines:
code:
//---------------------------------------
// If Ulandi is conquered then destroy it
//-----------------------------------------
HandleEvent (CaptureCity) 'WWDestroyUlandi_f' post {
int_t m; // Used for loop
int_t tmpNum; // How many units in the civilization
unit_t tmpUnit; // Used to see if unit lands on land
for(m = 0; m < tmpNum; m = m + 1){
GetUnitByIndex(player[0], m, tmpUnit);
if (tmpUnit.location == Dummy3 && isCityThere == 0){
Event: KillCity(city_t, int_t, int_t)
}
}
To clarify this 'Dummy3' is the location of the city and 'isCityThere' is a 1,0 variable. Now it seems I have to fill at city_t (Ulandi, city[0], int_t(?), int_t(player 3 which i think is player[2]). Can I just go
code:
Event: KillCity(0, 0, 3)
I would be willing to bet not 
What are the other ways to do this!
I thinks its time I go read the scenario scripts for the pre-made scenarios 
* Ned Flanders of course
|
|
|  |
 |
|
Locutus
|
|
ACS CTP1/2 Manager & Civ4 Co-Manager
|
 |
Hengelo, The Netherlands
Nov 1999 time: 06:14
|
|
Way to difficult (and buggy too), try this (usual disclaimer: untested, could be buggy):
code:
HandleEvent(CaptureCity) 'WWDestroy_Land' post {
if (city[0].location == Dummy3 && player[0] == 1 && isCityThere) {
Event:KillCity(city[0], 0, 0);
}
}
Help, there's something wrong with my TAB-key it doesn't work! Oh well, I guess you get the point 
KillCity has as arguments city that's killed, player that kills it (if you call the event instead of listening for it I don't think the number matters) and the reason (0 should be good enough) - in that order.
player[0] is *not* you btw, but whatever an events puts in there, in this case the player that captures the city. Player 1 *is* you (except in multiplayer so an IsHumanPlayer check would be needed then).
I saw your other questions but I don't have time now, will see if I can answer them tomorrow.
[This message has been edited by Locutus (edited January 16, 2001).]
|
|
|  |
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
|
|
|
|
|
|