Very unusual Myst-like script needed

Post » Thu Dec 24, 2009 8:50 pm

I'm trying to do a "linking book" effect like in Myst with a couple books I'm making for a mod to practice cleverly hiding stuff.

When "Take" is chosen, it teleports the player to a specific area and makes sure the book stays in the player's inventory. How do I make that happen?
User avatar
Jack Bryan
 
Posts: 3449
Joined: Wed May 16, 2007 2:31 am

Post » Fri Dec 25, 2009 3:28 am

Knock up a script that 'starts' when you activate the book, but waits till Menumode == 1 (basically you close the book)

THEN start a timer or something (one or two seconds), just for added effect, and then have it teleport it you off to wherever.


[sorry, im bit rushed atm, sure someone else can knock up an example of this for you. Read: Pluto]
User avatar
Mackenzie
 
Posts: 3404
Joined: Tue Jan 23, 2007 9:18 pm

Post » Fri Dec 25, 2009 11:52 am

Actually, I decided I need the book to ask the player if they want to teleport when take is selected. Otherwise, it could cause automatic accidental teleports that may screw with a player's game plans. How would this kind of script work?
User avatar
Patrick Gordon
 
Posts: 3366
Joined: Thu May 31, 2007 5:38 am

Post » Fri Dec 25, 2009 9:03 am

Also, here is a sample of my book text contents to make the images appear in the books. It works, but is there a way to make the image display on the right page instead of the left?









User avatar
Lavender Brown
 
Posts: 3448
Joined: Tue Jul 25, 2006 9:37 am

Post » Fri Dec 25, 2009 6:59 am

Add a bunch of
's before the image. I'm not sure how many lines are on a page; you might have to play around a little bit with how many you need.
User avatar
Raymond J. Ramirez
 
Posts: 3390
Joined: Sun Oct 14, 2007 8:28 am

Post » Fri Dec 25, 2009 9:19 am

I did try adding a bunch of those BR tags before the image, but it didn't move it at all.
User avatar
Katy Hogben
 
Posts: 3457
Joined: Mon Oct 30, 2006 12:20 am

Post » Fri Dec 25, 2009 11:21 am

Ok, just tested this and it worked.

.










Apparently, MW ignores leading empty lines. So you'll have to place some text on the very first line (I just used a period) and then put in your BR tags.
User avatar
Kayla Oatney
 
Posts: 3472
Joined: Sat Jan 20, 2007 9:02 pm

Post » Fri Dec 25, 2009 12:04 am

I actually typed in the town names and set it for Daedric font. I may put in blocks of text in Daedric on the left page of all the books later, but it's not critical.
User avatar
DeeD
 
Posts: 3439
Joined: Sat Jul 14, 2007 6:50 pm

Post » Fri Dec 25, 2009 4:07 am

Actually, I decided I need the book to ask the player if they want to teleport when take is selected. Otherwise, it could cause automatic accidental teleports that may screw with a player's game plans. How would this kind of script work?


Righto. The script steps would be:

1. Activates when book is picked up
2. Wait for book to be closed (closed = either taken or closed)
3. Checks to see if book is in inventory
4. (If it is): Start quick timer for effect (bit annoying when message pops up IMMEDIATELY after taking it)
(If it isnt): Reset script.. and await reactivation.
5. Offers dialogue [You feel some mystical power pulling you away from this place. Do you want to give in and let it take you away? Yes, No]
6. (Yes): Awesome. Play teleport sound, and use whatever 'teleport' function is relevent for the destination. (Going to an exterior or interior cell?)
(No): Awwww.. [You resist the magical pull until it fades away. Maybe you should look in the book again somtime]

Only offhand problem i can see with this script is that im not 100% sure if it will detect you reading the book from your inventory as an 'activation'. Think i ran into this problem in some mod i made years ago...

Once again, i dont really have the time to knock it up for you. If this is what you want, and you ask nicely, i might be convinced to do it tonight ;)
Or maybe you can do it yourself. Not sure what scripting skill level you haz.

Gl
User avatar
Louise Lowe
 
Posts: 3262
Joined: Fri Jul 28, 2006 9:08 am

Post » Fri Dec 25, 2009 10:29 am

