Jump to content


Photo

Random distribution of critters?


  • Please log in to reply
3 replies to this topic

#1 temnix

temnix
  • Member
  • 983 posts

Posted 19 January 2018 - 03:18 PM

Looking for ideas on how to spread around some animals to liven up areas. Nothing huge, probably, though a mousse here and there would be nice. Mostly, though, I want to add some rats, cats and dogs to city streets and insides of buildings, some pheasants and groundhogs and squirrels to forests. It's not difficult to make the creatures or just take the ready files in the game and extend area scripts to put a few of these in each area, or most, with some filters. Then they'll wander around. I'm not sure how to distribute them randomly, though. Custom coordinates by hand aren't an option, obviously. Something that will chuck them about after they paradrop in the area. Suggestions?



#2 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 26 January 2018 - 07:44 PM

Pretty sure you'll need coordinates one way or another, unless you resort to invisible-CRE hackery. In which case, you'll need coordinates for them, or so on.

 

When it comes to basics (which I recommend), there are two ways to do this:

1) the fj_are_structure function

2) extending the area script

 

I tend to prefer the first method, because it allows you to see where (e.g. in DLTCEP and maybe even NI these days) those CREs may end up, or start out at least. Scripting can also be glitchy, as I'm sure you know. Some other block could prevent yours or vice versa.

 

For what you're talking about, you give these animals and such generic random wandering scripts, so they won't necessarily end up where they spawn. Most such animals have these by default. If you want to get funky, you can add percentage chances for spawning and whatnot.

 

There are examples of both: 1) in the WeiDU documentation (and probably some mods I've written and forgotten about), and 2) in BGSpawn, which is (from what I recall) based off TutuSpawn and other similar stuff.


Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#3 Avenger_teambg

Avenger_teambg
  • Member
  • 604 posts

Posted 27 January 2018 - 02:25 AM

study icewind style spawn ini's as well (all EE games support that).  Using a number of potential spawn points and wandering critters can make it seem entirely random.

 

https://gibberlings3...formats/ini.htm


Edited by Avenger_teambg, 27 January 2018 - 02:27 AM.

Avenger

#4 temnix

temnix
  • Member
  • 983 posts

Posted 27 January 2018 - 10:20 AM

These sound too complicated. I think I'm going to go with Teleport Field on all of the critters. With a medium range, 500 or so, they should spread out in a nice random way. I might stick an Area-level script into them too, with something like

 

RESPONSE #1

 

MoveToOffset([-100.100])

 

RESPONSE #2

 

MoveToOffset([-100.-100])

 

RESPONSE #2

 

MoveToOffset([100.-100])

,,,

 

I do that sort of thing often enough.