Jump to content

Script: Sleep, Enter Zone, Conversation


Mehra

Recommended Posts

I'm back again. I must be annoying the regulars by now. Sorry about that. Still lots to learn.

 

My dilemma is this: I would like the player to go to sleep, and when (s)he sleeps, they are warped to another place and the vision is blurry, and an NPC comes up and talk to the PC, after the conversation, the PC is warped back to the original sleeping cell and is given a journal update.

 

It is very similar to the Legacy portion of the Tears of the Fiend mod in that the player "dreams". But this isn't a ripoff of ANY sort. I am making a mod concerning the Sixth House, and instead of getting a messagebox, I'd like the player to feel more reality with actually being in the dream.

 

Any links or advice are appreciated. Thank you.

Link to comment
Share on other sites

  • Replies 42
  • Created
  • Last Reply

Top Posters In This Topic

Well first you will need a script that monitors when the player goes to sleep. If certain conditions are met (ie a quest stage) then it will wake up the player and move him/her to a "dream world". Possibly have the dream world have lots of fog when you make it and/or have a custom shader that makes everything look blurry.

 

Next you need either a script or an AI package to have the NPC start the conversation with the player. There's not much difference between the two. With scripting, you use "StartConversation" and you can choose the topic that the NPC speaks about. With an AI package, it has to be a Find package, and the topic is GREETING (you can have it link to your custom topic after the greeting).

 

Have the last line of the dialogue warp the player back to his/her bed and update the quest stage.

Link to comment
Share on other sites

So I'm getting the hang of the usage of the "If" "end if" and "end"s of scripting, but I definitely think I am missing something core in my script. Here's a copy of it so far. It doesn't work, I know I don't know why, but this is why I'm testing everything I can in order to figure scripting out. It's getting easier, and the help everyone in the forums is giving me is helping tremendously. I am terribly sorry to look so silly.

 

 

ScriptName AACaiusQuest5DreamScript

 

Begin GameMode

 

if AACaiusQuest4 == 30 (last quest done)

if isPCsleeping == 1

setstage AACaiusQuest5 10 (quest I want to start)

Messagebox "I am dreaming."

Player.getinworldspace AADagothUrIntroWorld (area I want the player to go)

disableplayercontrols

 

 

endif

endif

end

 

 

 

I would love to know what I am doing wrong so I can make a mental note. Although, I don't want everyone to think I expect everyone else to do it for me. Might as well post WHILE I work on it myself and see if the answers are the same.

 

Thanks guys. You rule.

Link to comment
Share on other sites

See, you're getting the hang of it! :) Don't get discouraged, and you definitely DON'T look silly. You're not only talking about modding, you're actively trying to do it, and that's a lot more than most people try!

 

A few things leap out at me:

 

From the wiki:

Example:

GetInWorldspace ChorrolWorld

 

Returns 1 if the actor is currently in one of the exterior cells of the specified worldspace. Always returns 0 if the actor is in an interior cell.

 

So your script is only checking to see if the player is in that worldspace-- not actually sending him/her there; and of course, the answer is 0, or in this case, "no."

 

You also might want to use "and" to link your two requirements: if (AACaiusQuest4 == 30) && (isPCsleeping == 1) -- I don't know if Oblivion will correctly run the script as you have it, or if it might only look at that first "if" and not the second. I still don't have a solid grasp on comparisons.

 

Finally, I believe if AACaiusQuest4 == 30 should actually be if GetStageDone AACaiusQuest4 MS09 30 == 1. As it stands, it looks like you're checking for a variable, which of course you're not doing.

 

(As always, I await someone with more know-how to correct my suggestions! :biggrin: )

Link to comment
Share on other sites

Oooh, I see. Well that clears it up a bit. You always seem to come to my rescue Nell. You are definitely getting a place in my shoutout for the mod for all your help so far. I will go back in (I have CS open right now working on it) and see what I can change.

 

