Jump to content

Random Spawn of defined creatures


LookoutPoint

Recommended Posts

Hi, just have a quick question about the spawn of creatures.

 

I have created 16 different creatures.

I want to place spawnpoints in the wasteland where these 16 creatures are spawn with a specific chance.

So not all at the same time. I want to set a chance for spawning. Is this possible?

 

How can this be done with the GECK?

 

- FalloutHog

Link to comment
Share on other sites

What you want is 1) an "Activator" (such as a "trigger box" or "encounter zone"); 2) a "FormList"; and 3) script code based upon a randomly generated number that determines the spawn chance. The basics are outlined in an example under "TIP Reference Variables explained" under the "GECK Form-ID Base-ID Ref-ID and Editor-ID" section of the wiki "Getting started creating mods using GECK" article.

 

-Dubious-

Link to comment
Share on other sites

@Mods: Sry, maybe move in "Geck and Modders".

 

Hi dubious and thanks for your reply.

I think I now know in theory how this works with your hints.

 

My semi-good workaround for now was to create a creature "RandomSpawnPoint" which is handplaced in the worldspace.

This creature "RandomSpawnPoint" has a leveled creature template "RandomSpawn". In this leveled creature all my potentional creatures are listed at level 1.

 

For any "RandomSpawnPoint" a random creature is picked from my "RandomSpawn" leveled creature list.

 

The number of placed creatures is not random because they are handplaced but it is unkown which enemy from the list will spawn.

 

Good enough for my wishe but I will do some tests with activators and scripts.

 

One question about my workaround.

All my savegames don't know the new spawn.esp I am working atm. So no old entries in my savegames or anything else regarding this new esp.

When I start the game and go to my 4 handplaced "RandomSpawnPoints" I see 4 random creatures. Like intended.

Now I load an older savegame and the same 4 random creatures are shown.

Same with another savegames.

Only when I quit and restart fallout new vegas another 4 random creatures are shown.

As if the gamesession remembers the list. And then again the same creatures in all savegames during the whole gamesession.

 

Is this intended? How does these lists in leveled creatures works and the randomness?

 

- FalloutHog

Edited by FalloutHog
Link to comment
Share on other sites

A "game session" is created in memory when you load either a "new" or "save game" with a given "load order" (LO) of mods from the desktop. As long as that "session" is active in memory, so is that LO. When you quit the game to the desktop, that memory is "released" for use by the system, and the process starts again when you restart the game with "re-initialized" memory. If you do not quit to the desktop, but only to the "Main Menu", that session memory continues "as is". Only the information which is saved in the "save" file (full or quicksave) or created by the "new game" process is changed. Much of the game environment (such as placed creatures and objects) remains unchanged.

 

"Random numbers" in games are technically known as "pseudo-random numbers" because they have a starting "seed" value. IF the "random number generator" (RNG) uses the same seed each time, it will generate the same "random sequence|" each time. This has advantages and disadvantages.

 

I haven't looked into the process, but from what you describe it sounds like the "seed" used by the RNG in a given game session is the same throughout, but a new seed is generated for each session. So I would say what you see is "intended" as default behavior. I haven't seen anything regarding changing the random number seed within a session. What is commonly done when you want to make a random result more unpredictable is add a value from the clock at the most discrete level you can obtain (e.g. micro or nano seconds or since the last time you checked) and trim it down to the valid range of your list.

 

The "FormList" itself is just that: a list (of in your instance: 16 entries). The random factor is applied to which entry you pull from the list.

 

I would caution you to read the "TIP Best Practice Do not begin EditorIDs with numbers" entry under the "Scripting" section of the wiki "Getting started creating mods using GECK" article regarding "prefixes". Your "workaround" is as valid as any other approach. The rest is "tweaking" it to get closer to your desired result.

 

-Dubious-

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...