🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.games.unreal.tournament
Article #179076

Re: Catch the Chicken 0.0.8

#179076
From: Robert Mischke
Date: Thu, 10 Jul 2003 08:45
23 lines
1762 bytes
Ok, I gave in to curiosity and looked up some UScript. There goes
serious work... ;)

>>This is the only looping code:
>>
>>for(item = someone.Inventory; item != None; item=item.Inventory)
>>   if(item.IsA('CTC_Chicken')) return item;

After what I've read, I'm a bit surprised this compiles at all,
because "Inventory" is a class, and not a property?

I guess "someone" is of the "Pawn" class, as the bots will want to
look for the chicken in both players and other bots. So maybe what
you're looking for is the Pawn::FindInventoryType function (see
http://wiki.beyondunreal.com/wiki/Pawn_(UT)/Inventory for a list). I
guess this code should do what you want:

function bool hasChicken(Pawn someone) {
  return ( someone.FindInventoryType(CTC_Chicken) != Null );
}

HTH,
Robert aka The_Monk
Technical Details
Message-ID: <3f0f204e.4740657@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!mephistopheles.news.clara.net!news.clara.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!port-212-202-6-186.reverse.qsc.DE!not-for-mail
References: <slrnbggrv0.qk.meltdownUSE@sybren.thirdtower.com> <1ijjgv004ffn6knpg14s1vp0h2narrpv98@4ax.com> <slrnbgjsrs.r4.meltdownUSE@sybren.thirdtower.com> <3f0e1970.2982200@News.CIS.DFN.DE>

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!mephistopheles.news.clara.net!news.clara.net!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 08:45:16 GMT
Lines: 24
Message-ID: <3f0f204e.4740657@News.CIS.DFN.DE>
References: <slrnbggrv0.qk.meltdownUSE@sybren.thirdtower.com> <1ijjgv004ffn6knpg14s1vp0h2narrpv98@4ax.com> <slrnbgjsrs.r4.meltdownUSE@sybren.thirdtower.com> <3f0e1970.2982200@News.CIS.DFN.DE>
NNTP-Posting-Host: port-212-202-6-186.reverse.qsc.de (212.202.6.186)
Mime-Version: 1.0
X-Trace: fu-berlin.de 1057826666 6209585 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