Important Site Docs
Articles
The Elder Scrolls 4: Oblivion Modding Guides
Oblivion Tutorial: Adding a Greeting to an NPC
- Details
- Category: The Elder Scrolls 4: Oblivion Modding Guides
- Last Updated on Monday, 12 September 2011 21:46
- Written by Giskard
- Hits: 1202
Oblivion Tutorial: Adding a Greeting to an NPC
Greetings are what the NPC says to you as you pass by them or start to talk to them. Before their menu appears they will say the greeting they have assigned. The first time you add a greeting the NPC will probably not use it, but after some time, it will start to use it more frequently. So if you add a greeting and the NPC does not say it right away, do not worry
Your first Greeting
Open up the Construction Kid and Load in your mod or start a new one. Go to the Characters menu and select filtered Dialog (I assume you have an NPC ready for this). Scroll down the Editor ID list of topics until you see one called “GREETING” (exactly like that).
Under Topic Text find the Generic entries, right click on these and select new.
In the window that appears, select the Response Text window and type in your greeting but do not record it yet. If you right click on the Blades or Crime you will make a new Blades or Crime greeting eg Stop your under arrest or Oy thats my banana milkshake etc etc. So you can pretty much see how flexible this is if used correctly.
What we are going to do is what the Generic Greeting that says this next line already does.
“M'aiq knows much, tells some. M'aiq knows many things others do not.”
So if you find that at the top of the Generic list and look at the conditions, you will see what you need to do next.
Select your greeting and go to the conditions and click on NEW. The select the new condition and choose the command GETISID, then for parameters, click on the box then select your NPCs FORMID name as it appears in the NPC list in the editor.
The NPCs FormID is the NPC you drag and drop in to the game world when you want to add it to the game. When NPC that appears in the game is know as a REF object because its a copy, an object that refers to the FORMID for all its settings. So by giving the FORMID, you assign that greeting to all the REF objects that use it.
Change Comparison to = = and Value to 1.0.
Now your NPC has a greeting, select the greeting line again and record the new greeting then convert the Wave in to an MP3 and delete the wave.
If you look in the Oblivion\Data\sound\voice folder you will see your modname.esp, open that up and you see various race folders for lines you recorded. Inside those will be a M and F folder eg Male and Female.
Your new greeting is stored in one of these folders, check race and sex of your NPC to find the correct folder. Place note that Woodelfs share the same folder as HighElfs.
One more thing, always use conditions to limit who gets to say your greeting or every NPC in the game will say it and that is just annoying. You can have faction assigned greetings done this way too but you will need to make MP3s for every male and female character for every race thats in that faction.
That is it, you are done, save your mod and enjoy.
Workshop Script tutorial
- Details
- Category: The Elder Scrolls 4: Oblivion Modding Guides
- Last Updated on Monday, 12 September 2011 21:45
- Written by Giskard
- Hits: 870
Workshop Script tutorial
(Elder Scrolls 4: Oblivion)
Introduction:
This is an old tutorial I wrote a few years back to explain how the Kvatch Aftermath Workshop worked. It is very useful for turning a number of items in to something else. In this case it allows you to produce armour from raw ore. But you could use it to make potions from ingredients or anything like that.
The Script.
Heres a little script to add extra gameplay to Oblivion. It does for silver what alchemy does for plants and has option skill increases commented out in here (if anybody knows how to get 1/10 of a point let me know, 0.1 does not work in the editor.
Im going to explain this one as well as posting it so those learning to script can see why it works the way it works. First a run down for those who want the script but dont want to learn how it works.
Usage
Add the script to an object that can be used, a repair hammer is good, just copy the repair hammer entry in the editor and give it a new ID name. Then rename the label to say something like Armour Maker or what ever. Add the script to the "Armour maker" hammer and place the hammer on an Anvil somewhere and the player will be presented with a menu of various mithril armour components he can make if he has the right number of silver nuggets and his armourer skill allows him to make it.
The script will always remove the required nuggets even if the attempt to make the armour fails. Also most of the armour costs more than the nuggets so its possible to become an armour manufactor with this script.
;Usage
; Add to an object the player would use to make armour such as a copied and edited Repair hammer.
; Do not use the default repair hammers, always copy, change the name, then add the script.
scn WorkshopScript
short button
short chance
begin OnActivate
if ( IsActionRef Player == 1 )
Messagebox "What piece of Mithril Armour do you wish to forge","Boots", "Cuirass","Gauntlets","Greaves","Helmet","Shield"
set chance to GetRandomPercent + 20
endif
end
begin gamemode
set button to getbuttonpressed
if button > -1
if button == 0
if (chance < player.GetActorValue Armorer) && (player.GetItemCount Gem0SilverNugget >= 2)
Playsound UIArmorWeaponRepair
player.additem MithrilBoots 1
Player.RemoveItem Gem0SilverNugget 2
;ModPCSkill Armorer 1
else
if (player.GetItemCount Gem0SilverNugget >= 2)
Message "You try and make a pair of boots but end up with a mangled mess."
Player.RemoveItem Gem0SilverNugget 2
else
Message "2 Silver Nuggets needed to make a pair of boots."
endif
endif
endif
if button == 1
if (chance < player.GetActorValue Armorer) && (player.GetItemCount Gem0SilverNugget >= 5)
Playsound UIArmorWeaponRepair
player.additem MithrilCuirass 1
Player.RemoveItem Gem0SilverNugget 5
;ModPCSkill Armorer 1
else
if (player.GetItemCount Gem0SilverNugget >= 5)
Message "You try and make a Cuirass but end up with a mangled mess."
Player.RemoveItem Gem0SilverNugget 5
else
Message "5 Silver Nuggets needed to make a Cuirass. "
endif
endif
endif
if button == 2
if (chance < player.GetActorValue Armorer) && (player.GetItemCount Gem0SilverNugget >= 2)
Playsound UIArmorWeaponRepair
player.additem MithrilGauntlets 1
Player.RemoveItem Gem0SilverNugget 2
;ModPCSkill Armorer 1
else
if (player.GetItemCount Gem0SilverNugget >= 2)
Message "You try and make a pair of Gauntlets but end up with a mangled mess."
Player.RemoveItem Gem0SilverNugget 2
else
Message "2 Silver Nuggets needed to make a pair of Gauntlets."
endif
endif
endif
if button == 3
if (chance < player.GetActorValue Armorer) && (player.GetItemCount Gem0SilverNugget >= 4)
Playsound UIArmorWeaponRepair
player.additem MithrilGreaves 1
Player.RemoveItem Gem0SilverNugget 4
;ModPCSkill Armorer 1
else
if (player.GetItemCount Gem0SilverNugget >= 4)
Message "You try and make a set of Greaves but end up with a mangled mess."
Player.RemoveItem Gem0SilverNugget 4
else
Message "4 Silver Nuggets needed to make a set of Greaves. "
endif
endif
endif
if button == 4
if (chance < player.GetActorValue Armorer) && (player.GetItemCount Gem0SilverNugget >= 2)
Playsound UIArmorWeaponRepair
player.additem MithrilHelmet 1
Player.RemoveItem Gem0SilverNugget 2
;ModPCSkill Armorer 1
else
if (player.GetItemCount Gem0SilverNugget >= 2)
Message "You try and make a Helmet but end up with a mangled mess."
Player.RemoveItem Gem0SilverNugget 2
else
Message "2 Silver Nuggets needed to make a Helmet"
endif
endif
endif
if button == 5
if (chance < player.GetActorValue Armorer) && (player.GetItemCount Gem0SilverNugget >= 3)
Playsound UIArmorWeaponRepair
player.additem MithrilShield 1
Player.RemoveItem Gem0SilverNugget 3
;ModPCSkill Armorer 1
else
if (player.GetItemCount Gem0SilverNugget >= 3)
Message "You try and make a Shield but end up with a mangled mess."
Player.RemoveItem Gem0SilverNugget 3
else
Message "3 Silver Nuggets needed to make a Shield"
endif
endif
endif
endif
end
Heres a much simpler ring script which is the same as above but easier to explain for those who want to know how it works.
scn koablacksmithringsScript
short button
short chance
begin OnActivate
if ( IsActionRef Player == 1 )
Messagebox "What type of item do you wish to forge","Silver Ring", "Gold Ring"
set chance to GetRandomPercent
endif
end
begin gamemode
set button to getbuttonpressed
if button > -1
if button == 0
if (chance < player.GetActorValue Armorer) && (player.GetItemCount Gem0SilverNugget >= 1)
Playsound UIArmorWeaponRepair
player.additem JewelryRing4Silver 1
Player.RemoveItem Gem0SilverNugget 1
;ModPCSkill Armorer 1
else
if (player.GetItemCount Gem0SilverNugget >= 1)
Message "You try and make Silver Ring but end up with a mangled mess."
Player.RemoveItem Gem0SilverNugget 1
else
Message "1 Silver Nugget needed to make Silver Rings"
endif
endif
endif
if button == 1
if (chance < player.GetActorValue Armorer) && (player.GetItemCount Gem0GoldNugget >= 1)
Playsound UIArmorWeaponRepair
player.additem JewelryRing5Gold 1
Player.RemoveItem Gem0GoldNugget 1
;ModPCSkill Armorer 1
else
if (player.GetItemCount Gem0GoldNugget >= 1)
Message "You try and make Gold Ring but end up with a mangled mess."
Player.RemoveItem Gem0GoldNugget 1
else
Message "1 Gold Nugget needed to make Gold Rings"
endif
endif
endif
endif
end
scn koablacksmithringsScript
short button
short chance
The above stuff is the name of the script, in this case its for my kingdom of almar mod or KOA for short and its a blacksmith ring script. Hense the name koablacksmithringsScript.
The short XXXX stuff is vars i use in the script below, they must be declared before use so ive shout out, hay im using these short vars in this script. Short is a command that identifes your own vars and a var can be name word or anything that best scribes what data the var will hold. You can have a "myfatpig" var or a "Manchesterunitiedsuck" var, the actual name doesnt matter, it just helps us mortals know what its for if it describes what it does.
begin OnActivate
if ( IsActionRef Player == 1 )
Messagebox "What type of item do you wish to forge","Silver Ring", "Gold Ring"
set chance to GetRandomPercent
endif
end
What happens when its used, thats what OnActivate does.
This "if ( IsActionRef Player == 1 )" means Is the player the one activing it.
If so, display the messagebox text and ask if the player wants a silver ring or a gold ring by presenting them as buttons he can click on, then set chance to GetRandomPercent.
GetRandomPercent just chooses a number between 0 and 99. Nothing more complex than that. You may notice on the armour script i have the following line here instead.
set chance to GetRandomPercent + 20
This says pick a number between 0 and 99 then add 20 to the result.
Why do i do that ?
Well in order for the player to make anything, the chance var must be less than the players armour skill. So if i add 20 to the result and the lowest number chance can return is 0, then the lowest Armorer skill needed to make any piece of armour is going to be 20, so at skill 20, a player as a 1 in 100 chance of making some armour. The rings dont have +20 so the player has a chance equal to his own armour skill out of 100 to make a ring. Starting small is often easier and it makes sense for rings to be easier to make than suits of armour.
begin gamemode
This causes the script run multiple times a second or something along those lines, the END command at the end, finishes this gamemode block. Everything in between is what actually does the job.
set button to getbuttonpressed
if button > -1
Set the button to an unused state and wait for the player to press something. First entry is button 0 eg silver ring, second is button 1 eg gold ring. If there was a third entry it would be button 2 and so on.
if button == 0
if (chance < player.GetActorValue Armorer) && (player.GetItemCount Gem0SilverNugget >= 1)
Playsound UIArmorWeaponRepair
player.additem JewelryRing4Silver 1
Player.RemoveItem Gem0SilverNugget 1
;ModPCSkill Armorer 1
else
if (player.GetItemCount Gem0SilverNugget >= 1)
Message "You try and make Silver Ring but end up with a mangled mess."
Player.RemoveItem Gem0SilverNugget 1
else
Message "1 Silver Nugget needed to make Silver Rings"
endif
endif
endif
I only need to explain 1 button to explain them all, so im going to not explain the buttons below here but i'll leave them in and quoted so not to confuse anybody.
Translation "if button == 0" actually means IF silver ring was selected because silver ring was the first option in the messagebox text above.
if (chance < player.GetActorValue Armorer) && (player.GetItemCount Gem0SilverNugget >= 1)
This says if "chance", chance being the random number between 1 and 100 is less than (thats what < means, eg less than) the players armour skill value thats the "player.GetActorValue Armorer" part, and (&&) player has at least (player.GetItemCount) 1 or more (>= 1) silver nuggets (Gem0SilverNugget) then you can run the next bit, but if he does not, then skip to the ELSE part instead and do that.
;ModPCSkill Armorer 1
If the ; part was removed, each time the player made a ring, he would earn him self 1 point on his armourer skill, but 1 pt is too much and i dont know how to make it less than 1 so ive commented this out.
else
Everything after the ELSE is what happens if player does not have the right armour skill or has not nuggets. In otherwords, if the player is being a right old stupid nugget and trying to make rings out of thin air, the script does this next part.
if (player.GetItemCount Gem0SilverNugget >= 1)
If the player has greater than 1 Chicken Mcnugget sorry i mean silver nugget hehe. This checks if it failed not because of a lack of nugget but a bad armourer skill check, if that is why it failed it displays the following message.
Message "You try and make Silver Ring but end up with a mangled mess."
Always try and use messages that describe what would happen in real life if you tried to do something, dont use "you failed your skill check, thats just lame for a roll play game.
Player.RemoveItem Gem0SilverNugget 1
Even if the player fails he must use up 1 nugget so here we remove 1 nugget from the player.
Notice the of Player.RemoveItem, thats used a lot, you add the actor in this case the player to the start of the command in this case RemoveItem. If you need to search for a command, drop the Player. and just search for the RemoveItem to find out about it. You will get all info about i that way.
else
Message "1 Gold Nugget needed to make Gold Rings"
endif
endif
endif
Ok we checked if the armour skill failed, if the failure was anything els,e this appears, since theres only 2 reasons it could fail and 1 was a poor armour skill and the other a lack of nuggets. The ELSE part just assumes its a lack of nuggets. So if you wanted to call the player a stupid nugget for forgetting the nuggets, then this is where youd do it. But i found telling them what they need to be helpful. So ive used that instead.
Everything below here works the same way for different buttons, its only when you read the word END are you not dealing with some sort of button entry. The Word END finishes off the command above that says "begin gamemode". Skip to he end now for a final word on endings.
if button == 1
if (chance < player.GetActorValue Armorer) && (player.GetItemCount Gem0GoldNugget >= 1)
Playsound UIArmorWeaponRepair
player.additem JewelryRing5Gold 1
Player.RemoveItem Gem0GoldNugget 1
;ModPCSkill Armorer 1
else
if (player.GetItemCount Gem0GoldNugget >= 1)
Message "You try and make Gold Ring but end up with a mangled mess."
Player.RemoveItem Gem0GoldNugget 1
else
Message "1 Gold Nugget needed to make Gold Rings"
endif
endif
endif
endif
end
You may have noticed that theres 2 ENDs in this script.
Theres also this one.
begin OnActivate
if ( IsActionRef Player == 1 )
Messagebox "What type of item do you wish to forge","Silver Ring", "Gold Ring"
set chance to GetRandomPercent
endif
end
As you can see, this one starts with a Begin command too and it ends with the word END.
That means you can have more than one BEGIN line in a script, in fact i believe you can several, each one is basically an independant script in its own right but will share the same short vars which can be incredibly useful when you want one script to know what the value of CHANCE is above. If its in the same script, the value is always known as is the case here where chance appears in both Begin OnActivate and Begin Gamemode.
As you can see the script just takes away nuggets and replaces them with an item, so you could take away gold and replace it with something made of gold or have diamond rings by taking away gold and diamonds at the same time.
Enjoy
Oblivion Tutorial Quest Making Part 3: Making an Advanced Quest.
- Details
- Category: The Elder Scrolls 4: Oblivion Modding Guides
- Last Updated on Monday, 12 September 2011 21:44
- Written by Giskard
- Hits: 768
Oblivion Tutorial Quest Making Part 3: Making an Advanced Quest.
This tutorial requires you to have followed the first and second tutorial in the series
Introduction
In this tutorial I'll show you how to make the mission you created in the second tutorial more exciting. We will do this in 2 ways. First we will add a lot of bad guys to the cave, second we will make package you can add to any NPC to make them follow the player when the quest starts. So lets begin.
Adding more bad guys.
First lets support mods like OOO, Francos, MMM and Fcom by using their leveled list. We can do that easily by using the default leveled lists our selves. Those mods edit the default leveled lists so they will change our quest automatically. Yes that is a dirty modders trick but its one of those odd exceptions that is the lesser of 2 evils. The Alternative involves editing every monster placed in any cell in the entire game. So its just easier this way.
First we need to make sure our new monsters do not fight the monsters already in Horn Cave. So lets load up horn cave and check which monsters are used. Go to the Cell view and find horn cave and then select and object in that cell to make it appear in the window. Find a big red M in the cave and double click on it. The one I found was called LL2BanditCaves25 and that is a leveled list of LL1BanditMelee100, so lets go to the Object window, right below creature is leveled creature, select that. Look for LL1BanditMelee100 and open it.
When you do you will see it uses BanditMeleeMale and few others, so basically these are all normal bandits. Which is the correct way to find out which faction of bad guys are being used. I thought id show you that trick even though we can just place more LL2BanditCaves25 leveled monsters :)
To be safe lets just copy one from the cave shall we.
Find a big red M in the cave and select it, Hold down CTRL and press C copy it, now Hold down CTRL and press V to paste it. Select the newly pastes Red M and double click to open it. Tick persistent object, tick initially disabled, then click on enable parent. Select "Select Reference in window", select the chest you added to horn save, the one you called MQTiberschest with the and Old Chest.
What you did is you make the monsters parent that chest, since both the monster and the chest are initially disabled, nobody will see them. But when the chest is enabled by the player talking to the count of leyawiin about the Sword of Tiber Septim, the monsters will appear when the chest appears and will vanish when the chest is disabled again. That's how parent objects work. Cool stuff isn't it :)
Now place as many monsters as you want, make them persistent, disable them, make the chest their parent objects.
Try not to edit any of the original monsters in the cave, that would be bad.
Now when the player does the quest, he enters the cave, his favour OOO type mod will decide what monsters to spawn and how many the player should face, so you've getting to do some pretty advanced stuff for a noobie. My question to you right now is, how hard was that to do ? Exactly its bloody easy so why do quest writers not do it more often.
Guards for the player.
Lets make some guards shall we.
Do to the Object window and find the NPC called LeyawiinGuardCastlePostDay01, double click on it, change the id to Leyawiinbodyguard1 and leave the name alone. Ok that and say yes to create a new form. Now click on the factions tab and move the window somewhere out of the way. Next go to the character menu and select factions in the construction kit. Scroll down to the Ps and select Playerfaction, drag and drop that in to the guards faction window.
Now close the faction window and go back to the guard, select AI to open the open the AI object name window. Delete all the packages you see listed in the white part of the window. Now right click and select new, in the window that appears enter name for the Id, lets call it MYQUESTWaiting1, Package type = wander, Defensive combat ticked. Click on the Location tab and tick location then, select Near Editor location, radius 1000.
Now ok it.
Select new again, enter an ID MYQUESTStarted, Package type = follow, defensive combat ticked, select the target tab, tick target and any object, then find player in the object ID box. We want this package to force the guards to follow the player. Now go to the conditions tab. We want this to work only at MyQuest stage 20 so select new, find Getstage and select it, in Function Parameters select MyQuest and then select == and finally change the 0.0 to a 20.0.
Now ok that.
Finally move the new package to the top of the list so MYQUESTStarted is first and MYQUESTWaiting1 is second. Any packages at the top run first and the packages at the bottom run when nothing else will run. Since MYQUESTStarted runs when ever MyQuest is at stage 20, the rest of the time MYQUESTWaiting1 will run. Meaning the NPC will wonder around the location you placed it in.
Once an hour the game checks if an NPC needs to change packages, so the guards will not swap to the new package right away. If we want this to work right away we need to edit the quests. First we need a REF item...remember what a REF item is....where is ours ?
If you said, we have not placed one yet then you win the prize, we have to do that now. In the Cell view select worldspace and find Leyawiin World. Select a location inside the town, but not inside the castle. Go to the NPC list in the Object window and find your Leyawiin guard, his name is Leyawiinbodyguard1. Drag and drop him in to leyawiin twice, so you have 2 REF guards. Now, click on each one and give them a Reference Editor ID name of MQLeyawiinguard1ref and MQLeyawiinguard2ref. Disable both guards and select parent for both. Now find your chest in horn cave and make the chest the parent of both guards just like you did for the bad guys.
Now when the best appears, so will guards and so will the bad guys.
Now open up the quest window and find your quest. Go to the Quest stages Tab select 10, you will see these in the results script window.
MQTiberschest.enable
setstage MyQuest 20
below setstage MyQuest 20 add these lines.
MQLeyawiinguard1ref.evp
MQLeyawiinguard1ref.evp
So it looks like this...
MQTiberschest.enable
setstage MyQuest 20
MQLeyawiinguard1ref.evp
MQLeyawiinguard1ref.evp
What we just did is we have forced the NPC Guards to evaluate which package they should be running. Since they only have 2 packages and only one will work at stage 20, they will start following the player. Please note this is a little tricky sometimes and sometimes does not work very well. Especially if you use an command that adds a package to an NPC.
If you have problems, try adding those to the script instead like this.
Heres your script from tutorial 2.
scriptName MyQuestScript
Short my_quest_wants_this_done_once
begin gameMode
if (my_quest_wants_this_done_once == 0)
AddTopic Myquest1
set my_quest_wants_this_done_once to 1
endif
If (getstage MyQuest == 40) && ( player.GetinCell ICMarketDistrict == 1 )
MQTiberschest.disable
setstage MyQuest 45
endif
end
Change it to look like this.
scriptName MyQuestScript
Short my_quest_wants_this_done_once
Short update_guards_once
begin gameMode
if (update_guards_once == 0) && (getstage MyQuest == 20)
MQLeyawiinguard1ref.evp
MQLeyawiinguard1ref.evp
set update_guards_once to 1
endif
if (my_quest_wants_this_done_once == 0)
AddTopic Myquest1
set my_quest_wants_this_done_once to 1
endif
If (getstage MyQuest == 40) && ( player.GetinCell ICMarketDistrict == 1 )
MQTiberschest.disable
setstage MyQuest 45
endif
end
That will also work and force the NPCs to re-evulate their packages. If you add them to a script like that, you do not need to add the evp lines to the result script box at all. I actually prefer doing that via a real script, it just seems to work better I found.
Anyway which ever way you do it, it should achieve the desired goal and force the NPCs to choose a new package and since only the follow player package will be available, they will run towards the player and follow him until he opens the chest, then at the end of that hour, they will return to leyawiin. When the player enters the cell that causes the chest to disappear, the guards will vanish too. Removing all traces of the missions extra bits and restoring horn cave to its former glory.
The only trace you will see that the quest ever happened is the Sword of Tiber Septim in your hand and quest log that got made for it.
Placeatme Tutorial for Oblivion
- Details
- Category: The Elder Scrolls 4: Oblivion Modding Guides
- Last Updated on Monday, 12 September 2011 21:45
- Written by Giskard
- Hits: 1471
Placeatme Tutorial for Oblivion
Introduction
The basic usage of the placeatme command is explained the in the Oblivion construction wiki which can be read HERE but I will quickly cover the basics again in this tutorial.
The Placeatme command is a very dangerous command to use unless you know what you are doing. It allows you to place thousands, millions or billions of items in to a game and depending on the game settings, the game will not track them but will remember them because they where scripted in to the game. Slowly as you place more and more items, you bloat the players saved game, eventually corrupting it and breaking it. So to stop that from happening you have to track everything you place and that makes using the placeatme command a lot more difficult that it first appeared. Despite what the Construction Wiki claims, OBSE is not needed for this, just a little scripting. You will find whilst OBSE is a cool program, most of its functions can be achieved with the basic Construction kit and basic script commands. They are just longer scripts thats all. There are some things OBSE does that the standard CS does not do of course.
In this tutorial I will be assuming your using Creatures or NPCs since it is unwise to use the placeatme command on anything else.
General rules of usage.
If you want to place an item, such as a sword or potion, your better off using the additem or removeitem command, its much safer. If you want to place large static objects using this command DONT! Those things do not expire, they will slowly fill up the game unless your clever and control how many are placed and cap it at a specific amount so once that is reached, no more are placed after that. Placeatme items have no names you can refer to them with, you cannot check for them later or track them. Not reliably anyway.
We will be exploring how to do it safely for NPCs and Creatures in this tutorial.
The system explained below is used by the Kvatch Rising Dark Brotherhood quests, it is an adaptation of a system I have used previously in Fighters Guild Contracts and The Elder Council mods. So if you need some working examples. Check out Kvatch Rising... NOT the other 2, they are older and use a different more long winded system.
All of which use this command safely and have done for over 2 years now.
Basic usage
Here is the command and it's requirements, taken from the wiki.
PlaceAtMe ItemID, count, [distance], [direction]
Here is an example of its usage
player.PlaceAtMe Ninja, 1, 256, 1
And here are the directions
0 = front
1 = back
2 = left
3 = right
Now we leave the wiki, which is still worth reading to get the other hints and tips it provides but lacks the detail I am about to provide.
Which is why I am writing this tutorial.
Setting things up.
Using placeatme safely is not as simple as you may think, you need a quest to control what you place and a script to do the work for you. So lets start there.
Go to the Oblivion Construction Set and load up your mod or make a new one, then go to the character menu and select Quests. When it opens, right click in the quest list and select new, give your quest a name, for this tutorial I will call it "myquest" and then go to the script box which currently says none.
Here is a trick Iuse to create new quest scripts quickly without having to remember the exact layout or requirements, helps when your a noob working on scripts and it becomes an habbit when your not :D
Click on the 3 dots next to the script box, a script window will appear, click on the red arrow pointing right to get the AbandonedMineTrap02Script up. Click in the window with the script displayed, press control A to highlight all of the script, press control C to copy it (CTRL A and CTRL C) and then close the window without changing anything. Say no to saving it if asked. Now go and click on those 3 dots again, go to the script menu in the window that appears and select new, then press control v (CTRL V) to paste the AbandonedMineTrap02Script script in to your new script window.
NOTE: you cannot just rename the abandonedmine script because it really renames it, eg removes the original. Oppps...
Then edit it from this.
scriptName AbandonedMineTrap02Script
short triggered
begin gameMode
if ( getDistance player < 160 ) && ( triggered == 0 )
playgroup forward 1
AbandonedMineTrap03REF.playgroup unequip 1
set triggered to 1
endif
end
to this
scriptName myquestScript
begin gameMode
end
Notice I changed the script name to myquestscript, that must be done. You must always change the script name. This becomes the filename when saved (not look for the file, it does not exist, its part of your mods esp).
Now set the Script Type to Quest and save your script.
Close the script window if it is still open, close the quest window and then reopen the quest window by going to the Character menu and selecting quest, then find Myquest again and open it. Tick Start Game Enabled, give it a priority of 20. Now go to the script box, click on the downward arrow and find your myquestscript and select it. At this point its best to close the quest window and save your mod. Then reopen the quest mod window and go to your myquest and open that script again. It just makes sure its all saved off correction and the CS has updated it self.
When you write a script try and find it but its not there, thats why, you need to close the quest window to trigger an update to the available scripts.
Creating a monster
Make your NPC or Creature normally and call it mymonster. If you want to call it something else, just change mymonster to what ever you want it to be and replace mymonster with your own name when ever you see it in this tutorial.
Now we make the following changes too it.
Make sure "No Low Level Processing" in the creature of npc window is NOT TICKED.
That is one of the causes of the save game bloating, anything with that ticked disappears when you leave the cell but placeatme is a script command and scripted items are persistance and are remembered by your saved game. That means anything placed with placeatme is also remembered by your save game even after it disappears from your game. I believe they solved this problem in Fallout 3 but never really confirmed it. Normal spawns remember the spawn points and reload them when you enter a cell after 3 days, they are not scripted so are not remembered by your saved game and thus do not have this problem.
But placeatme stuff just vanishes, yet remains part of your game save. So when using placeatme, "No Low Level Processing" is BAD, very BAD! We want these things to be remembered so you can kill them and remove them from the game that way. Death is a method of cleaning up your placed creatures or NPCs you see.
I could be wrong but I think its a simple persistant object issue hardcoded in the game basically. Which means using custom creatures or NPCs may remove the bloating from your save if a mod is disabled later. Thats how these things usually work. So theres a tip for you, stick to custom NPCs and Creatures for this command and you may give your selve a way to clean up any mess you cause by disabling the mod later and resaving your game.
Next we need to create a script for our NPC or Creature
Click on the 3 dots next to your NPC or Creatures script box and cut and past this script in to it. We cannot put in the actual code that works the magic yet because the var needed has not been declared or created in the quest and it would give an error when saving if we added it early. This is an chicken and the egg situation. Both our quest script and our npc script both need the other. So we just create the shell now and then go and create the chicken later.
Here is the script you need to add to your NPC or Creature, you can change the name of the script if you wish, it does not matter. Just remember what you called it.
ScriptName myquestbodycounterScript
Begin OnDeath
End
Set it to Script Type Object.
If the script is not assigned to your NPC or creature right away, close your NPC or creatures window, reopen it and find your script. It should be called myquestbodycounterScript. Save your mod after you have done this.
Editing the Quest Script
Now we make some changes to the above script and add the NPC or creature name as well as the code to control it to our quest. This script will only allow 1 NPC or creature to spawn this way and it will constantly spawn that creature or NPC at the players position. Leading to endless attacks on the player if that creature is an unfriendly creature or npc. If you want to make it spawn at a marker, replace the "player" with the name of your marker and it will ensure the creature or NPC is always at that location. Respawning it the moment it dies with a new one. Might take 5 seconds for the scripts to run and spawn the new copy of the creature of NPC.
Add any AI packages you want and that creature or NPC will use them like any other creature or NPC.
Here is the new script.
scriptName myquestScript
; this is the var that does the work for us
short bodycount
begin gameMode
; Here we check of the monster is dead but checking the bodycount var which is updated by the creature or npcs death script
if (bodycount == 2)
set bodycount to 0
endif
; this is where we add 1 monster if none exist or all are dead
if (bodycount == 0)
player.PlaceAtMe mymonster, 1, 256, 1
set bodycount to 1
endif
end
We have have done is place mymonster at the player if the bodycount is 0, and stop it placing more if bodycount is greater than 0. Which is it because we set it to 1 when we placed our monster.
If you do want to make that monster spawn at a marker instead of a player, place a marker, give it a new name, lets call it mymarker or something and then replace the line below
player.PlaceAtMe mymonster, 1, 256, 1
With this
mymarker.PlaceAtMe mymonster, 1, 256, 1
in the above script. Change mymarker to what ever you called your marker of course.
You can create hot zones of activity using this method, imaging a constantly spawning set of skeletons in a dungeon that never empties. Yes folks this command may be dangerous if not used correctly but its lots of fun when used properly. There is 1 side effect, all these creatures you place are tracked by the game and do use up CPU time. So do not go too mad.
Editing the NPC or Creatures Ondeath Script.
Open your NPC or creatures window again and go to the script you attached to it, remember it is the one listed in the script box. Adding the new part to it which is "set myquest.bodycount to 2" between the Begin ondeath and the end commands.
ScriptName myquestbodycounterScript
Begin OnDeath
set myquest.bodycount to 2
end
Before I move on, notice how I have myquests.bodycount in the script.
Some word of explanation is required. I am sure you can guess what a Global var is, it is one all quests and scripts can access. Well that code above allows all quests to access a local var. By naming our quest and var in our quest script this way. We tell any other script to look for the script attached too myquest and find our var bodycount and use that. Which is a long winded way of saying, we have our own version of a Global var if we use myquest.bodycount instead of just bodycount in our commands.
To summarize.
This is as good as a global var and will work in other quests and scripts.
Set myquest.bodycount to 2
This is a local var, when writen like this, it will only work in the quest script that declared it with the short bodycount command.
Set bodycount to 2
You see, you learn something new every day :D
Extra Tips:
That's it, that's how you spawn 1 creature at a time, wait for it to die, then spawn another.
Spawning 5 Creatures at a time.
What if we want 5 creatures to spawn at a time ?
Well you need to change the scripts for that.
I am deliberately NOT going to use the Placeatme's Count option here which would allow me to add more creatures easily because I want you to see how to add multiple creatures of a different type. I'll be using the same mymonster creature but just imagine you made 5 different versions of it and used the same death script on them all. You see where I am going here ?
Lets edit the quest script first.
We need a new way to control the scripts flow, bodycount is now really the bodycount, so lets have a bodycountreset var to control it.
scriptName myquestScript
short bodycount
short bodycountreset
begin gameMode
; Here we check how many monsters have died and if the bodycount reset is still at zero.
; the bodycount number heré is 5, thats how many creatures we want to spawn and how many we want to died before they spawn again.
; This number should always match exactly the number below. So 5 up here, means the Placeatme command below needs a count of 5, or 5 lines placing 5 creatures.
if (bodycount == 5) && (bodycountreset == 0)
set bodycount to 0
set bodycountreset to 1
endif
; If the bodycount is 0 and bodycount reset is 1 then we need to place some monsters.
; you can change mymonster for other monsters here, 1 per line, or use the first number to set how many of each you need,
; eg player.PlaceAtMe mymonster, 5, 256, 1 would place 5 mymonsters by the player :D
; remember the number spawned here has to match the number in the bodycount var above, which is 5 in this case.
if (bodycount == 0) && (bodycountreset == 1)
player.PlaceAtMe mymonster, 1, 256, 1
player.PlaceAtMe mymonster, 1, 256, 1
player.PlaceAtMe mymonster, 1, 256, 1
player.PlaceAtMe mymonster, 1, 256, 1
player.PlaceAtMe mymonster, 1, 256, 1
set bodycountreset to 0
endif
end
Now the Creature or NPC script
ScriptName myquestbodycounterScript
Begin OnDeath
set myquest.bodycount to myquest.bodycount + 1
end
What we did here is we add 1 to the bodycount var every time a creature or var dies instead of setting it to 1, allowing it to count upwards until all are dead, eg all 5, making bodycount = 5 when completed. And we check when it reaches 5 and reset everybody so they all spawn again.
Other Ideas:
Suppose you created several NPCs and added that ondeath script to them all. Suppose they all had special packages of their own, unlike random spawns which may be used anywhere. If the spawn is a marker not the player, you will know exactly where these NPCs will appear and can customise their AI packages for that area. Making them sit, stand, fight, patrol, what ever you want. And when they die, instead of having to wait 3 days in a different cell for them to respawn, they would instantly be replaced by an exact copy of the original.
Final thoughts.
The idea of spawning creatures this way is a cool one, but you cannot go mad using this system. Even when you tightly control them on a basis of what goes in, has to die before another can be placed, there is still the CUP overhead to think about. Oblivion is not as optimized as Fallout 3, it cannot handle as many NPCs running around as Fallout 3 can. So becareful here.
Learn how to adjust the above scripts to control the number that spawn but remember, everything you place this way is saved when you save your game, so when testing mods using this idea, DO NOT SAVE YOUR GAME. Test this without saving and only start saving when you know it works because if you save and its broken, then your game save will remember the broken data. Changing the var names used can often allow you to continue but it cannot remove the previous attempts mistakes.
This whole tutorial is really an advanced topic and should not be handled by noobies, if you want to practice it, fine, but best stick to throw away saves and keep the mod you make private so not to harm anybody elses games until your better at this stuff.
Oblivion Tutorial Quest Making Part 2: Making a Basic Quest.
- Details
- Category: The Elder Scrolls 4: Oblivion Modding Guides
- Last Updated on Monday, 12 September 2011 21:44
- Written by Giskard
- Hits: 878
Oblivion Tutorial Quest Making Part 2: Making a Basic Quest.
Introduction
So you followed the tutorial that showed you how to add a single line of Dialog to an NPC and you thought, that was a lot of work just to get the NPC to say hello. If you did not, then you need to read that tutorial first. Here is the link.
http://www.mechstorm.net/forums/index.php?showtopic=4060
Believe it or not, that tutorial taught you how to make a quest and we need you to have that quest handy for this tutorial. It did not teach you how to control a quest and a quest without controls is not a quest at all, its a mess. Now you know the basics of adding dialog, its time to explain the parts the other tutorial failed to explain. In this tutorial I will show you how to turn that 1 line of dialog in to a real quest with conditions nice green arrows and a reward for the player. This is what I call the BASIC quest, that means additional tutorials on making it more fun may follow. :)
Making a Real Quest.
In the previous tutorial we made a quest called "MyQuest", yours may have a different name. Open that quest in the quest window again. Do you remember where the quests option is ? It is in the character menu, just scroll down and you will see it. Find your quest and select it. Right, lets make some changes to your quest so it is more what we want.
In Quest Data change the Quest Name to "The Sword of Tiber Septim".
Now click on Topics, do you see Myquest1 or what ever you called yours, select it. See the the one line of Topic Text ? It says ""Ooo did you know...", change it to say "The Sword of Timber Septim", now click on the line below it and change the line to say "I believe the sword of Timber Septim is hidden in Horn Cave.", if you want, record the new line and make it an MP3 as instructed in the previous tutorial.
Since somebody has to say this line, we might as well leave it set to MariusCaro, the count of leyawiin.
But we do not want this quest offered until after the player recovers the Armour of Tiber septim for martin. After that point, we want this quest available to the player. So now we have to find the quest where the player recovers the Armour and find the stage when it ends. We need to know this information for our condition that prevents this running too early. So in the quest window, look on the left hand side for quests called MQ (Main Quest), the quest your looking for is The Blood of the Divines, its actually MQ09 and you give the armour martin at MQ09 stage 90. So any time after that is perfect for us.
Now, if we used a script to check for this, we would add these lines to it to make it wait before changing the stage.
If (getstage MQ09 >= 90)
Setstage MyQuest 10
endif
If we wanted to do that outside of a quest script, so the line is just waiting to appear when that quest stage is reached during the main plot, we would add a condition to the Topic that basically says Getstage MQ09 >= 90, as you can see it is more or less the say thing except we do not need setstage 10 to make the line available. We only need to do this one way, we do not need to do it in a script AND in the Topic conditions, one or the other will do.
Now I am a scripter and I prefer doing this in a script, but scripting is hard for some so, for this tutorial, we will do it in the Topic conditions. So select the quest window, go to the Topics an select your line "I believe the sword of Timber Septim is hidden in Horn Cave." and then go down to conditions and select new. Now select Getstage, then in Function Parameters select MQ09, next change the == to >= and change the 0.0000 to 90.0, do not worry about any extra zeros on the end. Also please note the decimal point, that's vital you remember that.
We do not want this line constantly offered, so we tick say once and to be doubly careful we right click on our new condition and and we duplicate it.
Now we need to edit the duplicated condition, change the function parameters to MyQuest and the change the >= to == and change the 90.0 to 0.0
Now the Count of Leyawiin will offer this quest if the player has given Martin the armour of Tiber Septim and if MyQuest is still at stage 0. Notice we use stage 0 not 10, it can be done lots of different ways, its just easier this way for this example.
Now in the Result Script box write this.
setstage MyQuest 10
What this does is it set stages MyQuest to 10 once the player has listened to the count say his one line which is "I believe the sword of Timber Septim is hidden in Horn Cave.".
Creating Tiber Septims Sword.
Now we need to do something at MyQuest stage 10 but first we need to make Tiber Septims Sword and put it in a chest. In the object window in the construction kit, scroll down to Weapons, find steel and select the WeapSteelLongsword (Steel Longsword). I am going to show you the correct way to make a unique item in Oblivion so it does not conflict, without needing a new mesh and texture.
Select the sword called WeapSteelLongsword, double click on it then change the ID to say MQSwordofTiberSeptim and then Change the name to "Sword of Tiber Septim". We add MQ to the ID because it makes it easier to find all items for MyQuest later, MQ = My Quest, understand ? But you do not actually need to do that, its just good modding practice if you do. Now Ok that, it will say, Create a new form, SAY YES.
Its VITAL you said yes to that last question, if you did, the original sword will not be edited, a new sword will be created, if you did not, then the old sword would be renamed and you will have created a massive mod conflict. VERY BAD that.
Now scroll down to Containers in the Object Window, find a chest, any chest. Double click on it and change the ID to MQTiberschest and change the name to Old Chest. Untick Respawn if its ticked and delete any items listed as being in the chest. Now ok that and when asked if you wish to create a new form, Say YES. Saying no changes the original, which is very bad, it is same problem mentioned above only this time its for a chest.
Now your a good little mod maker, you have a unique 100% conflict free "Sword of Tiber Septim" and a 100% conflict free "Old Chest", if you do not feel pleased with your self right now, then you should, you just avoided a mistake many mod makers make. You avoided editing an original item and created your own and edited your copy rather than original. When ever you edit anything, you ALWAYS make your own version this way first. ALWAYS, NO EXCEPTIONS (I lie but it is complicated so assume there are no exceptions for now). This is good mod making practice.
On a scale of 1 to 10, the importance of doing it this way is 100.
Editing the Chest Contents.
Find your new chest again and open it, then whilst its open, find your Sword of Tiber Septim and drag it in to the chest. Make sure it has a 1 next to the name. We do not want you to have 2 swords of tiber septim in that chest do we. :)
Finding Horn Cave.
Now in the CELL View window make sure World Space is set to interiors, scroll down to Horn Cave and select HornCave, now select an item from the window on the right to load horncave in the window that lets you see the cave it self. Now drag and drop your new chest somewhere in that window, with it selected hold down shift or Z to move the chest around the map using your mouse. Place it in the case somewhere on the ground where the player will find it. Then double click on the chest, tick initially disabled, and in the empty Reference Editor ID box give it a name "MychestREF".
Remember we talked about the difference between a REF object and an Editor Master object and how Dialog needed the Masters ID Name, well what we need to do next requires the REF object name not the master. You just disabled the chest so nobody get it until we enable it, that was the REF object being disabled. The master was the chest you selected and dropped in the Cell view window, once it appears in the Cell the Master becomes a REF object. Master objects never appear in a CELL, they only appear in the Construction Sets Object window.
Making the quest work.
Go back to the Quest Window. In Quest stages make sure you have stages 0 10 20 and 30. Now go to Quest Targets, IM going to show you how use the green arrow to point towards the chest. Right click in the Target Ref window and select new. With the new entry selected choose Quest Target Data, notice there's a Select Reference in Render Window button ? Also notice I did not tell you to close the Cell View window. Well press the "Select Reference in Render Window" button and click on the chest you placed in horncave.
What!!!! the pointer stays red...OMG panic..............you idiot, what did you do..slap your self, again...harder...ooo that hits the spot...actually you did nothing wrong, IM just being evil and let you make a mistake that everybody makes. Click on the chest and notice the Persistent Reference Option ? Tick that box. Now select the "Select Reference in render window" again and click on your chest to set the chest as the target for the green arrow.
See it works. This happens when ever an item used in a quest is not persistent. Also NPCs will not sit on chairs if they are not persistent. So you just learned the importance of persistent objects as a bonus. Well done :)
We need a condition adding for that green arrow, it must only run when our quest is as stage 20. So in conditions, select new, find and select getstage. Now in the Function Parameters find and select MyQuest and the == can be left as === but the 0.0 needs to be changed to 20.0. Once again additional zeros at the end can be ignored. Now that green arrow will only work whilst our quest is at stage 20.
Go to the quest window again, select Quest stages, select stage 10, that's the 10 on its own. Select new under Log Entry and in the white box under the other Log entry, yes there's 2 Log entry boxes, this last one is the one next to the Result Script box. In that Log entry make up a log for the player that says something like "The count of leyawiin told me he believes Tiber Septims Sword is hidden in Horn cave. I should go there and try and find it.
In the Result Script box type these lines
MQTiberschest.enable
setstage MyQuest 20
The moment that log entry appears the stage will change and the chest will appear as if by magic in horn cave. Then and only then will the green arrow appear.
Bewarned, the above line will skip anything in a script below stage 20, that script results box takes priority over the script and runs first. So if you need a script to control when your quest changes stages, do not use that Result Script box AND your script, use one or the other. Not both. In fact, do not have anything at state 20 in your script, it will just be skipped unless your careful and have conditions in place to control everything.
Now stage 20 needs to exist because our quest uses it, if it does not exist, we would get an error, but we are not actually going to have any logs for it. But 30 is our last quest log, so select that and select new, In log entry write something like "I have found Tiber Septims Sword in Horn Cave, Woopie Doodie Dandie" or something to that effect :) Now tick Mark Quest Completed and in the results box for 30 type
Stopquest MyQuest.
Now in the object window, find your chests MASTER, if your looking in the CELL view for it, your looking in the wrong place. To to the Object Window, scroll down to containers, find your Chest. Remember you called it MQTiberschest if you used the name I suggested. Double click on it and then select Script. The script window will appear, select new from the script menu.
Now this next script is an example of how you make the player setstage (advance the quest a stage) a quest just by opening a chest. Cut and paste it in to your new script window.
scn mqmychestscriptSCRIPT
short done
begin OnActivate
Activate
if done == 0
setstage MyQuest 30
set done to 1
endif
end
What the script does is it lets the player open the chest (that's what activate does), it checks to see if the player has already opened the chest, if he has not it sets the quest stage to 30. Remember what log entry you added for 30 ? It went something like this "I have found Tiber Septims Sword in Horn Cave, Woopie Doodie Dandie". So guess what log appears the moment that chest is opened :)
That's right, so guess what Sword the player will see inside the chest when he opens it.
That's right, the sword of tiber septim.
Save the script, close the script window, close the quest window. Save your mod. Find your chest again, select script if its not already listed as being part of the chest (it may still be empty), if it is empty look for a script called mqmychestscriptSCRIPT and add it to the chest. Now save your quest.
You have just made quest to find "The Sword of Tiber Septim", well done.
BUT do you want to make a clean quest ? one that tidys up after it self when its finished ?
Yes of course you do, go to the Quest Stages tab in Quests, find 30, untick Mark Quest complete, and remove the Stopquest MyQuest.from the results box.
Add a stage 40 and 45.
Select new for 45 and type in this new Log entry.
"Word must have gotten out by now that the Sword of Tiber Septim has been found, IM going to be Famous".
In the result box box add this line.
Stopquest MyQuest
Tick Mark Quest as complete.
Now do you want to make the player famous for finding the sword ? Yes of course you do :)
Above Stopquest, type this
modpcfame 1
Now when quest ends, the players fame will be increased by 1 point.
Now click stage 30, in the result box type this
Setstage MyQuest 40
Now go to the Quest Data and open up your Quest Script, the one you created in the "Adding Dialog to an NPC" tutorial.
Add this.
If (getstage MyQuest == 40) && ( player.GetinCell ICMarketDistrict == 1 )
MQTiberschest.disable
setstage MyQuest 45
endif
Your old script looked like this.
scriptName MyQuestScript
Short my_quest_wants_this_done_once
begin gameMode
if (my_quest_wants_this_done_once == 0)
AddTopic Myquest1
set my_quest_wants_this_done_once to 1
endif
end
With the new additions, it will look like this.
scriptName MyQuestScript
Short my_quest_wants_this_done_once
begin gameMode
if (my_quest_wants_this_done_once == 0)
AddTopic Myquest1
set my_quest_wants_this_done_once to 1
endif
If (getstage MyQuest == 40) && ( player.GetinCell ICMarketDistrict == 1 )
MQTiberschest.disable
setstage MyQuest 45
endif
end
What the new bit does is it waits for MYQuest to reach stage 40 and then next time the player enters the imperial marketdistrict it disables the old chest so it is no longer in the game and set stages to 45 to end the quest. We could do a getdayspassed job on this but that can be complicated for a noobie and it does not work very well anyway and the last thing you want as a noobie is a problem like that. The ICMarketDistrict is actually just the cell name, or in this case the World space name, if it does not work you can replace it with any cell name the player is likely to enter. It will serve the same job.
All it does is it makes sure the player is not in Horn Cave when it disables the chest.
And thats it, you now have a quest to find Tiber Septims Sword and all you had to start with was a single line of dialog.
Final thoughts.
This quest will run once and never run again, a mod reset will be needed to make it usable again in future tutorials IF you do not keep a save made before you started creating this quest. Its important to know that quests that start at te beginning of the game will auto run the moment the game loads. Any save you make after that already has that quest running in it. Which can make tweaking the quest difficult if its already running. So for this reason, always keep a save handy thats not had the quest running in it and use that for testing.
There are several ways to improve this quest now the basic building blocks are there, we can easily add more monsters, have guards follow you and protect you on the quest without editing the quest, but thats for another tutorial. All you need to know right now is that this is the core quest, the part you test before you make it too difficult to test on your own. You play this light weight version to death as a mod maker, making sure this version works correctly before you add anything fancy bits I will be telling you about in future.
Next time we will cover topics like Parent objects, how to use conditions to make sure packages run on NPCS at the right time and use these to make this quest one hell of a battle. :)
Enjoy.
Login Form
Forum and Website Logins
Please be aware that the forum and the main website are 2 completely different logins.
Skyrim Menu
Fallout New Vegas Menu
Fallout 3 Menu
Oblivion Menu
Game Guides
Misc Menu
Who is online
We have 51 guests and 2 members online
Members Online Today
Total Members Online Today: 11FatGiant Gwynfael sonicfast01 Valin777 giskard 42wolfe42 DOW Garathil nikki191 oblivionmaster310 Vagn















