A quick (Hopefully simple) Couple of questions...

Post » Fri May 27, 2011 5:21 am

1)

How do I use the Enable / Disable functionto enable or disable objects or NPC's at certain times, or after a period of time?


2)

How do I make a dialog topic only become avalible after I talk to a certain person? I already have the dialog option, It is supposed to be on EVERY NPC (Which it is). All I need to know is how to only make it become avalible after I speak to a certain person.

Cheers,

Shadowform.
User avatar
Emzy Baby!
 
Posts: 3416
Joined: Wed Oct 18, 2006 5:02 pm

Post » Fri May 27, 2011 7:42 am

1)
Well, this is fairly basic scripting you'll be glad to hear!
To enable a previously disabled object/entity etc... then just use [ObjectReferenceID].Enable. The Reference ID is the one that you can set in the editor by double clicking on the certain object. It's exactly the same for disabling objects, just with [ObjectReferenceID].Disable.
Now comes the point of when and where to call this. There are so many options that it's not even funny. You can call the function when they, or someone else, has been hurt, hit, are dead; and complicate that by adding more criteria, such as when someone is hit - at noon - in this certain cell.
You mentioned certain times, which is entirely possible. Check http://cs.elderscrolls.com/constwiki/index.php/Category:Time_Functions to see all the time related options for your script. GetCurrentTime and GetDayOfWeek would be your best bets. If you wanted to do it after a period of time, you might want to use a http://cs.elderscrolls.com/constwiki/index.php/Scripting_Tutorial:_Creating_a_Simple_Timer. This would take too long to explain here, and the explanation on the page is really good. It's not a hard thing to create, but you'll need to understand it to change it.
And where to call it is another matter. You have 2 main option: as part of a Quest or as part of a Script. The quest scripting is better for small changes after certain things have been done along the quest line - such as disabling something when an actor dies; or enabling more monsters in a cave when something happens in the quest. Scripting with the script editor in the construction set is a better idea when you just want to make a more complex set of conditions and possibilities. You have countless more options with the script editor, but also countless more complications if you get something wrong.
2)
Well, this is probably slightly harder, but not by much.
What you want (you'll be glad to know...) is a quest! It doesn't have to be long, and the player doesn't even have to be able to see it - it just helps a lot for logical strings of events (so when I do this, this happens, which can then lead to this... etc). In your case, you want a quest that basically says 'When I've spoken to this man, progress along a quest stage, and enable this dialogue option'.
Again, I don't want to turn this into an essay on how to make a quest, so you might like to read http://cs.elderscrolls.com/constwiki/index.php/Quest_Tutorial. It looks most relevant to you. If that doesn't fit the bill, then you could try all manner of quest tutorials you further your knowledge. An appendix of all of them available on the wiki can be found http://cs.elderscrolls.com/constwiki/index.php/Category:Quest_Tutorials.

Just a final word of advice - when in trouble, steal something from the vanilla Oblivion (within reason, of course)! So, if you want to know how a certain bit of a quest works, think back to when you played Oblivion, and see if anything did (roughly) what you wanted it to do. For example, that quest with Glarthir getting all worked up because he thinks he's being watched only allows him to appear at the back of the church at midnight (It's called Paranoia, is MS38 in the Construction Set, and more can be found http://www.uesp.net/wiki/Oblivion:Paranoia). That could help you to learn more about how time functions might work.

All the best, and I hope your mod works well! Feel free to message me if I don't reply to this thread quickly enough. :)
User avatar
Clea Jamerson
 
Posts: 3376
Joined: Tue Jun 20, 2006 3:23 pm


Return to IV - Oblivion