scripting making something not be there and appear

Post » Thu May 26, 2011 10:05 pm

ok so i'm trying to work on a book sorter that instead of having "fake" copies of the book appear on the shelf i was thinking of the fake books being containers (good idea bad idea?) i'm not much of a script writer i have borrowed a lot (and will give or ask permission when needed before i release) i just really need some verification that i'm seeing it rite. so to have it not be there and appear when some thing is put in the first time.

i would need a script like so from marcmori mannor

begin marcBookScriptshort LR_book_localshort LR_book_addsitselfIf ( LR_book_local == 0 )	Disableelse	If ( LR_book_addsitself == 0 )		set marcBookcounter to ( marcBookcounter + 1 )		PlaySound, "Item Book Down"		Enable		set LR_book_addsitself to 1		stopscript marcBookScript	endifendifend




and to have it appear after being sorted i would need

set "_marc_book001".LR_book_local to 1


rite?

now what i'm wondering is would i have issues with another copy of a book being put in the already appeared container?
User avatar
Phillip Hamilton
 
Posts: 3457
Joined: Wed Oct 10, 2007 3:07 pm

Post » Fri May 27, 2011 11:47 am

I recommend against making the books on the shelves containers, although there may be a reason for making the bookcase itself a container - it depends upon how you want the player to be able to retrieve a book. Another advantage for having the books be books is you can script then so the player can read them as books without removing them from the bookcase.

and to have it appear after being sorted i would need
set "_marc_book001".LR_book_local to 1

rite?

Yes.

marcBookcounter appears to be a global variable, but I cannot tell its purpose.

now what i'm wondering is would i have issues with another copy of a book being put in the already appeared container?

Depends upon what you mean by issues. It will not make the game crash or anything so dramatic, but depending upon how it is handled additional copies could be 'lost'. The code as written does not seem to provide for multiple copies of the book, however whatever is setting "_marc_book001".LR_book_local to 1 may be keeping track of the number of copies of each volume. However, I think the code could be modified in a way to keep track of the number of copies 'locally' if that is what you require.
User avatar
Kaylee Campbell
 
Posts: 3463
Joined: Mon Mar 05, 2007 11:17 am

Post » Fri May 27, 2011 7:54 am

I recommend against making the books on the shelves containers, although there may be a reason for making the bookcase itself a container - it depends upon how you want the player to be able to retrieve a book. Another advantage for having the books be books is you can script then so the player can read them as books without removing them from the bookcase.


Yes.

marcBookcounter appears to be a global variable, but I cannot tell its purpose.


Depends upon what you mean by issues. It will not make the game crash or anything so dramatic, but depending upon how it is handled additional copies could be 'lost'. The code as written does not seem to provide for multiple copies of the book, however whatever is setting "_marc_book001".LR_book_local to 1 may be keeping track of the number of copies of each volume. However, I think the code could be modified in a way to keep track of the number of copies 'locally' if that is what you require.

the marcbookcounter is that he has and x/542 books though i think he had included some mod books

i'm working picking out the quest related unique books/scrolls that only appear once and have all MW+expantions and an addon with the TR books.

do you know of a mod or book that has a script that i could look at to see how to make a book readable but can't be taken?

i wasn't planing on having a counter but my count so far total books/scrolls (non-magical) is 797. so the book as a book that can't be taken might be a better idea marcmori you can run off with the book which i was trying to stop so that the placement stays organized. though the container thought was so you wouldn't have to pick them out of a chest full of different books and the fact that book rotate makes them not stack so it's kinda a pain sorting through to get rid of the dupes.

it's for a house mod i started on that would sort all ingredients MW with an add on for TR and others, i then added a spell scroll sorter (by school) and some one suggested a book sorter which kinda fits with the theme of being able to drop a bunch of stuff in a matter of minutes in stead of 20! i'm also thinking of potion crates that wills take all MW+expantions potions and sort them by ? i'm still working on that but i would like to have it be like 8 or 9 crates.

also thanks so for the help
User avatar
Kathryn Medows
 
Posts: 3547
Joined: Sun Nov 19, 2006 12:10 pm

Post » Fri May 27, 2011 12:35 am

do you know of a mod or book that has a script that i could look at to see how to make a book readable but can't be taken?

This is the script I use for the purpose:

short doOnceif ( OnActivate == 1 )	if ( menumode == 0 )		Activate	else		Messagebox "Open bookcase to remove this volume."	endifendifif ( doOnce == 0 )	set doOnce to 1	Disableendif

User avatar
Cody Banks
 
Posts: 3393
Joined: Thu Nov 22, 2007 9:30 am

Post » Fri May 27, 2011 3:45 am

cyran0 did you make a library mod resource?
User avatar
Cody Banks
 
Posts: 3393
Joined: Thu Nov 22, 2007 9:30 am

Post » Fri May 27, 2011 1:56 am

I created a library mod resource years ago, but it has not been much incorporated. Library sorters were coming into fashion at that time, but mine was designed so the player was responsible for placing the books him/herself. I have been contemplating a dramatic update in a manner similar to my alchemy lab that will likely include sorting capability. If you want to examine how I approached the problem, you can download the mod from http://home.earthlink.net/~cyran0/MWPage.htm.
User avatar
kasia
 
Posts: 3427
Joined: Sun Jun 18, 2006 10:46 pm

Post » Thu May 26, 2011 9:25 pm

i'm not much of one to write a unique script but more to use others for my needs. when you posted your script i recognized it from you mod it's been a bit of a resource to me. it seams that aside from your approach and marcmori they are the only two out there. i was aiming for a alchemy sorter kind of sort i wanted to have the books on the shelves be containers so that you could route it down to one of each and sell off the rest i was also thinking of using the better books and vibrant morrowind 3.0 covers so that it's readable from the outside what it contains but i'm thinking it's going to be a future add on since there is some much to cut and paste together script wise along with book/containers to be made. the house mod so far has sorters for all mw ingred and and add on for TR i also have a magic scroll sort by school and am putting together a potion sorter so you can pick and choose i was thinking of doing keys but i think that would be a bit of a pain though they would all end up in the same container.

if you do remake your library mod let me know i'd help out if needed
User avatar
Siobhan Thompson
 
Posts: 3443
Joined: Sun Nov 12, 2006 10:40 am


Return to III - Morrowind