Jump to content

Error in script.


ChrisPydtank

Recommended Posts

Hello... im having issues trying to get this script to work... ill show you... im sure someone might find errors but i cant check em all until i fix this error... but this script is based on G.E.C.K webpage of tutorials that includes vault 74 which im doing.

 

The Script:

 

scn Vault74TerminalOSOSCRIPT

 

begin onActivate

 

ShowMessage TerminalActivateElsewhere ;The message that has the (2) choices.

set awaitingInput to 1

 

end

 

begin gamemode

if awaitingInput == 1

set buttonVar to getbuttonpressed

 

if buttonVar > -1

set awaitingInput to 0

 

if buttonVar == 0

; choice 1

ShowMessage Failed ; The message so they try again but pick other option.

elseif buttonVar == 1

; choice 2

SetStage Vault74Saga 11 ; My Quest Objective to find another way.

 

endif

 

endif

 

end

 

begin onActivate

 

if GetHasNote V74PasswordSubLevel ;The password holotape they need to make it work

Activate

endif

 

end

 

So basically 2 things... before the error, if this works if nobody says it will have many errors... once they finally pick second option... I want them not to be able to press until they get the password "if GetHasNote V74PasswordSubLevel"... what would I put?

 

But the error says this when I save:

 

"Line 6: Unknown Variable 'awaitingInput'"

 

Also I think at some point it said that "set buttonVar to getbuttonpressed" the bold also was a unknown variable.

 

The script came from GECK webpage:

 

GECK

 

So I followed it and well it not working.

 

can somebody help!?

 

thanks

 

Chris

Link to comment
Share on other sites

Ok so how do I make the menu after you pick the choice to not play again???

 

Its says

 

"the terminal is opened elsewhere..." i forgot why lolz,

 

"Choice 1: Try to hack" but it fails

"Choice 2: find another way" When they clcik this choice I make the quest activate... But I dont want them to activate the terminal again and get those choices again... which I tested it does... I dont want that... I want it to be activated only when GetHasNote for the password... then it activates...

Link to comment
Share on other sites

So i read it... some things I didnt understand make more sense now... but i still cant think...

 

If i make new message choice... so the choice with the password will activate the terminal.... i write it like this maybe...

 

scn Vault74TerminalOSOSCRIPT

 

short AwaitingInput

 

short buttonVar

 

begin onActivate

 

if GetHasNote V74PasswordSubLevel ;The password holotape they need to make it work

Activate ; to activate the terminal.

 

else

 

ShowMessage TerminalActivateElsewhere ;The message that has the (2) choices.

set awaitingInput to 1

 

endif

 

end ;because when they first press it without password they wont have password so that statement will be false and their for else just show message etc?

 

begin gamemode

if awaitingInput == 1

set buttonVar to getbuttonpressed

 

if buttonVar > -1

set awaitingInput to 0

 

if buttonVar == 0

; choice 1

ShowMessage Failed ; The message so they try again but pick other option.

elseif buttonVar == 1

; choice 2

SetStage Vault74Saga 11 ; My Quest Objective to find another way.

 

endif

 

endif

 

end

 

Like this looks like it wont show choices even if you have password like it did... i couldnt activate coz it gave me choices instead... so i couldnt open the door... but whilst I dont have password then when i press again it will give me the options again... I still cant work out what to write to make it only activate once until the first block lines becomes true...

Link to comment
Share on other sites

i would assume its because there's no reference for the activate command.

 

so it probably should be something like:

 

TERMINALID.activate

 

and maybe I'm not getting the point here, but wouldn't it work like this much easier: ?

 

begin gamemode

if player.gethasnote V74PasswordSubLevel == 1

TerminalID.unlock

endif

end

 

that just unlocks the terminal

Link to comment
Share on other sites

Well im a noob so yeah... Im about to try my way and see if it gets it going... but yeah it wasnt answering my question... I want if the player goes and presses on terminal for the door first to get the options mentioned... when they click "Find another Way" they get objective to find another way... but coz if they tried to hack it and failed then its no point for them to try again... but if they press it again... I dont want the actual options come up again... just want them to press and it does nothing... or even if the player can get the message "can't activate at this time". Coz the terminal can load only one script in it... I need it to register the options to be read once... and only read true for the first bit which is

 

"if GetHasNote V74PasswordSubLevel

Activate ;this is what on default terminal has to start the hacking... or straight to what I have in it since they will have the password to it/if its unlocked anyways... so the terminal doesnt need TerminalID.unlock.

 

altho why do you have to put .unlock? i have in the terminal to unlock the door as a result script which seemed to stop working but its connected via linkref...

Link to comment
Share on other sites

Ive worked it better... its awesome now... does anybody know where i can find a script full list of everything that has explanation???

 

things I dont get is:

 

"short" (AwaitingInput)

 

whats short mean?

 

things like "ID.unlock" why does it have a fullstop before unlock... why does it become error with ID (Space) unlock...

 

I need to work out why the optional objectives have see through marker... coz I want an optional objective to be the see through and main the solid marker... but I have no idea how... nor could find any indication on a main quest Data for the optional objectives other then the display has (Optional)...

 

I thought

 

SetObjectiveDisplayed MS17 10 1

