Difference between revisions of "Unplayable Items"

245 bytes added ,  14:21, 21 September 2006
revert to Elder's changes, fixed Scruggs's name, again, and added bit about JOG's early mods. Not sure those are entirely relevant, but I'll leave them for now.
imported>Scruggs
m (Just editing spelling of my user name...)
imported>DragoonWraith
(revert to Elder's changes, fixed Scruggs's name, again, and added bit about JOG's early mods. Not sure those are entirely relevant, but I'll leave them for now.)
Line 90: Line 90:
Aside: This works equally well for basic items, etc. However, much of the time you want to introduce a persistant scripted item in to the game. This is a bit more tricky since objects easily lose their scripts when being moved from 3D (the world) to 2D (an inventory/container). To do this firstly it is a good idea to have a room of your own to hold stuff, even if you can never get to this area from inside the game. The reason is by doing this you will never cause mod conflicts. You then need to:
Aside: This works equally well for basic items, etc. However, much of the time you want to introduce a persistant scripted item in to the game. This is a bit more tricky since objects easily lose their scripts when being moved from 3D (the world) to 2D (an inventory/container). To do this firstly it is a good idea to have a room of your own to hold stuff, even if you can never get to this area from inside the game. The reason is by doing this you will never cause mod conflicts. You then need to:


(1) MyObject.MoveTo player  
(1) MyObject.MoveTo player [actually optional, depending on object]


(2) MyObject.Activate player
(2) MyObject.Activate player
Line 101: Line 101:
Tokens on the player: Very useful for OBSE key programming. It appears necessary to do this in 2 steps:
Tokens on the player: Very useful for OBSE key programming. It appears necessary to do this in 2 steps:


(1) set tokenRef to player.AddItem MyPlayerToken 1
(1) set tokenRef to player.PlaceAtMe MyPlayerToken 1


(2) tokenRef.Activate player
(2) tokenRef.Activate player
Line 112: Line 112:


Token Origin: I wish I could say I invented tokens but I didn't. It appears they started out in thread discussions and were eventually put to use by early adopters such as Scruggs. Through thread discussions, I have only helped solidify our understanding of how and when to use them.
Token Origin: I wish I could say I invented tokens but I didn't. It appears they started out in thread discussions and were eventually put to use by early adopters such as Scruggs. Through thread discussions, I have only helped solidify our understanding of how and when to use them.
[[User: JOG|JOG]] may have released the first tokens ever in his proofs-of-concept, [[User:JOG#The_Generous Giant_of_Tamriel|The Generous Giant of Tamriel]] and [[User:JOG#Dagger_Mould|Dagger Mould]].


[[Category: Useful Code]]
[[Category: Useful Code]]