Re: [DTscripts + code + theme] questions

From: George (greerga@CIRCLEMUD.ORG)
Date: 03/23/98

On Mon, 23 Mar 1998, C^2 wrote:

>etc.  Now come the question.  I have noticed in the past certain patches
>don't initialize variables for special mob procs to 0.  For example, in
>the patch for multiple mob attacks, the variables att1, att2, and att3 are
>never initialed to 0.  Yet, it works just fine.  Fundamentals of
>programming tell me to never use an uninitialized variable.  Yet it seems
>that the code says 'hey it's not initialized, we will assume it is 0'.
>So, can I put in my talk spec_proc something like if tresponses != 0, then
>randomly give a response, otherwise say XXX ignores you??

Variables are guaranteed to be initialized to random junk, nothing more.
The variables are most likely not initialized at the top because they are
always assigned before use later in the function.

>RECAP:  Can I use an unitialized value in a mob special field, and assume
>it is 0 if it isn't specified for the mob?

If you want to crash you can. :)
(Doing that with pointers is especially bad.)

>from my makefile.  Why are the scripts modifying these?  Aren't these
>system related and not code related?  Does anyone have any suggestions on
>what to do at this point.  I feel confident in patching by hand, but
>modifying conf.h gives me the willies.

Nothing should be changing conf.h, but Makefile is fine so long as they
modify also.

>Anyway, I ran into the following question.  What do you do when you have a
>mob(like a rat) that can't hold things such as gold coins.  If I don't put
>any coins, etc in the area, then people probably won't want to go there.

That didn't stop the Diku people from giving gold to anmials. :)

>RECAP:  How do you handle theme problems with mobs that can't hold
>items/coins?  Do you just give them stuff and assume the reward is in
>their lair?

Give them something else useful, like cheese or a random chance of a
semi-nifty item.

George Greer  -   | Genius may have its limitations, but stupidity | is not thus handicapped. -- Elbert Hubbard

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST