Jump to content

Scripting...3 days and 2 bottles of Tylenol later...


Taffer42

Recommended Posts

My head hurts. I'm trying to do something I think should be fairly easy, and google is just not helping at all.

 

I'm trying to edit a script...I've added a few things in and they aren't working. Here's what's going on...I found a mod that removed your starting spells. I'm using it, but adding those starting spells in Helgen as spell tomes during your escape, so you can have them if you want them. I've added all 5 starting spell tomes (Healing, Flames, Fury, Sparks [actually already there], and Conjure Familiar). The last three I have starting as disabled, since not everyone starts with them.

 

What I'm trying to do is have the game detect your race, and if your race normally starts with one of these spells, set the appropriate spell tome to enabled.

 

Here's the code:

 

Book property _myTest_SpellTomeCF auto
Book property _myTest_SpellTomeFury auto
Book property _myTest_SpellTomeSparks auto
 
function appropriatelyNamedFunction()
    Race _myTest_PlayerRace = Game.GetPlayer().GetRace()
 
    if (_myTest_PlayerRace == "DarkElfRace" || _myTest_PlayerRace == "DarkElfRaceVampire")
        _myTest_SpellTomeSparks.Enable()
    elseif (_myTest_PlayerRace == "HighElfRace" || _myTest_PlayerRace == "HighElfRaceVampire")
        _myTest_SpellTomeFury.Enable()
    elseif (_myTest_PlayerRace == "BretonRace" || _myTest_PlayerRace == "BretonRaceVampire")
        _myTest_SpellTomeCF.Enable()
    endIf
endFunction

 

 

 

When I compile this, I get an error saying Enable is not a function or does not exist.

 

I'm sure this is something easy and when I'm told what silly mistake I'm making I'm going to feel very foolish. But for right now, the dent in the wall from where I'm banging my head is getting just a little too big. :sad:

Edited by Taffer42
Link to comment
Share on other sites

In case you aren't sure how to do the two things suggested above that are needed to get your script working, take a look at this modification of your posted code.

 

 

ObjectReference property _myTest_SpellTomeCF 		auto 	;point to placed instance
ObjectReference property _myTest_SpellTomeFury 		auto 	;point to placed instance
ObjectReferencd property _myTest_SpellTomeSparks 	auto 	;point to placed instance

Race Property DarkElfRace 		Auto
Race Property DarkElfRaceVampire	Auto
Race Property HighElfRace 		Auto
Race Property HighElfRaceVampire 	Auto
Race Property BretonRace 		Auto
Race Property BretonRaceVampire 	Auto
 
function appropriatelyNamedFunction()
    Race _myTest_PlayerRace = Game.GetPlayer().GetRace()
 
    if (_myTest_PlayerRace == "DarkElfRace" || _myTest_PlayerRace == "DarkElfRaceVampire")
        _myTest_SpellTomeSparks.Enable()
    elseif (_myTest_PlayerRace == "HighElfRace" || _myTest_PlayerRace == "HighElfRaceVampire")
        _myTest_SpellTomeFury.Enable()
    elseif (_myTest_PlayerRace == "BretonRace" || _myTest_PlayerRace == "BretonRaceVampire")
        _myTest_SpellTomeCF.Enable()
    endIf
endFunction

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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