meesbaker Posted May 25, 2011 Share Posted May 25, 2011 Hello guys, I have posted a question here a while ago and got quick help so I guess it is the fastest and best way to get more advice to simply repeat that process:D On the question:As you all know it is possible in Oblivion CS to access local variables from any script. Like I have the weapon called "Masamune" and that weapon has a script attached to it including the local variable "power". Now I can access that variable from anywhere using Masamune.power Unfortunately I had to notice that this works different for magic effect scripts. I have a spell called "Fire" and that spell has two magic effects. Oneis simply a Fire Damage and the other one is a Script Effect counting up, how often the Spell has been succesfully casted on someone. The Script looks like this: Scn FireScript short counterBegin ScriptEffectStart set counter to counter +1End Now I need to check the value of "counter" in other scripts. I tried if Fire.counter== .....but that does not work. Probably because the script is not directly attached to the spellbut to one of the Magic Effects that Spell has. I do not know how to access the local variable in that weird script:D If you know advice please let me know thanks in advance guys:) Greetings, mees Link to comment Share on other sites More sharing options...
HeyYou Posted May 25, 2011 Share Posted May 25, 2011 You can only access local variables in Quest scripts, by using QuestName.variablename...... Link to comment Share on other sites More sharing options...
meesbaker Posted May 25, 2011 Author Share Posted May 25, 2011 You can only access local variables in Quest scripts, by using QuestName.variablename...... Truly? I tried the same for objects and the compiler didnt complain like "unknown variable or function"....I hope this wont come up with a mistake once the script runs in game because I used accessing variablesfrom object scripts like clothing or weapons quite often in my new mod and the CS never complained..... :/ Link to comment Share on other sites More sharing options...
HeyYou Posted May 25, 2011 Share Posted May 25, 2011 I would test that particular theory before basing too much on it..... the CS doesn't catch a fair few errors...... Link to comment Share on other sites More sharing options...
meesbaker Posted May 25, 2011 Author Share Posted May 25, 2011 I would test that particular theory before basing too much on it..... the CS doesn't catch a fair few errors...... Indeed the game does crash! Thats incredible! I made a script adding 1 to a short variable in an object script and when parsing the line ingamethe game just crashed.... Alright, the whole thing was actually meant for a materia system like in Final Fantasy 7. I introduced spells that level up when used often so I made a counterand played around with it from within other scripts...Now I followed your advice and took out the object scripts to work with a quest script and everything works fine, its just a little more work. Inside my Spell Script it does now say:Begin ScriptEffectStart if getisplayablerace==1 set spellquest.spellcounter to spellquest.spellcounter+1 endifEnd Like if the Spell hits a man the game notices and adds 1 to a counting variable. Like that I can access and check the value from everywhere and my materia spells finallywork. It will just be more typing and cliking around that way until all spells are integrated but it seems the only way possible in the end.... Thanks a looaaad for your advice it helped me out and now things work. :) Greetings, mees Link to comment Share on other sites More sharing options...
HeyYou Posted May 25, 2011 Share Posted May 25, 2011 Cool. :D Glad to be of service. Link to comment Share on other sites More sharing options...
Recommended Posts