I have no scripting skill level, but I will take it one piece at a time, working with a dummy book, and when it works I'll copy the scripts to the actual books and change the coordinates. And if I fail well I will say so here.
User avatar
jadie kell
 
Posts: 3497
Joined: Sat Jul 29, 2006 3:54 pm

Post » Thu Dec 24, 2009 9:48 pm

Okay I'm lost. However, the books have been placed, so as soon as the script is finished and tested we can have release!
User avatar
Eddie Howe
 
Posts: 3448
Joined: Sat Jun 30, 2007 6:06 am

Post » Fri Dec 25, 2009 3:03 am

My script does absolutely nothing. It worked when tested on a misc item, but not on a book. Here it is.


Begin bookseyd

short button
short messageOn
short reset
short OnPcEquip

if (MenuMode == 0)
return
endif

if ( OnPCEquip == 0 )
set reset to 0
endif

if ( reset == 1 )
return
endif

if ( OnPCEquip == 1 )
if ( reset == 0 )
set OnPCEquip to 0
MessageBox "Do you want to go to Seyda Neen?" "Yes" "No"
set messageOn to 1
endif
endif

if ( messageOn == 1)

set button to GetButtonPressed

if ( button >= 0 )
set messageOn to 0
endif

if ( button == 0 )
PlaySound "Linking"
Player->PositionCell, -8680, -70138, 923, 23, "Seyda Neen"
set reset to 1

elseif ( button == 1 )
set reset to 1
return
endif

endif

End

User avatar
Sherry Speakman
 
Posts: 3487
Joined: Fri Oct 20, 2006 1:00 pm

Post » Fri Dec 25, 2009 4:52 am

Strange. I am working on a Myst Mod also. I wonder why Morrowind lends itself so well to Myst-like mods?

Anyway, I had trouble with making a linking book as well, but I was able to make a script that achieved everything I was looking for, like fading effects. It might be a little different from what you are looking for since it doesn't allow the player to take to book with them ( a no-no in Myst :nono:). But I think it can be altered so that can be achieved. If you are still interested, I can pull up my mod and post the script.
User avatar
Luis Reyma
 
Posts: 3361
Joined: Fri Nov 02, 2007 11:10 am

Post » Fri Dec 25, 2009 6:56 am

Please show me. I'll take a look at it.
User avatar
Tiffany Castillo
 
Posts: 3429
Joined: Mon Oct 22, 2007 7:09 am

Post » Fri Dec 25, 2009 4:33 am

This is a little bit more complicated since I required that the player not have the option to take the book. But the script will be similar either way. The script below is attached to an activator that looks like the book in the gameworld. The 'BookID' mentioned in the script is hidden under the floor so the script can find it :), and is what is actually read.


Begin Linking_Book_Scriptshort Statusshort Buttonfloat Timerif ( OnActivate == 1 )	Player->AddItem BookID 1	Player->Equip BookID   ;This makes the Take option unavailable.	Set Status to 1endifif ( Status == 1 )	Set Timer to ( Timer + GetSecondsPassed )	if ( Timer > 1 )   ;A slight delay to make sure the message is displayed over the book.		MessageBox "Place your hand on the image?" "Yes" "No"		Set Timer to 0		Set Status to 2	endifendifif ( Status == 2 )	Set Button to GetButtonPressed	if ( Button == 0 )   ;Yes was chosen		Set Status to 3	endif	if ( Button == 1 )   ;No was chosen		Set Status to 6	endifendifif ( Status == 3 )	FadeOut 2.0	Set Status to 4endif;An annoying requirement is for the player to click Close before teleported.if ( Status == 4 )	Set Timer to ( Timer + GetSecondsPassed )	if ( Timer > 2 )		if ( MenuMode == 1 )			MenuTest		else			Player->RemoveItem BookID 1			Set Timer to 0			Set Status to 5		endif	endifendifif ( Status == 5 )	FadeIn 2.0	Set Status to 0	PlaySound ID	Player->PositionCell "etc"endifif ( Status == 6 )	if ( MenuMode == 1 )		MenuTest	else		Player->RemoveItem BookID 1		Set Status to 0	endifendifEnd



