Thread Tools
Old January 16, 2001, 05:58   #1
heardie
Prince
 
heardie's Avatar
 
Local Time: 20:50
Local Date: October 31, 2010
Join Date: Aug 1999
Posts: 684
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)
		}
}
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
heardie is offline  
Old January 16, 2001, 17:26   #2
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
Local Time: 11:50
Local Date: October 31, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
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).]
Locutus is offline  
Old January 17, 2001, 20:25   #3
heardie
Prince
 
heardie's Avatar
 
Local Time: 20:50
Local Date: October 31, 2010
Join Date: Aug 1999
Posts: 684
Thanks again
heardie is offline  
Old January 18, 2001, 21:07   #4
heardie
Prince
 
heardie's Avatar
 
Local Time: 20:50
Local Date: October 31, 2010
Join Date: Aug 1999
Posts: 684
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
heardie is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 05:50.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team