Object scripts

Old and generally outdated discussions, with the rare hidden gem. Enter at your own risk.

Moderators: Haplo, Lead Developers

Locked
User avatar
presh
Developer
Posts: 266
Joined: Tue Oct 26, 2004 3:22 am
Contact:

Object scripts

Post by presh »

Hello,

Is it possible to attach script to things, say a book, and have it change based on what the PC has done?

Heres what I want to do. I have a small note in the Alma Rulas palace, and it talks about temple stuff. However it becomes irrelevant if the PC has completed the main quest. So can scripts check if the PC has completed the main quest and replace the note with another note that is more up to date?

Sorry, this might be a really stupid question - I know nothing about scripting.

P.S. I know that I'm not allowed to attach scripts to interiors, just seeing if it is possible.
"Poverty is the worst form of violence."
-- M. Ghandi
Saibot
Developer
Posts: 0
Joined: Wed Apr 20, 2005 11:05 am
Location: Utah

Post by Saibot »

Im still pretty new at scripting but i've seen doors be replaced through scripting, so I'm pretty sure its possible.
User avatar
presh
Developer
Posts: 266
Joined: Tue Oct 26, 2004 3:22 am
Contact:

Post by presh »

Cool. Thank you.
"Poverty is the worst form of violence."
-- M. Ghandi
Stalker
Developer Emeritus
Posts: 4576
Joined: Fri Apr 09, 2004 9:12 pm
Location: Ukraine
Contact:

Post by Stalker »

Possible an extremly easy. I'll write it in a few mins.
[img]http://img430.imageshack.us/img430/3336/oblivionforum5tb.jpg[/img]

Your friendly slavedriver.
Assassinace
Developer
Posts: 811
Joined: Thu Aug 21, 2003 10:56 am
Location: Dreamland

Post by Assassinace »

Yeah you just remove and add the object with the script based on if the main quest is done. At any rate I'll write it tonight if stalker doesn't do it.
Stalker
Developer Emeritus
Posts: 4576
Joined: Fri Apr 09, 2004 9:12 pm
Location: Ukraine
Contact:

Post by Stalker »

Assassinace wrote:Yeah you just remove and add the object with the script based on if the main quest is done. At any rate I'll write it tonight if stalker doesn't do it.
Please do. I have realised that sadly I don't have the time for it. After all it is needed to be tested too.
[img]http://img430.imageshack.us/img430/3336/oblivionforum5tb.jpg[/img]

Your friendly slavedriver.
User avatar
Zalzidrax
Developer
Posts: 898
Joined: Wed Dec 03, 2003 7:26 am
Location: Bothell, WA

Post by Zalzidrax »

Simply check if the cell has changed and if the player has the proper journal entry, and if those both are true enable the new note and disable the old one.
Assassinace
Developer
Posts: 811
Joined: Thu Aug 21, 2003 10:56 am
Location: Dreamland

Post by Assassinace »

begin SCRIPTX

if ( GetPCCell "???" == 1)
if ( GetJournalIndex "Dagoth UR" = x )
PlaceItem "note2" x y z zrot
Disable
endif
endif

end SCRIPTX

Ok now for explanation
SCRIPTX will be your scripts name

??? will be the cell the note is in

"Dagoth UR" will be the main quest journal entry name and x will be the actual entry number

"note2" will be the id of the 2nd note and xyzzrot will be it's coordinates (You can alse just enable the book rather then creating it if you add the note and disable it which is probly easier)

I think that should be everything. Most of that info you can find in the editor but if you have any questions please ask.
User avatar
Argoth
Developer
Posts: 98
Joined: Mon Aug 30, 2004 1:43 pm

Post by Argoth »

Just a note, if the two books that you are placing are unique it would be probably be easier to put a script on each book and have the script disable and enable them; but the other script would work better if you have many different object. Remember also that in order to delete a specific object it has to be unique (unless you put the scipt on the object and do a cell check) because if you place 5 of the same books you cannot specify which one you are referencing.

Code: Select all

if ( GetJournalIndex "Dagoth UR" > x )
    Disable OR Enable
endif
User avatar
presh
Developer
Posts: 266
Joined: Tue Oct 26, 2004 3:22 am
Contact:

Post by presh »

The two books are unique, so that isn't a problem.

It is a little while before I can add them because I am just building the interior, and scripts are added later.

Thank you for the help.
"Poverty is the worst form of violence."
-- M. Ghandi
User avatar
Raijin
Member
Posts: 11
Joined: Wed Jul 13, 2005 10:45 pm
Location: NC, USA

Post by Raijin »

Actually, if Dagoth Ur has been killed, I'd suggest just having the first note delete itself, and then have the second note enable itself.

Delete:

Code: Select all

   disable
   setdelete 1
Locked