Object scripts
Moderators: Haplo, Lead Developers
Object scripts
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.
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
-- M. Ghandi
-
- Developer
- Posts: 811
- Joined: Thu Aug 21, 2003 10:56 am
- Location: Dreamland
Please do. I have realised that sadly I don't have the time for it. After all it is needed to be tested too.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.
[img]http://img430.imageshack.us/img430/3336/oblivionforum5tb.jpg[/img]
Your friendly slavedriver.
Your friendly slavedriver.
-
- Developer
- Posts: 811
- Joined: Thu Aug 21, 2003 10:56 am
- Location: Dreamland
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.
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.
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
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:
Delete:
Code: Select all
disable
setdelete 1