Quick question, I am reading the CS wiki for startconversation function/command. I am trying to use an AI package to make the NPC in the worldcell approach the PC and initiate GREETING topic. But it seems to not be working on the AI package alone. Does he need a script for it to work? What I have down is that it is "FIND", getisID Player, which I think was wrong, and do it in the editor position in the current cell, aka DagothUrIntroWorld. Target is Player. Any idea what I did to mess it up?

 

Now, for playtesting purposes, I have a door that will take me straight to the worldspace, and I can talk to him, he says what I have him down for, but I have to initiate it. How can I make him do it? Is that to be put in with my dream script?

 

 

Thanks so far, this is coming along nicely. If I can get the hang of the dream sequence, I should be almost done with my scripting woes, unless I plan to make the mod more complicated. So far the quests are pretty simple, talk to this guy, get this item, and kill this dude.

 

 

EDIT: Still can't get the script to work. It seems to not be processing in the game, or maybe it's not attached to anything. I'll keep trying. If anyone comes up with something, let me know.

 

 

ScriptName AACaiusQuest5DreamScript

 

Begin GameMode

 

if (player.getstagedone AACaiusQuest4 30) && (isPCsleeping > 0)

player.setstage AACaiusQuest5 10

Messagebox "I am dreaming."

Player.moveto AAdagothdreammarker1

disableplayercontrols

 

endif

end

 

 

This is what I changed it to so far.

Edited by Mehra
Link to comment
Share on other sites

For your script, you should change "player.getstagedone" to just "getstagedone".

 

As for the AI package, do not use the condition "GetIsID Player". That condition means the NPC would only run the package if he/she is the player. Obviously, that's impossible.

Link to comment
Share on other sites

Lol, good point on the GetIsID. I don't know what the heck I'm doing half the time. But practice makes perfect. And I can't expect to get it right the first time. Trial and Error, eh?

 

Anyhow, I'll change that in a moment. But I seem to have run in an issue with the IsPCSleeping part of my script. If I take it out, and the teleport part, and just use "getstagedone", followed by "setstage", the script works ingame. I get my journal update. Sadly, I want to factor in that the PC is sleeping. Also I want the Player to be transported to my "Dream World". That part doesn't seem to work either. I even tried an XMarker. I'm just sitting at my computer, rocking it out to my music and testing different scripts over and over. Hopefully I'll figure out what I'm doing wrong. The Player just won't teleport. >.<

 

 

Here's my current script. Fo testing purposes for IsPCSleeping. I have tried other numbers other than the > 0.

 

 

ScriptName AACaiusQuest5DreamScript

 

Begin GameMode

 

if (getstagedone AACaiusQuest4 30) && (isPCSleeping > 0)

WakeUpPC

setstage AACaiusQuest5 10

endif

end

 

For your script, you should change "player.getstagedone" to just "getstagedone".

 

As for the AI package, do not use the condition "GetIsID Player". That condition means the NPC would only run the package if he/she is the player. Obviously, that's impossible.

Edited by Mehra
Link to comment
Share on other sites

The simple answer is that the PC is never sleeping in GameMode. When the PC is sleeping, there's a little bar showing time passing, right? That's a menu mode (1012 to be exact). So that part of the script should be in a menu mode block.
Link to comment
Share on other sites

*awkward moment* God I wish I could kiss you for that! (Seriously, just happy right now if you know what I mean)

 

Now to figure out how to add both. Back to the wiki! Thanks, I'll edit my post when I get that part fixed. Don't want to bump my own page over and over and tick the mods off. :)

 

 

EDIT: *throws confetti* IT WORKED! I can't believe it! I put myself off for weeks thinking I'd NEVER get this far! And in learning this specific piece of script, I really am not intimidated by the if, endif, begin, and end parts! Wow... Nellspeed was so right. This gets so much easier when you get past the scary threshold.

 

Now what remains for this quest is to fix that NPC issue from a little bit ago. I haven't edited him to your advice yet. But I hope I can figure out how to get him to approach me.

 

EDIT: Ugh, my game is crashing now. I don't know why. Yeah, this script is suddenly not working... :( My game crashes upon sleeping. I've narrowed it down to anything dealing with the NPC I want to approach me. What do I do now?

Edited by Mehra
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...