Announcement

Collapse
No announcement yet.

Kill the Zulus! (In Slic of course!)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Kill the Zulus! (In Slic of course!)

    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<player>)
    		}
    }
    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>(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

  • #2
    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).]
    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

    Comment


    • #3
      Thanks again

      Comment


      • #4
        Aghh. Didnt work. Its not that important at the momment though. Perhaps it is my fault, I may have accidently changed the iscityThere variable at some stage

        Comment

        Working...
        X