Thread Tools
Old February 7, 2001, 17:45   #1
Dale
Emperor
 
Dale's Avatar
 
Local Time: 19:53
Local Date: October 31, 2010
Join Date: Dec 2000
Posts: 3,944
Withdraw mod updated
I've sent new zip files to Rich containing the updated withdraw mod files. I also updated the diplomacy mod files too since it contains withdraw. Here is a rundown of the logic error that was causing the desktop crash.

In certain situations the withdraw mod was causing a desktop crash when trying to boot more than one unit from your territory. The error was quite simply a typo. I use two variables, one labelled WDT_count and the other labelled WDT_count2. They are both used as counters for the number of units and number of attempts to find a good expelling site. WDT_count2 was a nested loop within WDT_count.

The typo was with WDT_count2 where I had mistakenly left some of the declarations as WDT_count. In some situations this was causing an infinite loop and the only course of action for CTP2 to get out was to crash to the desktop. This has been rectified.

On the TELEPORT event, for some wierd reason this event doesn't teleport civilians. I noticed this when a diplomat got the trumpets effect and then moved from under the trumpets to the next square. I have changed the actual expelling routine to the following:

Code:
if(!(IsCivilian(WDT_tmpunit))) {
	AddEffect(WDT_tmpunit.location, "SPECEFFECT_DIPLOMATIC", "SOUND_ID_EXPEL");
	WDT_tmptype = WDT_tmpunit.type;
	Event: DisbandUnit(WDT_tmpunit);
	CreateUnit(player[0], WDT_tmptype, WDT_tmploc, 0);
}
This has rectified the problem. However, I quite liked the idea of civilians not being expelled so I have implemented that. If you feel the need to have civilians expelled then change this routine to this:

Code:
//if(!(IsCivilian(WDT_tmpunit))) {
	AddEffect(WDT_tmpunit.location, "SPECEFFECT_DIPLOMATIC", "SOUND_ID_EXPEL");
	WDT_tmptype = WDT_tmpunit.type;
	Event: DisbandUnit(WDT_tmpunit);
	CreateUnit(player[0], WDT_tmptype, WDT_tmploc, 0);
//}
This will ensure all units are expelled to a safe location.

I have tested these updates thoroughly under as many conditions as I could think of and had successfull results. However I may have missed one. So if any other bugs show their ugly little faces, then let me know.

Dale - Now done more patching than a certain company has.

------------------
Author of Diplomod. The mod to fix diplomacy.

Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back."
[This message has been edited by Dale (edited February 07, 2001).]
Dale 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:53.


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