Article View: alt.games.unreal.tournament
Article #179075Re: Catch the Chicken 0.0.8
From: Robert Mischke
Date: Thu, 10 Jul 2003 07:59
Date: Thu, 10 Jul 2003 07:59
49 lines
2605 bytes
2605 bytes
{AGUT2}MeltDown <meltdownUSE@YOURunrealtower.imagination.org> wrote:
>Spike enlightened us with:
>> CTC_TMale1BGot DM-Ablee.CTC_TMale1Bot23 (Function
>> CatchTheChicken.CTCBot.findChicken:0043) Runaway loop detected (over
>> 10000000 iterations)
>
>This is the only looping code:
>
>for(item = someone.Inventory; item != None; item=item.Inventory)
> if(item.IsA('CTC_Chicken')) return item;
Hmm... I don't know UnrealScript, but AFAIK it's like C - and if this
was C code, the error might be in the "item=item.Inventory" part. The
loop *will* hang if this isn't guaranteed to set "item" to either a
value it never had before or to "None".
I guess you're trying to check if the actor "someone" possesses the
chicken?
If so, I'd find something like "item=someone.Inventory.next",
"item=item.next" or "item++" more intuitive - depends on how
UnrealScript handles iterators :)
HTH...
>Apparently, one of the bots has an inventory item pointing to itself.
I can't comment on this as I don't know UScript and the rest of the
code, but a dirty hack might be to check if the item is, in fact, an
actor (ie a bot). Pseudocode:
for(item = someone.Inventory; item != None; item=item.Inventory) {
if(item.IsA('CTC_Chicken')) return item;
if(item.IsA('Actor')) return NULL;
// place after the chicken test if chicken is an Actor itself
}
>New features for 0.1:
>
>- A big arrow on the HUD pointing to the chicken. It'll be green when
> the chicken is walking around, and red when it's caught.
>- Some sort of graphical HUD element on which you can see how long it'll
> take before you score again, when you hold the chicken.
That sounds great :)
Cheers,
Robert aka The_Monk
Technical Details
Message-ID:
<3f0e1970.2982200@News.CIS.DFN.DE>Path:
mbox-mo1.pugleaf.net!news5.aus1.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!port-212-202-6-186.reverse.qsc.DE!not-for-mailReferences:
<slrnbggrv0.qk.meltdownUSE@sybren.thirdtower.com> <1ijjgv004ffn6knpg14s1vp0h2narrpv98@4ax.com> <slrnbgjsrs.r4.meltdownUSE@sybren.thirdtower.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news5.aus1.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!port-212-202-6-186.reverse.qsc.DE!not-for-mail From: rm888@yahoo.com (Robert Mischke) Newsgroups: alt.games.unreal.tournament Subject: Re: Catch the Chicken 0.0.8 Date: Thu, 10 Jul 2003 07:59:32 GMT Lines: 50 Message-ID: <3f0e1970.2982200@News.CIS.DFN.DE> References: <slrnbggrv0.qk.meltdownUSE@sybren.thirdtower.com> <1ijjgv004ffn6knpg14s1vp0h2narrpv98@4ax.com> <slrnbgjsrs.r4.meltdownUSE@sybren.thirdtower.com> NNTP-Posting-Host: port-212-202-6-186.reverse.qsc.de (212.202.6.186) Mime-Version: 1.0 X-Trace: fu-berlin.de 1057823923 5920903 212.202.6.186 (16 [117649]) X-Newsreader: Forte Agent 1.5/32.452 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit