Jump to content

NV script and global variables


Guest

Recommended Posts

Posted

Hello,

 

I'm doing some experiments in the GECK and I'm having an issue with a script. Roaming around I found another person having the same problem on another website, but no answers to that.

Since I just started, I'm sure I did some big mistake I can't see on my own...

 

So this is what's happening.

There's a broken elevator with an attached script.

This script checks the player's repair, if it's higher than a certain value it will repair it and goes to the floor selection. If not, nothing can be done.

It's like the Vault 22 script.

Now I have 3 elevators in the same cell, they all are copies and have the same script.

So, declaring locally a ISMYELEVATORBROKEN variable, makes it working but the other 2 elevators will prompt again the same "do you want to repair it?". So I supposed that variable had to be global.

 

I found around that it isn't done with the global variables under gameplay, but attaching a script with the declaration to a quest.

 

So this is what I did, following what I've read:

 

I did a empty quest (let's call it SETVARIABLES, priority 55, start game enabled, scipt processing delay default, nothing else) and I attached a second script on it.

This second script is Quest type and it has just the (scn name) and then the declaration of my IS MY ELEVATOR BROKEN variable, a int variable (I tried with short too).

I call this variable inside the elevator script with something like "if SETVARIABLES.ISMYELEVATORBROKEN == 1"

 

Ok this doesn't work, that single line calling the variable, it doesn't make the script be compiled. I've read and read again the documentation and other things around but I didn't find where is my mistake. Since it's similar to Vault 22 elevator, I looked at it, but to my eyes the two elevators seem the same.

 

If someone has a clue for me, I'll be very happy. Just think that in the description above I wrote everything, I mean I didn't miss even the obvious parts. So if you think "oh it misses this, but surely it was omitted describing the issue", well maybe that could be the real problem.

 

Thank you

Posted

Can't say much other than check your spelling, and make sure you're referring to the questID.variable and not the questscriptID.variable

Post the entire script if you're sure that's not the issue.

 

Posted

Sure, thank you.

 

http://www.mediafire.com/view/?1zwngmmfg06a1q8

 

What you see there is what I really have put in the various fields, what I was wondering is if I have to check something else in some other tabs.

Now if I only change that ElevatorRepaired (that is local, declared on top), even in only one if, with that 00PinkyAptSet.00PinkyElevatorRepaired (that should be the global one), it doesn't compile.

Posted

Hm. Well, it's never a good idea to start editorIDs with numbers. It can trip the geck up sometimes, sometimes not. You have both your questID & the quest variable starting with 00. Try and pick something else as a prefix. While you're at it, do it for everything you have starting with 00.

Posted

I can't believe it... That was the issue!

Changing 00 with aa in the IDs allowed me to compile! These are the kinds of things where I really notice when someone is very experienced.

The worst part is that 00 trick was something I've learnt in many tutorials around the net. They all said "put that 00 so you can find your things on top". This means potentially many will have similar issues. Anyways, thank you very much, can't show how much I'm grateful

Posted

Also check out the Scripting Help thread in my link, that issue is mentioned in the first post, and you'll save yourself a lot of keyboard meets head :)

Posted

The worst part is that 00 trick was something I've learnt in many tutorials around the net. They all said "put that 00 so you can find your things on top".

Whoever wrote that is an idiot. Not only will that break the GECK, the GECK has a filter bar.
Posted

Well, I made this stupid error, as I began modding, too. ( http://www.loverslab.com/topic/14014-basic-sexout-modding-geck-scripting-questions-and-maybe-answers/)

I think, one problem is, that a lot of modders/mods use the number "1" with success. (I am not on my modding-computer, but AFAIK obsidian itsself uses the "leading 1" for some items and quests.)

So you think you are smart and use the ZERO, to be the very first. Items, npcs etc. with a leading ZERO seem to work well with quests, topics. But no variables/no references in a script.

 

I never would have figured out what I made wrong, too.

 

But at last, you learn, that you just have to decide, what you want to use as "This-belongs-to-my-mod-sign", use it constantly and use the filter bar, as zippy mentioned.

Posted

I had the feeling that many video tutorial were made by people not knowing very much what they were explaining, this could be the reason. But I started 3 days ago with these things, so I was finding videos easier for me.

Thanks to  everyone for the answers, and also thank you Halstrom to point me there. I've put that thread in my favourites, it surely will be very useful

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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