Starsickle Posted March 17, 2012 Author Share Posted March 17, 2012 (edited) after discovering the volume box, I like the idea of entering the hall and getting the quest better. Today I'm going to work on making the quest start work like it should and pointing you to the NPC you have to speak to, then upload a new version. Edited March 17, 2012 by blast0r Link to comment Share on other sites More sharing options...
Starsickle Posted April 6, 2012 Author Share Posted April 6, 2012 Hey, I'm back. It's time to separate out the opening script from the testing ones. Scriptname OpenBrewery extends ObjectReference ;Should this be extends quest? {This script opens the brewery} ObjectReference property FixedShack auto ObjectReference property RuinedShack auto function OpenSesame() Debug.MessageBox("The Brewery is now open!") RuinedShack.Disable() FixedShack.Enable() endFunction Now, I want to be able to do one of two things: 1. Call the script function from a fragment when the quest stage is set (Playing with it, nothing yet.) The quest stage would be set, and the script would simply do all the work. This way, I can just call that function whenever the time comes to actually open the brewery, either in a scene or when a quest stage is completed. OR 2. Make the script just call it's own OpenSesame()... which doesn't seem to compile. ( no viable alternative at input '(' ) It'd be nice if I just called the script and it did the job. Thanks for the help, again. I've made big strides since starting! Link to comment Share on other sites More sharing options...
fg109 Posted April 6, 2012 Share Posted April 6, 2012 I'm not sure I understand what you're trying to do. I thought you decided to use a trigger? Why are you using a quest stage to set it now? 1. I'm assuming you got rid of the trigger. So what object is this script on? You cannot call this function unless it happens to be attached to some object placed in the game. 2. You'll need to show what's the script you tried to compile and what all the error messages were. Link to comment Share on other sites More sharing options...
Starsickle Posted April 6, 2012 Author Share Posted April 6, 2012 I'm not sure I understand what you're trying to do. I thought you decided to use a trigger? Why are you using a quest stage to set it now? 1. I'm assuming you got rid of the trigger. So what object is this script on? You cannot call this function unless it happens to be attached to some object placed in the game. The quest is now triggered by my old volume box. It pretty much did everything for the sake of just seeing how it turned out, and now I'm separating the part that will enable and disable references. 2. You'll need to show what's the script you tried to compile and what all the error messages were. Error and code are pretty much what I posted. So - just to be clear - the new flow is like so: 1. Enter house, touch volume box. Quest starts2. Tind NPC, talk, maybe a scene.3. After getting them some stuff to get started, a few days pass and the statics can finally get enabled/disabled. Link to comment Share on other sites More sharing options...
fg109 Posted April 6, 2012 Share Posted April 6, 2012 (edited) Theno viable alternative at input '('tells me nothing. The compiler usually spits out that error if it was expecting a parameter at that line in that column, but didn't find it. Since your script doesn't use any parameters, it doesn't make any sense. So I wanted to see exactly where the compiler says the error is. But, about the first method, calling the function from another script. So you're calling the function from a quest stage fragment, right? If you've compiled any quest stage fragments, there should be a script attached to your quest now. Edit the script and add this property: OpenBrewery property MyTrigger auto Then edit that property to point towards your trigger (or whatever is holding that script). Go back to your quest stage fragment and call the function with: MyTrigger.OpenSesame() Edited April 6, 2012 by fg109 Link to comment Share on other sites More sharing options...
Starsickle Posted April 7, 2012 Author Share Posted April 7, 2012 Okay, I might as well Do this then: Here's the entire OpenBrewery script: Scriptname Star_NFB_OpenBrewery extends ObjectReference {This script opens the brewery} ObjectReference property Star_NFB_FixedShack auto ObjectReference property Star_NFB_RuinedShack auto ObjectReference property Star_NFB_FixedDoorFront auto ObjectReference property Star_NFB_AbanDoorFront auto ObjectReference property Star_NFB_AbanDoorSide auto ObjectReference property Star_NFB_FixedDoorSide auto function OpenSesame() Debug.MessageBox("The Brewery is now open!") Star_NFB_RuinedShack.Disable() Star_NFB_AbanDoorFront.Disable() Star_NFB_AbanDoorSide.Disable() Star_NFB_FixedShack.Enable() Star_NFB_FixedDoorFront.Enable() Star_NFB_FixedDoorSide.Enable() endFunction If you try to add OpenSesame(), or even remove the function wrapper altogether, you get this kind of error: Starting 1 compile threads for 1 files... Compiling "Star_NFB_OpenBrewery"... [b]SNIP![/b] \temp\Star_NFB_OpenBrewery.psc(21,10): no viable alternative at input '(' No output generated for Star_NFB_OpenBrewery, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed. Failed on Star_NFB_OpenBrewery Link to comment Share on other sites More sharing options...
fg109 Posted April 7, 2012 Share Posted April 7, 2012 This makes no sense at all... the compiler says that the error is on line 21, column 10, but your script is only 19 lines long. Link to comment Share on other sites More sharing options...
Starsickle Posted April 7, 2012 Author Share Posted April 7, 2012 (edited) This makes no sense at all... the compiler says that the error is on line 21, column 10, but your script is only 19 lines long. EDIT: That's because I Added OpenSesame() at the end. I'm trying to show the error. If you remove the Function wrapper, And just try to execute the first reference disable/enable, the error is there. If you try to call the function via fragment, the error line is the first, obviously. Okay? Edited April 7, 2012 by blast0r Link to comment Share on other sites More sharing options...
fg109 Posted April 7, 2012 Share Posted April 7, 2012 So are you saying that the compiling error occurs if you try either of these? Scriptname Star_NFB_OpenBrewery extends ObjectReference {This script opens the brewery} ObjectReference property Star_NFB_FixedShack auto ObjectReference property Star_NFB_RuinedShack auto ObjectReference property Star_NFB_FixedDoorFront auto ObjectReference property Star_NFB_AbanDoorFront auto ObjectReference property Star_NFB_AbanDoorSide auto ObjectReference property Star_NFB_FixedDoorSide auto function OpenSesame() Debug.MessageBox("The Brewery is now open!") Star_NFB_RuinedShack.Disable() Star_NFB_AbanDoorFront.Disable() Star_NFB_AbanDoorSide.Disable() Star_NFB_FixedShack.Enable() Star_NFB_FixedDoorFront.Enable() Star_NFB_FixedDoorSide.Enable() endFunction OpenSesame() Scriptname Star_NFB_OpenBrewery extends ObjectReference {This script opens the brewery} ObjectReference property Star_NFB_FixedShack auto ObjectReference property Star_NFB_RuinedShack auto ObjectReference property Star_NFB_FixedDoorFront auto ObjectReference property Star_NFB_AbanDoorFront auto ObjectReference property Star_NFB_AbanDoorSide auto ObjectReference property Star_NFB_FixedDoorSide auto Debug.MessageBox("The Brewery is now open!") Star_NFB_RuinedShack.Disable() Star_NFB_AbanDoorFront.Disable() Star_NFB_AbanDoorSide.Disable() Star_NFB_FixedShack.Enable() Star_NFB_FixedDoorFront.Enable() Star_NFB_FixedDoorSide.Enable() If that's what you tried, then of course you would get an error. Everything except property and variable declarations must be enclosed in either events or functions. If that's not what you tried, then I don't understand what you were saying... If you have a quest script on your quest, then you can add this to it: ObjectReference property Star_NFB_FixedShack auto ObjectReference property Star_NFB_RuinedShack auto ObjectReference property Star_NFB_FixedDoorFront auto ObjectReference property Star_NFB_AbanDoorFront auto ObjectReference property Star_NFB_AbanDoorSide auto ObjectReference property Star_NFB_FixedDoorSide auto function OpenSesame() Debug.MessageBox("The Brewery is now open!") Star_NFB_RuinedShack.Disable() Star_NFB_AbanDoorFront.Disable() Star_NFB_AbanDoorSide.Disable() Star_NFB_FixedShack.Enable() Star_NFB_FixedDoorFront.Enable() Star_NFB_FixedDoorSide.Enable() endFunction Then on the quest stage tab, at the quest stage where you want to call the function, change kmyQuest to your quest script. You can change it from the drop down box right above where you type in your fragment code. Once you've changed the kmyQuest for that stage, you can call the function by putting this in as the fragment: kmyQuest.OpenSesame() Link to comment Share on other sites More sharing options...
Starsickle Posted April 11, 2012 Author Share Posted April 11, 2012 Ah, it finally works. I see now. I saw something else that said something similar but it just clicked! Thanks! In the meantime, I made a dagger that explodes money. I'm very happy with it. :D New version going up. Link to comment Share on other sites More sharing options...
Recommended Posts