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).]