How to gradually civilize a worldspace?

Post » Mon May 02, 2011 1:13 am

I have almost no knowledge of leveled creatures and game combat mechanics, so I ask for suggestions on how to do this.

Scenario:
The player arrives in a wild island and settles down.
The player scouts the surroundings and gets rid of hostile creatures.
As I understand it, leveled creatures will respawn, so the player goes around a second time and clears the area again.

The question is: how to stop the respawning after, say, two or three times? (so the area becomes 'civilized' and no more wild beasts show up). The solution should also reduce and, then, remove hostile activity on frequently used paths thru the wild.

I noticed that Leveled Creatures may have a script attached to the marker. Is there a way to count the number of respawns so I can disable the marker after a few times? (I assume disabling the marker stops the respawns)

Any suggestion on how to do this?

Oh. . . the player may settle anywhere on the island, so the solution must be something on the fly, not something to do in the CS.
User avatar
Chris BEvan
 
Posts: 3359
Joined: Mon Jul 02, 2007 4:40 pm

Post » Mon May 02, 2011 4:46 am

Unfortunately, I can't think of a good answer for this. The best option I could come up with would be through either parenting leveled spawm markers with some sort of activator that eventually disables itself, or simply not using any placed leveled spawns, and instead using some sort of placeatme scripting that adds leveled creatures some distance away from the player and combining it with some respawning low level enabled creatures that make use of travel markers to have migration routes.

Anything involving a script or template on a leveled list would likely have more problems serious problems than trying to work either of the above.
User avatar
lydia nekongo
 
Posts: 3403
Joined: Wed Jul 19, 2006 1:04 pm

Post » Sun May 01, 2011 2:34 pm

There are a number of OBSE commands that you could use. I have never used any of them myself, but they seem to do what you want. The most relevant are probably:

AddToLeveledList - adds an object to a leveled creature, spell, or item list.. Count defaults to 1 if unspecified.
(nothing) AddToLeveledList leveledList:ref object:ref level:short count:short
RemoveFromLeveledList - removes all occurences of an object from a leveled list and returns the number of occurences removed.
(numRemoved:short) RemoveFromLeveledList leveledList:ref object:ref
SetChanceNone - sets the chance that a leveled list generates no item.
(nothing) SetChanceNone chance:short levlist:ref

With those, I guess you could first create and use your leveled lists in the area, and then remove hostile creatures from the list, add peaceful, or increase the chance of no item generated - or a combination.
Maybe the simplest would be to have to spawn points, one for hostile creatures and one for peaceful, starting with a low none-chance for hostile, and a high none-chance for peaceful, and then as the area gets civilized, the none-chance of the hostile list is increased, and the none-chance of the peaceful is decreased.


Note that most OBSE functions doesn't get its values stored with your savegame, but only is active for that Oblivion session regardless of savegame, so if this is the case, you need one or more variables controlling this, and then setting the right values each time a savegame is loaded, e.g.

short hostileChanceshort peacefulChanceBegin GameMode  if GetGameLoaded	SetChanceNone hostileChance HostileLeveledList	SetChanceNone peacefulChance PeacefulLeveledList  endif  ...End

User avatar
WTW
 
Posts: 3313
Joined: Wed May 30, 2007 7:48 pm

Post » Sun May 01, 2011 11:47 pm

I had not thought about non hostile creatures. Good idea.
Gradually migrating the SetChanceNone from the non-hostile to the hostile leveled lists is interesting, but it seems SetChanceNone is buggy and I don't really need this level of refinement, I guess.

So, a good solution seems to be a combination of your suggestions: a scripted activator that, after some time, disables itself, causing (by proper parenting) the disabling of the hostile leveled list and the enabling of the non-hostile leveled list.

Looks good. But the question still remains: how to count the number of times the LL has respawned?

Thinking about it: does LL work together with cell reset? Meaning, the player goes near, a creature spawns. If the player passes by every day, no respawns. If the player stays away for 3+ days and comes back, the cell resets and a new creature spawns. Is that it?

If I can count on the above, I could script an OnLoad block on the aforementioned activator to keep track of the date-time of each 'visit' and, if has passed 3+ days, I assume a respawn occurred and increase a respawn count, switching the LLs when the count reaches some hardcoded threshold.

At first glance it seems it would get the effect I need. Am I missing something?
User avatar
Sheila Reyes
 
Posts: 3386
Joined: Thu Dec 28, 2006 7:40 am

Post » Sun May 01, 2011 10:32 pm

The problem is that many people have modded their respawn time (I have it set to 7 days for example). There are even mods that change respawn time on the fly so you never know when something will respawn. If that doesn't matter for you it should work.

Is the player supposed to kill all the creatures before the 'friendly' creatures appear? If so, couldn't you detect whether the creatures spawned from a list in a cell are dead and then set a counter depending on how many creatures the player has killed?
User avatar
Blaine
 
Posts: 3456
Joined: Wed May 16, 2007 4:24 pm

Post » Sun May 01, 2011 6:40 pm