No guarantee that there aren't bugs, but it worked for me whenever I used it. Here is an alternate script that I have not tested, so can't guarantee it will work. This has the take option available, and can be placed on the actual book itself.




Begin Linking_Book_Scriptshort Statusshort Buttonfloat Timerif ( OnActivate == 1 )	Activate	Set Status to 1endifif ( Status == 1 )	Set Timer to ( Timer + GetSecondsPassed )	if ( Timer > 1 )		MessageBox "Place your hand on the image?" "Yes" "No"		Set Timer to 0		Set Status to 2	endifendifif ( Status == 2 )	Set Button to GetButtonPressed	if ( Button == 0 )		Set Status to 3	endif	if ( Button == 1 )		Set Status to 6	endifendifif ( Status == 3 )	FadeOut 2.0	Set Status to 4endif;At this point,If the player chooses to Close the book rather than Take the book, s/he will be teleported without it, and may get trapped.if ( Status == 4 )	Set Timer to ( Timer + GetSecondsPassed )	if ( Timer > 2 )		if ( MenuMode == 1 )			MenuTest		else			Set Timer to 0			Set Status to 5		endif	endifendifif ( Status == 5 )	FadeIn 2.0	Set Status to 0	PlaySound ID	Player->PositionCell "etc"endifif ( Status == 6 )	if ( MenuMode == 1 )		MenuTest	else		Set Status to 0	endifendifEnd


That may or may not work as intended! I will look forward to your release. Good Luck!
User avatar
Breautiful
 
Posts: 3539
Joined: Tue Jan 16, 2007 6:51 am

Post » Fri Dec 25, 2009 1:20 am

The book script does nothing. I can't use the activator script as I have no idea where the player will be when they decide to use the book.
User avatar
saxon
 
Posts: 3376
Joined: Wed Sep 19, 2007 2:45 am

Post » Fri Dec 25, 2009 9:18 am

Okay, what I'm doing now is setting the book script on pickup, then calling a separate (global) script which is currently freezing the game when called. The script runs when "Take" is chosen from the environment, but not a container. The book script looks like it will do what it's supposed to now. Here is the faulty linking script called by the book:

Begin linkseyd

short linkstat ;variable to divide each part of the linking process into a different state

if (doOnce == 0)
set linkstat to lbseyd ;sets it to a global variable initiated in the book script
set doOnce to 1
endif

if ( linkstat == 1 )
PlaySound "Linking"
set linkstat to 2
endif

if ( linkstat == 2 )
Player->PositionCell, -8680, -70138, 923, 23, "Seyda Neen"
set linkstat to 3
endif

if ( linkstat == 3 )
FadeIn 2
set linkstat to 4
endif

if ( linkstat == 4 )
lseyd->Disable ;since book is on ground, makes it disappear
Player->AddItem lseyd 1 ;puts it back in player inventory
set lbseyd to 0 ;next three lines reset the variables to pre-activation values
set doOnce to 0
stopscript "linkseyd"
endif

End


Why is it freezing on activation?
User avatar
Carolyne Bolt
 
Posts: 3401
Joined: Mon Jul 10, 2006 4:56 am

Post » Thu Dec 24, 2009 10:43 pm

You might want to look up a mod called 'Magic Bottle Home' (or something to that effect) by MooCow It uses a bottle(substitute your book) to a special cell(your destination shown in your book) or just lets the player 'pick it up'(actually disables one copy and adds another to inventory) I think it needs MWSE though.
User avatar
Petr Jordy Zugar
 
Posts: 3497
Joined: Tue Jul 03, 2007 10:10 pm

Post » Thu Dec 24, 2009 10:16 pm

Getting better! There is now a functional prototype!

Thanks everybody for your code input, though the solution turned out to be based on a bit of seemingly irrelevant code in a different project I'm doing. It no longer pops the message box, when you're ready to link just drop it on the ground, open it, and hit "Take".
User avatar
MARLON JOHNSON
 
Posts: 3377
Joined: Sun May 20, 2007 7:12 pm

Post » Fri Dec 25, 2009 11:36 am

This project is nearing completion. All books' teleport coordinates are set and all work properly. It will release soon!
User avatar
zoe
 
Posts: 3298
Joined: Sun Nov 12, 2006 1:09 pm


Return to III - Morrowind