Jump to content

Script: Sleep, Enter Zone, Conversation


Mehra

Recommended Posts

Welcome to the wonderful world of bug-testing! (And thank goodness for fg109.) :happy: This is when it helps to have everything planned out on paper (or in a text document) ahead of time. I personally have an awful time trying to remember whih

 

So let's start with this-- if this is still your script:

 

 

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

WakeUpPC

setstage AACaiusQuest5 10

endif

 

I would change getstagedone AACaiusQuest4 30

 

to getstagedone AACaiusQuest4 30 == 1

 

Right now, the game doesn't know what you're checking-- it knows the quest and the stage, but nothing else. That == 1 tells the game that the player needs to be sleeping. (And remember, every variable's starting value is 0, until or unless something changes it.)

 

If that doesn't work, then take out the WakeUpPC line, and see if that does anything. And, of course, there's a big difference between "begin MenuMode" and "begin GameMode" and the multiple "begin On(fillintheblank)" options.

Link to comment
Share on other sites

  • Replies 42
  • Created
  • Last Reply

Top Posters In This Topic

I tried both of those, but if I use my script for the NPC that is supposed to talk to me, the game crashes on sleeping. Maybe my script is wrong for him? I don't understand if he is supposed to have an AI package too. Any help would be appreciated. Here's the NPC script I made.

 

 

Scriptname AAUnknownDreamtalk

 

Begin Gamemode

 

if (getstage AACaiusQuest5 10) && (player.getinworldspace AADagothUrIntroWorld)

sayto player, GREETING

 

endif

 

end Gamemode

 

Link to comment
Share on other sites

I'm going to keep linking to the CS wiki when I reply-- it can be such a pain to navigate, and I know there's stuff I'm leaving out, so I want to try & give you as much info as possible.

 

if (getstage AACaiusQuest5 10) && (player.getinworldspace AADagothUrIntroWorld)

sayto player, GREETING

 

isn't doing what you think it is. I think you're trying to check if stage 10 has been reached and if the player is in AADagothUrIntroWorld? So try

 

if (getstagedone AACaiusQuest5 10 == 1) && (player.getinworldspace AADagothUrIntroWorld == 1)

sayto player, GREETING

 

Getstage checks for the highest completed quest, and that's it-- you don't use a stage number with it.

 

When you use most of these commands, you have to tell it if you're looking for a yes or no answer. Not using a == 0 or == 1 (in this case) will confuse the game engine, resulting in a crash.

 

And you can just go with "end" instead of "end gamemode" -- which may be the other problem. We'll get to SayTo, etc in a bit. :)

Link to comment
Share on other sites

Ok, edited it. Tried again in game. Still crashing. T_T

 

Darn it.

 

Here are the three scripts I am using.

 

Quest Script for Transport:

 

 

ScriptName AACaiusQuest5DreamScript

 

begin MenuMode 1012

 

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

WakeUpPC

player.addspell AACaiusQuest5Start

player.moveto AADreamMarker

endif

end Menumode 1012

 

 

Script for NPC "Unknown" to Speak to PC:

 

 

Scriptname AAUnknownDreamtalk

 

Begin Gamemode

 

if (getstagedone AACaiusQuest5 10 == 1) && (player.getinworldspace AADagothUrIntroWorld == 1)

sayto player, GREETING

 

endif

 

end

 

 

Script For Scripted Spell Effect for Quest Update:

 

 

Scriptname AACaiusQuestDreamStartQuest

 

Begin ScriptEffectStart

setstage AACaiusQuest5 10

End

 

Begin ScriptEffectFinish

End

 

 

Hope this helps.

Edited by Mehra
Link to comment
Share on other sites

'SayTo player, Greeting' miiight be whats causing this, as 'GREETING' is not a normal topic. You could either put what you want them to say in a normal topic, or use 'StartConversation player', although this will start an actual dialog, rather than simply have the NPC 'say' the thing in Gamemode.

 

When you use most of these commands, you have to tell it if you're looking for a yes or no answer. Not using a == 0 or == 1 (in this case) will confuse the game engine, resulting in a crash.

This is not true. In fact, if all you are concerned about is that 'X != 0', then simply using 'if X', and avoiding the comparative entirely, is also preferable from an efficency point of view; as non-comparitive 'if's are faster to process as well.

Link to comment
Share on other sites

Wow PrettyMurky, I changed it and now I got it to work. Although I'm going to go run this again ingame to double check, but it seems my GREETING, which I want to be the important dialogue (and has the GOODBYE box checked), finishes and closes dialogue and then opens again. How can I STOP the dialogue? Is there a function/command for it?

 

Thanks though so far. Wow it didn't crash and he approached me.

 

ALSO, it seems disableplayercontrols isn't working. I had it in my original script, but took it out for testing because it wasn't working.

Edited by Mehra
Link to comment
Share on other sites

As NellSpeed said; 'End' is sufficient. Your 'End Menumode 1012' may be the cause of this.

 

If that doesn't work; try commenting out each script (with ;'s before each line). This is a very useful, if somewhat tedious, tool for finding where problems are. If the game still crashes with Script1 commented out, try Script 2. When then game stops crashing, you've found your bug.

Link to comment
Share on other sites

Any advice on my "disableplayercontrols" problem? Or was that in that reply? I edited my post pretty slow, so if you didn't catch it it's ok. It seems it doesn't activate that line. But let me go put in those ;.
Link to comment
Share on other sites

Your NPC will keep starting the dialog, because the conditions 'GetStageDone' and 'GetinWorldSpace' are still true. You'll need to change 'GetStageDone' to something else, perhaps 'GetQuestStage', although personally I'd do it with a simple quest variable. Then you'll need something in the Results script for your dialog topic, that sets whatever it is you choose to set, so that your NPC's condition is no longer true.

 

As for your 'DisablePlayerControls'; Where were you trying to use it?

Edited by PrettyMurky
Link to comment
Share on other sites

I was trying to put it in somewhere that will make the player unable to move while in the dream world and when they are teleported back to their sleeping bed, reenable. But so far, it doesn't seem to work at all.

 

And for some idiotic pebkac issue is causing the game to crash all over again. I don't see a different in the code from when it did just work. I think my game just hates me.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...