Jump to content
The Dark Mod Forums

Drowning rats


grayman

Recommended Posts

This is a question for a coder or a modeller.

 

A rat's mouth is about 4 units above the ground when they're running around. Their origin is on the ground.

 

But a rat can drown in 3 units of water.

 

I looked at the code and it uses the spawnarg "mouth_offset" when it determines whether an AI is drowning. That's supposed to be a vector offset from the head's origin, but it's not set anywhere, as far as I can tell. It's not in the def file for the rat, which is where I would expect to see it. I think it's supposed to be defined there by the modeller.

 

I bumped 6 rats' health to 1,000 hoping that would help, but after about 10 minutes, 2 of them were dead in the water. They seemed to spend half their time in the water and half their time up on the floor surrounding the water. But the amount of air time they were getting didn't seem to help.

 

As a workaround, I'll give them atrociously high health, but maybe someone can say why this is happening.

 

Thanks

 

 

 

Link to comment
Share on other sites

Not sure, but there should be a spawnarg to stop AI from drowning...zombies don't drown, do they?

Link to comment
Share on other sites

Not sure, but there should be a spawnarg to stop AI from drowning...zombies don't drown, do they?

 

Checked a zombie and he has "can_drown" "0". Didn't know this existed.

 

I put it on the rats and now they don't drown.

 

This is a good workaround as long as they don't wander into water deeper than 4, where it'll look like they're supposed to drown.

 

Thanks.

Link to comment
Share on other sites

can_drown 0/1 :P

 

Keeping them out of the water will probably take some clever AI thread or a special AAS Obstacle specifically targeted at aas_rat.

 

 

I think the water situation is okay now, but they still get stuck on ramps or stairs, and sometimes up against a wall or monster_clip. Can't block them off, because there's no rat_clip. But I'm willing to put up with that, since they're in a sewer. Sewer = rats and water. If they get stuck too often, I might try some script trick to nudge them into moving again.

 

 

Link to comment
Share on other sites

Well, you can set them to patrol also.

 

animal_patrol 0 (?)

(it's in the def, I think that's it but I'm trying to install mint 9 right now.) That (1) makes them follow the scripting to make them randomly circle around. Greebo made that for the rats as default.

 

 

Then put them on paths, just like T2 and other AI. Then they WON'T go in water unless you make them.

 

Alternately there's monster clip too. But I guess you said they get stuck on that too.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...