Talk:Cross Script Variables

From the Oblivion ConstructionSet Wiki
Revision as of 19:06, 23 December 2010 by imported>QQuix
Jump to navigation Jump to search

I'm not sure this page is particularly warranted; the problems with the search engine are multitudinous, but we can't have a separate page for every one.

If this is to be a tutorial of some kind for a particular method of accessing script variables, then it should be written up like one.

If it is intended only as a way to find the GetScriptVariable page, a better answer would be to create it as a Redirect, which I can help with if desired.

But if the creator could please explain the purpose of this page, that would help. As is, it's not really up to Wiki standards.
Dragoon Wraith TALK 19:34, 18 December 2010 (EST)

I think if you review it now you'll see it is improved from its original form and serves a purpose.
--Bruneauinfo 23:04, 22 December 2010 (EST)
I think, actually there already is a page like this. See this: Linked List Tutorial
--Diarrhoe 09:27, 23 December 2010 (EST)
My page is A - Complete, B - Works perfectly as written, and C - a whole lot easier to read and understand than the referenced article. I'm not creating a linked list with this functionality. I'm demonstrating the simple, BASIC functionality that allows storage of variable values in a central location that all other scripts can write to and read from. It's more of a Scripting 101 topic than an advanced database topic. It allows two separate scripts to communicate with each other on a basic level - a feature not apparent in the design of Oblivion (although this does give me an idea now...).
Granted the title of the article may not be appropriate. And perhaps there is an even easier way to do what I'm proposing here that IS a native Oblivion/OBSE function. Perhaps: Cross-Script Data Storage or something similar would be a better title. Still, the name of the article should reflect something a typical modder is going to be searching for when they type in the search bar. Otherwise no one will ever find it.
From what I've learned here on the Wiki I've taken three concepts mentioned in more than three different articles and tied them together in one article that demonstrates how to get this functionality to work. I studied the wiki for more than a few days trying to get this functionality to work. From my work I've concluded the syntax presented in various articles on this wiki relating to this topic where incorrect. I have added notes in articles where appropriate. --Bruneauinfo 12:05, 23 December 2010 (EST)
I'm about to head out, so I can't read the article right now, but as long as it's actually an article and not "GetScriptVariable was hard to find, so this page helps find it!", that's fine.
As for the Linked List Tutorial... yeah, no. That tutorial is old (as in, written within months of Oblivion's release), and it never worked as intended because of the unreliability of PlaceAtMe. At this point, it's mostly a testament to the really cool work that Tegid and MrFlippy did with Oblivion script early in Oblivion's life.
Dragoon Wraith TALK 13:26, 23 December 2010 (EST)
It is no longer a discussion, and only vaguely makes mention of its original content as an aside to why it is currently named as it is. It's actually a very simple concept - but I think it's very useful and needed to be drawn up. I would very much like to see input from someone who has tried it out. --Bruneauinfo 13:51, 23 December 2010 (EST)
I did like the article.
I've been using this concept for ages. I usually have hundreds or thousands of vars stored in my 'Global' quest.
There are a few things you could correct/adjust/clarify:
  • There is no need for the gamemode statement in the quest script. Just the variables work fine. (although this is a nice place to put initialization code wrapped in a GetGameLoaded condition)
  • You CAN create variables dynamically using OBSE arrays.
  • You must not only declare a variable in the quest script, but also compile the quest script before using the var in other scripts
  • I was about to write that "MyQuest".refVar does not work, but, surprisingly, it does. Anyway, there is no need for the quotation marks. MyQuest.refVar seems cleaner and simpler. Please review your tests and remove your comments saying the quotation marks are required.
  • The same is true for "ObjectReference"
  • Object scripts work fine for this purpose, too.
  • All kinds of vars are supported. OBSE included.
  • You may also want to mention that if you reorder the vars in the quest script, all scripts that use any of those vars must be recompiled.
And I suggest you remove the Discussion tag from the article.
QQuix 16:42, 23 December 2010 (EST)
On your comment about the use of quotations, believe me I tried many, many combinations trying to get this to work. I picked up the feature from the GetScriptVariable and GetQuestVariable pages. Many, many attempts later I figured out the only way to get it to work was to use the quotes. Yes, it surprised me too, but it was the only way I could get it to work. In fact I was right into the point of giving up completely and throwing up my hands on this when I figured out using quotation marks made it work. It was with great relief when I got it working. Granted since you use this feature all the time I can't help but imagine you're not saying this lightly. I would like to figure out what could have caused the problem for me. Perhaps it has something to do with compiling my scripts as I was trying to find the right combinations to get it to work -- and the feature just so happens to work with or without quotes. Perhaps quotes are just ignored. --Bruneauinfo 17:37, 23 December 2010 (EST)
On another look - I believe the reason quotes may be required is because I began the name of my Quest with numbers (in my testing at least). Same goes for my object reference. Interesting if it's true. If it is true then quotes are only required if references begin with a number. --Bruneauinfo 17:38, 23 December 2010 (EST)
That might be it. Probably this is one of the reasons there is a general best practices recommendation of never starting EditorIDs with numbers. The CS does not like it. Sooner or later you will get into trouble.QQuix 19:06, 23 December 2010 (EST)