Jump to content

Make door unlocked after defeating enemies?


TerraMcCloud

Recommended Posts

Hey everyone, I finally got back into oblivion after a few months of not playing it(I kinda ragequitted after loosing a legit level 48 to a harddrive failure) and now I want to get back into oblivion modding.

 

Im thinking of doing a Pit of 100 Trials style dungeon where in each room the player must kill all the enemies before they can advance. Every 10th floor the player gets a reward, and the deeper into the pit the player goes, the harder the enemies get, earlier floors have easier enemies then later floors.

 

The only script I really need to know how I could do is a script that automatically unlocks a door after beating all enemies in a room. Thanks.

Link to comment
Share on other sites

This could require a system of scripts.

 

You would need a quest script on an active quest that had a quest variable that other the other scripts could refer to.

 

Each enemy that must be killed before the door unlocked would need to carry a script.

 

The door would need to be set up as a reference.

 

 

So you would use many copies of a script like this on your monsters:

 

SCN AAEnemyDeathScript

; Object script attached to each and every enemy that must die before the door unlocks.

Begin OnDeath

    Set AAQuest01.KillCount to AAQuest01.KillCount + 1

End 

Note that in this example the quest is named AAQuest01. The script attached to quest AAQuest01 is named AAMyQuestSCRIPTwithAnExcessivelyLongName. The object scripts that refer to variables in other scripts must refer to the quest name, not the script name. So it must be like this:

     Set AAQuest01.KillCount to AAQuest01.KillCount + 1
NOT like this:
     Set AAMyQuestSCRIPTwithAnExcessivelyLongName.KillCount to AAMyQuestSCRIPTwithAnExcessivelyLongName.KillCount + 1

You would use a quest script like this:

SCN AAMyQuestSCRIPTwithAnExcessivelyLongName

; Attached to your quest.

Short KillCount
Short DoOnce

Begin GameMode

    If DoOnce == 0
         If Killcount == 23   ; If you have 23 monsters on this level that must die before the door unlocks.
              AAMyDoorREF.Unlock   ; Where your door is set up to have the reference ID "AAMyDoorREF."
              Set DoOnce to 1 
         EndIf
    EndIf
End

Your quest script would have to be written, compiled, and installed on a quest before you could compile your object scripts.

 

Note that this system is not entirely safe from failure. Like if you had 23 monsters, what if two of them disappeared? Then the door could never be opened. Like a monster might fall through the floor and get lost in the bottom of the cell where you can't fight it and kill it. The game might just never place and render a monster. Maybe the AI is bad and a monster wanders off and leaves the cell.

 

What if the script doesn't always trigger right? You could kill 23 monsters and only have the script fire 21 times. (Oblivion is a bit buggy sometimes.) The door would never open and the mod would be broken.

 

So if you encounter problems when play-testing, you might want to consider changing things so that the door opens when 90% of the monsters are dead, or change it so the door opens when the boss monster is dead, because he is the toughest and will probably be the last to die.

Edited by David Brasher
Link to comment
Share on other sites

Ummm... Im no good at making quests :sad:

 

Is there any way to use that script without making a quest?

 

All I really need to do is get a script like that to work, the 100 levels are just the same cell repeated, but with stronger enemies in each one.

 

EDIT: Ive been trying to add the scripts with no luck, says the killcount is a missing variable.

Edited by welchdrew
Link to comment
Share on other sites

  • 2 weeks later...

You can try to make the last enemy drop a single-use key, that would be much less script-extensive.

 

I am clueless as how to do that. >_<

Link to comment
Share on other sites

  • Recently Browsing   0 members

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