Thinking about it: does LL work together with cell reset? Meaning, the player goes near, a creature spawns. If the player passes by every day, no respawns. If the player stays away for 3+ days and comes back, the cell resets and a new creature spawns. Is that it?
Something like that. Here's my understanding:

In your savegame, a last-visited timestamp is stored for every cell. When a cell gets loaded (while outside it means your current cell, plus the two closest "rings"), the engine compares the last-visited timestamp with the current ingame time, and if the difference is larger than the respawn time set in your game (3 days default), the cell gets reset, and all its spawning points will be reset as well, drawing new spawns from its leveled lists.

IMHO, counting the number of respawns isn't the morst immersive solution. That would mean that if you were around so often that the cell very seldom reset, it would take a very long time before the area became peaceful, but if you just ran past once in a while, the area would become peaceful pretty fast, even if you didn't kill any hostile creatures.

The activator is a good idea, but what about a gamemode block instead, counting up the time the player is within a given distance, and then when the player has been around long enough, the area becomes less hostile?
User avatar
Gracie Dugdale
 
Posts: 3397
Joined: Wed Jun 14, 2006 11:02 pm

Post » Mon May 02, 2011 4:18 am

The activator is a good idea, but what about a gamemode block instead, counting up the time the player is within a given distance, and then when the player has been around long enough, the area becomes less hostile?

The problem with that is that you would then have all these getdistance checks running, and be at an even worse situation than with an onload block for those who have more than the normal 5 grids to load. You would also have the same problem, where the scripted activator would only pick up player behavior if it was part of the loaded area (preventing you from doing larger fields which are linked to a single activator.

Offhand, the only thing I can think of which might work would be to have every leveled list scripted with a simple
ref selfref parentshort var1short doooncebegin gamemodeif getinsamecell player == 1 && doonce == 0 && player.isincombat == 1set self to getselfset parent to self.getparentrefset var1 to parent.seencount set parent.seencount to var1 + 1set doonce to 1endifendbegin onloadif doonce == 1set doonce to 0end


Then on each activator, have a script

short seencountbegin onloadif seencount >= 50disableendifend


It's not very precise, and doesn't have any inherent ability to reset itself if the player stops coming around, but should allow a tally of how often a player travels through any given spawning grounds. I know it could be improved upon, but don't quite see it yet. If you have overlapping spawning grounds however, the mechanics of it "should" work.
User avatar
Nicholas C
 
Posts: 3489
Joined: Tue Aug 07, 2007 8:20 am

Post » Mon May 02, 2011 1:55 am

You all have good points: I have to check if the player has killed the creatures (or at least tried) and counting respawns is not the solution.

Alternative approach:
I place one trio (activator+LLbad+LLgood) per cell (so I can use getinsamecell).
The activator gamemode block keeps track of dead creatures in the cell (or player.IsInCombat) and of new constructions in the area.
The cell becomes civilized IF:
The player kills at least one beast (maybe at least two) AND something is built in the area, like a farm or a watchtower.

This way, just being there and killing beasts does not pacify the area. The area would have to be settled by NPCs (farm, mine, village) or the player has to build some kind of outpost to keep the area clear (like in a forest where a lumberjack works or at intervals along a road.

Sounds realistic?
User avatar
Lifee Mccaslin
 
Posts: 3369
Joined: Fri Jun 01, 2007 1:03 am

Post » Mon May 02, 2011 3:41 am

If I can count on the above, I could script an OnLoad block on the aforementioned activator to keep track of the date-time of each 'visit' and, if has passed 3+ days, I assume a respawn occurred and increase a respawn count, switching the LLs when the count reaches some hardcoded threshold.

While, as said before, using the cell reset comes with certain disadvantages (it may seem unrealistic in certain cases), wouldn't it be easier to use an http://cs.elderscrolls.com/constwiki/index.php/OnReset block which runs once every time the cell is reset instead of an OnLoad block?

However, a non cell reset dependent is likely better immersion wise.
User avatar
IsAiah AkA figgy
 
Posts: 3398
Joined: Tue Oct 09, 2007 7:43 am

Post » Mon May 02, 2011 12:43 am

Believe it or not, before posting the question I reviewed the Begin page on the Wiki, looking for some OnSpawn block and completely missed the OnReset block.

I am glad I missed it; otherwise I would have stayed with it and missed the better approach the discussion brought up.

I will keep it in mind, thou.
Thanks
User avatar
Olga Xx
 
Posts: 3437
Joined: Tue Jul 11, 2006 8:31 pm

Post » Sun May 01, 2011 4:30 pm

I learned something new here too. :)
User avatar
David John Hunter
 
Posts: 3376
Joined: Sun May 13, 2007 8:24 am

Post » Mon May 02, 2011 3:32 am

Too bad you changed your question.

Now I don't have the opportunity to reply that this scenario is part of my http://www.gamesas.com/bgsforums/index.php?showtopic=915021 project and that it took me a while to post this because I was posting a major update to the project specs. lol
User avatar
Gemma Archer
 
Posts: 3492
Joined: Sun Jul 16, 2006 12:02 am


Return to IV - Oblivion