Newsgroups: rec.games.computer.quake.quake-c
Path: clanworld.com!news.webspan.net!www.nntp.primenet.com!globalcenter0!news.primenet.com!nntp.primenet.com!newsfeed.direct.ca!news.uoregon.edu!news.acsu.buffalo.edu!freenet.buffalo.edu!ci363
From: "David H. Bronke" <ci363@freenet.buffalo.edu>
Subject: Re: Help!
In-Reply-To: <Pine.BSF.3.96.980110135742.18420S-100000@nscfw.iafrica.com>
Content-Type: TEXT/PLAIN; charset=US-ASCII
Message-ID: <EMLo8p.E8K@freenet.buffalo.edu>
To: Dylan Broome <dylan@iafrica.com>
Sender: nntp@acsu.buffalo.edu
NNTP-Posting-Host: freenet.buffalo.edu
Organization: Buffalo Free-Net
References: <EMJHt8.7Du@freenet.buffalo.edu> <Pine.BSF.3.96.980110135742.18420S-100000@nscfw.iafrica.com>
Mime-Version: 1.0
Date: Sun, 11 Jan 1998 03:26:59 GMT
Lines: 74
Xref: clanworld.com rec.games.computer.quake.quake-c:4664

On Sat, 10 Jan 1998, Dylan Broome wrote:

> Hey there David,
> 
> On Fri, 9 Jan 1998, David H. Bronke wrote:
> 
> > HELP! I have a problem w/ my QuakeC patch. Here it is:
> <snip>
> 
> Well looking at the code, it all looks good (aside from from the ThrowGib
> function) With one problem.
> 
> Your program should actually spawn 1 gib and toss it. But after that the
> think is waiting for time+x (x being the random value) Time when you first
> called it is a set value, so a few seconds later the new 'time' will never
> equal the time+x (since time goes forward) Sorry that was confusing, but
> basicly you have to set self.nextthink every time.
> 
> So, add :
> self.nextthink = time + (random() * 5); 
> 
> At the end of gibb_throwgib() function.
> 
> Another problem is that the random choice of which gib to toss. Well, if
> you call random each time its going to choose a new random value. what
> you need is this :
> 
> void() gibb_throwgib =
> {
> 	local float r;
> 
>         r = random();
> 
> 	if (r < 0.2)
>                 ThrowGib ("progs/gib1.mdl", self.health);
>         else if (r < 0.4)
>                 ThrowGib ("progs/gib2.mdl", self.health);
>         else if (r < 0.6)
>                 ThrowGib ("progs/gib3.mdl", self.health);
>         else if (r < 0.8)
>                 ThrowGib ("progs/gib4.mdl", self.health);
>         else
>                 ThrowGib ("progs/gib5.mdl", self.health);
> 
> 	self.nextthink = time + (random() * 5);
> };
> 
> That should fix it up.
> 
> Regards,
> Dylan...x
> 
>                /-----------------------------------------------\
>                | Dylan Broome        http://spirit.iafrica.com |
>                | E-mail: dylan@iafrica.com                     |
>                | UUNET Internet Africa National Support Centre |
>                \-----------------------------------------------/    
> 
> 
> 
> 
> 
> 
> 
> 

Now Quake just says "No spawn function for:" and lists the classname, model,
etc.

David H. Bronke
Quake+Doom level creator, programmer ;'), and Web Page maker.
E-Mail: ci363@freenet.buffalo.edu
Web Page: http://freenet.buffalo.edu/~ci363/index.html

