Jump to content

How to create a script to store variables


Recommended Posts

Right, so I'm advancing at a slugs pace towards the exciting prospect of having variables set through dialogue, but for that I need a script, and a place to store them. Problem is, I have no idea how to set one up.

 

So say I have a quest (scriptless for the time being) and in that quest there is a dialogue option that says "OK, I'll do that." - I want to then advance the dialogue a little with other characters, so that if say "if WorkingAsWhore = 1" then ... do you get the gist?

 

So with that in mind, how would I set up a simple script to store a number of variables, which can be changed through dialogue?

 

Any help would be greatly appreciated. Thanks!

Link to comment
int' date=' short, and long are all actually the same thing.[/quote']

In NV scripting they are anyway, they are different elsewhere, so I just use ref, short & float myself :)

If you want to be blown away have a look at the VAR quest scripts in SCR for storing actor variables :)

Link to comment

I keep getting the following problem:

 

"Form's ID is not unique!

Previous form is type Script."

 

It won't save my script when I enter:

 

scn MyScript

 

short OhNoSheDidnt

 

I'll save' date=' and it will just disappear. Am I supposed to save "script type" as object, quest or effect?

[/quote']

 

If it´s a quest script it´s quest.

Link to comment

That error means there's already an existing file with that name, and it happens to be a script. Call it something you'll actually remember and can use filters to locate. For example, SexoutAgentT01Q2VentScript (don't actually use that one).

Link to comment

Thanks Bruce' date=' for some reason the script still won't save. Am I supposed to do something else besides "save" and "exit"?

 

The minute I do that the script vanishes...

[/quote']

 

Close all quest windows, save and reopen your quest. Click the ... and your script should be there somewhere. One of the mistakes I made earlier, was giving my script the same name as my quest. Maybe that´s your problem too. Try naming it MyQuestscript for your quest MyQuest.

If you´re going to do scripts, even if it´s only for storing variables i highly recommend geckpu. Most of the time it gives you a message for what´s missing.

 

edit:argh, too slow...:D

Link to comment

I'm fairly sure I'm using geckpu, the one that uses nvse_loader as a shortcut?

 

Also, I've changed the names of the script and the quest and I get the same error - I don't understand, there is no way there is another quest/script in the game with the same name as mine.

 

Changed the script bit to quest, and still the same error.

Link to comment

OK, to be absolutely sure, I'm in the quest list, and searching for the name of the quest I want to implement comes up with zero results, so I'm assuming it doesn't exist and therefore shouldn't conflict, right?

 

EDIT: Just created a totally different quest and script name, totally random, and have the same problem... I don't know what I could possibly be doing wrong. Maybe I'll do a step by step screenfest and maybe anyone can figure out where I am erring?

Link to comment

I thought all scripts were stored in quests? This is what I've done:

 

Under Actor Data > Quests I've opened up the list and right at the bottom where it's blank I've right clicked "New Quest".

 

There I've ticked "Start Game Enabled" and "Script Processing Delay". For the Quest Name, I've put "Slave Jail Sex Variable Storage" and for Quest ID I've put "SlaveJailTSexVar".

 

Right of where it says script, I've clicked the ... button, and there I clicked the tab "Script" and "New". This allows me to edit the big white space. I then write in "sct SlaveJailTSexVar" followed by a space, and then "short isrubbleprostitute", next line, then "short isslaveprostitute". Finally, in "Script Type" I select Script from the drop down menu.

 

I then open the "Script" tab, save, then exit. The script appears not to save. Then, if I try and exit the quest by pressing "exit" on the bottom right corner, I get the "Form Editor ID Error: Form's ID is not unique! Previous form type is Script."

 

?

Link to comment

I thought all scripts were stored in quests? This is what I've done:

 

Under Actor Data > Quests I've opened up the list and right at the bottom where it's blank I've right clicked "New Quest".

 

There I've ticked "Start Game Enabled" and "Script Processing Delay". For the Quest Name' date=' I've put "Slave Jail Sex Variable Storage" and for Quest ID I've put "SlaveJailTSexVar".

 

Right of where it says script, I've clicked the ... button, and there I clicked the tab "Script" and "New". This allows me to edit the big white space. I then write in "sct SlaveJailTSexVar" followed by a space, and then "short isrubbleprostitute", next line, then "short isslaveprostitute". Finally, in "Script Type" I select Script from the drop down menu.

 

I then open the "Script" tab, save, then exit. The script appears not to save. Then, if I try and exit the quest by pressing "exit" on the bottom right corner, I get the "Form Editor ID Error: Form's ID is not unique! Previous form type is Script."

 

?

[/quote']

 

 

It should look like this:

 

 

edit: my steps:

 

new - quest

filling in quest id and name ->OK

reopen quest

clicking ...

new

script stuff

script type ->quest

save script

close

select script from dropdown menu

 

edit2: Maybe you don´t have an active plugin selected? If not you can´t save.

Link to comment

Ah, okay, I get it. See, I thought the script had to use the same name as the quest in order for it to work.

 

When you guys said they both couldn't have the same name, I thought you meant the Quest name and the ID.

 

Urgh, two pages of LL's bandwith wasted on this noobness.

 

Thanks guys, you've been a real help!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use