set MS17.QuestInProgress to 1

if ( MS17.FoundVT == 0 )

ShowMap VaultTecHQMapMarker

SetObjectiveDisplayed MS17 20 1

 

from Misc. quest Agatha's Song in this result script might have the answer to the different marker...

 

Or maybe going through all the commands it had nothing about it... must be something i missed else where...

Link to comment
Share on other sites

well towards the password holodisk:

I assume you have a hacking level set for the terminal and if the player has that holodisk, they aren't supposed t be required to hack the terminal since they have the password already and unless i missed something, there's no way to make the password you picked in the holodisk show up in the hacking screen, the easiest way to achieve what you want is to go with a TerminalID.unlock (which basically is the same command as the console unlock "click on door/safe/terminal"), so if you have the note you get straight into the Terminal bypasing the hacking screen. and this is what you wanted to do right ?

 

towards the optional:

 

I have never made a quest with an optional quest stage, but i would assume you could just do it like this:

make it a normal quest stage, and for the description just type (optional) in front of whatever it is and just add both the next main stage and the optional stage as the displayobjectives (just make sure the optional one has a lower Index than the main one (like 39 for the optional and 40 for the main) if the player does the optional the stage will be set to 39 and the main quest is still active as the next goal, if the player goes straight for the main quest and completes the stage his new stage will be set to 40 (and you can choose wether you include a setstage in stage 40 for stage 39 or not, so if the main goal is achieved the optional one is set as done as well) getstage only gets the highest completed stage, it doesn't care if you performed all steps or not, if the player completes stage 70 without completing 50, getstage will still return 70

 

to answer a couple of these questions:

 

1. short means pretty much the same integer would mean in other languages, your just declaring that awaitinginput (or anything else for that matter) is a naturalnumber (meaning it can be -2,-1,0,1,2 etc. but not 2.868735)

 

looked the actual values up, so here's the list (and the 3 types of variables)

 

short

-2,147,483,648 to 2,147,483,647

float

-3.402823×1038 to -1.175494×10−38, 0 and 1.175494×10−38 to 3.402823×1038 (precision of 7 digits)

ref

A pointer to a reference

 

so most of the time you will be using short, float mainly is needed for timer.

 

btw. if you still have trouble with compiling your script up there, you missed an endif (you got 3 open ifs and only 2 endifs)

 

if you don't declare what it is, the compiler for the script has no clue what you wanna do with it and more importantly what it is.

would be like going in a supermarket and saying i want 20 without sayin what ya want nobody in the store will help ya.

 

2. id.etc thats just how the language works (I have no idea what the language used is actually called, but let me tell ya it sucks)

basically you use a dot everywhere you wanna connect 2 things like "player.additem" etc.

 

and I'm not sure bout a full list, but check the geck wiki for functions that should at least have most of them with an syntax explanation and probably an example as well

Link to comment
Share on other sites

As spammster has said, "short" is part of a variable declaration. Variable declarations are explained in the links that I pointed you to in my previous post.

 

Basically, a variable declaration consists of two parts - the typename ("short" in this case) and the variable name ("AwaitingInput" in this case). The syntax for a variable declaration is fairly simple:

typename variable_name

Important things to note about variable declarations are:

  • They must take place outside of Begin/End blocks
  • Variables must be declared before they are used
  • Variable declarations are not case sensitive. If you declare a variable as "Awaitinginput" then you can still access it as "AwaitingInput", although it's best to keep your capitalisation consistent to enhance readability
  • Variable names cannot include whitespace
  • There are three types of variables available, and each has at least one keyword:
    • Integers
      • int
      • short
      • long

      [*]Floating point values

      • float

      [*]Reference variables (to store FormIDs)

      • ref
      • reference

    [*]In result scripts, only reference variables can be used

    [*]Variable names cannot be the same as existing EditorIDs

I've explained variables in my Scripting for Beginners tutorial.

 

 

Many functions, such as Unlock, are termed reference functions. What's special about these functions is that they must (or, in the case of some FOSE functions, may) be called on a reference. All this means is that they act on a specific object within the game world. For example, Unlock should be called on a locked reference - either a door or a non-actor container.

 

There are two sets of syntax for calling reference functions. I call the simplest syntax "Implicit reference syntax", because the calling reference is implied. When calling a reference function with implicit reference syntax, it's called just like any other function:

Unlock

When called this way, the function will be called on the reference that the script is running on. For an object script, that is the scripted reference, whereas for an effect script it is for the reference that the effect is being applied to. Result scripts can also use this syntax, although there are many types so the reference that they act on varies. Quest scripts don't run on a reference, so reference functions must be called explicitly in this case.

 

As I've just mentioned, I call the other method of calling reference functions "Explicit reference syntax", this time because the calling reference is explicitly specified. This syntax is the one that you've asked about - it first specifies the reference to call the function on, then specifies the function to call (followed by any function parameters). The reference and function are separated by a dot. For example, using a reference variable to store the location of the reference:

ref rLinkedRef
...
set rLinkedRef to GetLinkedRef;A reference function called implicitly
rLinkedRef.Unlock;A reference function called explicitly
...

Once again, I've detailed how to use reference functions in my Scripting for Beginners tutorial.

 

Cipscis

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...