Xerperious Posted February 3, 2018 Share Posted February 3, 2018 Hey can someone tell me why my script isn't compiling? Scriptname TwinAxesScript extends ObjectReference {Summons left Twinaxe} Actor property PlayerRef auto Spell Property SpellToCast auto Event OnInit() RegisterForActorAction(0) EndEvent Event OnActorAction(int actionType, Actor akActor, Form source, int slot) If akActor == PlayerRef If !source If ActionType == 6 If !slot SpellToCast.Cast(Self, Self) Endif Endif Endif Endif EndEvent This is the error it keeps giving"Starting 1 compile threads for 1 files...Compiling "TwinAxesScript"...C:\Program Files (x86)\Steam\steamapps\common\Skyrim\Data\Scripts\Source\temp\TwinAxesScript.psc(7,4): RegisterForActorAction is not a function or does not existNo output generated for TwinAxesScript, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on TwinAxesScript"Not sure what I am doing wrong if someone could help that would be good.It is supposed to be a script attached to a weapon, and once that weapon is drawn it should cast a summon weapon spell and summon into the left hand. As in a "paired weapons" script. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 3, 2018 Share Posted February 3, 2018 You need the SKSE source scripts (PSC files) installed to the folder where you have the game's source scripts located. If they are not present, then the compiler will not find any SKSE functions/events. Link to comment Share on other sites More sharing options...
Xerperious Posted February 3, 2018 Author Share Posted February 3, 2018 (edited) You need the SKSE source scripts (PSC files) installed to the folder where you have the game's source scripts located. If they are not present, then the compiler will not find any SKSE functions/events.Thank you, now it compiles. I thought I had them in there. Edited February 3, 2018 by Xerperious Link to comment Share on other sites More sharing options...
Xerperious Posted February 3, 2018 Author Share Posted February 3, 2018 The script still doesn't work the way I want it to in game though, it doesn't do anything on draw. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 3, 2018 Share Posted February 3, 2018 The ActionType that you check against in the OnActorAction event needs to be the ActionType registered with RegisterForActorAction. Currently, you register for 0 and check for 6. With that setup, it will fail. Link to comment Share on other sites More sharing options...
Xerperious Posted February 3, 2018 Author Share Posted February 3, 2018 The ActionType that you check against in the OnActorAction event needs to be the ActionType registered with RegisterForActorAction. Currently, you register for 0 and check for 6. With that setup, it will fail.Still doesn't work with 6 7 or 8. Scriptname TwinAxesScript extends ObjectReference {Summons left Twinaxe} Actor property PlayerRef auto Spell Property SpellToCast auto Event OnInit() RegisterForActorAction(7) EndEvent Event OnActorAction(int actionType, Actor akActor, Form source, int slot) If akActor == PlayerRef If !source If ActionType == 7 If !slot SpellToCast.Cast(Self, Self) Endif Endif Endif Endif EndEvent Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 4, 2018 Share Posted February 4, 2018 Why do you have the If !source and If !slot lines? I don't understand your purpose with them. It could be that those lines are blocking the rest of your script. Could also be that you have it attached to a weapon. The weapon is most likely within the player's inventory. There are some things which will not run on objects while they are in a container (actor inventory is considered a container by the game). You might want to consider moving this from the weapon to a script on a player alias on a quest that runs for the duration that you want the player to have this ability. You could then compare the 'source' variable in OnActorAction against the desired weapon. That would allow it to process when only the correct weapon is used rather than any weapon. I know for a fact that it works as I used OnActorAction with ActionType 7 & 9 in my Followers as Companions mod. Link to comment Share on other sites More sharing options...
Xerperious Posted February 4, 2018 Author Share Posted February 4, 2018 Why do you have the If !source and If !slot lines? I don't understand your purpose with them. It could be that those lines are blocking the rest of your script. Could also be that you have it attached to a weapon. The weapon is most likely within the player's inventory. There are some things which will not run on objects while they are in a container (actor inventory is considered a container by the game). You might want to consider moving this from the weapon to a script on a player alias on a quest that runs for the duration that you want the player to have this ability. You could then compare the 'source' variable in OnActorAction against the desired weapon. That would allow it to process when only the correct weapon is used rather than any weapon. I know for a fact that it works as I used OnActorAction with ActionType 7 & 9 in my Followers as Companions mod. Nothing has worked yet, I tried doing a quest and that didn't work either. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 5, 2018 Share Posted February 5, 2018 Are you testing on a new game or a save that has not seen your mod at all? Sometimes script changes won't be recognized mid-game. Link to comment Share on other sites More sharing options...
Xerperious Posted February 7, 2018 Author Share Posted February 7, 2018 Are you testing on a new game or a save that has not seen your mod at all? Sometimes script changes won't be recognized mid-game.It is on a save that hasn't had the mod played on it yet. I have to spawn in the items each time and equip it. Link to comment Share on other sites More sharing options...
Recommended Posts