Jump to content

Scripting Help


ben446

Recommended Posts

im not very good with scripts. I can read most scripts and understand what each part is saying to do. I'm currently working on a house mod and decided I want to add some running water in the form of a shower or two plus sinks in the toilets. So I started to do some research and found out how to do it through some really helpful tutorials. After that I set about finding a script that would work to turn the taps on and off, in one of the tutorials it was mentioned that the script on the CK home page for a light switch would also work for the taps and showers. Id also seen some other tutorial where they author had used a script for a light switch and a tap. So I tried using the script from the ck wiki. This is were a found issues, the script wouldn't compile, I read the errors at the bottom but couldn't work out what the errors were referring to. Ive spent about 2 hours trying to find a working script or even a way to fix the issues within the script. to no joy. Id really appreciate it if someone who has had the same issue could tell me how they fixed it or if someone could offer another solution to my problem. Thank you in advance, hopefully this thread will also serve to help anyone else in the same situation I'm in

Link to comment
Share on other sites

ok thanks

 

ScriptName manualLightSwitch ectends ObjectRefference

 

ObjectReference Property EnableMarker auto

 

Event OnInit()

 

If (Enabled.IsDisabled())

GoToState ("LightsOff")

Else

GoToState ("LightsOn")

EndIf

 

EndEvent

 

State LightsOff

 

Event OnBeginState()

EnableMarker.Disable()

End Event

 

Event OnActivate (ObjectReference akActionRef)

GoToState ("LightsOn")

EndEvent

 

EndState

 

 

State LightsOn

Event OnBeginState()

EnableMarker.Enable()

EndEvent

 

Event OnActivate(ObjectReference akActionRef)

GoToState("LightsOff")

EndEvent

EndState

 

Lol That took a while to do been trying to copy and paste but couldn't do it.

Ok so Now for the Errors

 

This is word for word what is said

 

Starting 1 compile threads for 1 files...

Compiling "manuallightswitch"...

F:\SteamLibrary\SteamApps\Common|skyrim Special Edition\Script\temp\manualLightswitch.psc(2.0):missingEOF at scriptname

 

No output generated for Manuellightswitch, Compilation failed

 

Batch compile of 1 files finished. 0 succeeded, 1 failed,

Failed on Manuellightswitch.

 

Ok so that's the script and the failed message.

 

 

 

 

I know the script works (normally) I found out about the script when someone else used it and directed people to use it during a tutorial they did. While I was looking for another script I found a thread on TES Alliance where the person who wrote the script had rewritten the same script there. I copied and pasted it directly from the wiki, only changing the name, I also copied and pasted the script from the thread I just mentioned again only changing the name. when it wouldn't work like that I tried copying and pasting the script from both sources without changing the name. If anyone can help id be grateful.

 

to Reneer, sorry for taking so long to post this up after you asked for it, I had people pop round then when I checked the thread I tried to copy and paste it straight to here then when I couldn't I had to hand type it which again was fun.

Edited by ben446
Link to comment
Share on other sites


ScriptName manualLightSwitch ectends ObjectRefference ;I know you said you had to rewrite it from scratch but did you spell "extends" correctly and does the script name EXACTLY match the file name? Manuellightswitch vs manualLightSwitch

ObjectReference Property EnableMarker auto ;Did you remember to put "auto" in your actual script? Sometimes I get a similar error if i forget the "auto"

Event OnInit()
If (Enabled.IsDisabled()) ;Again I know this is not a true copy paste of your actual script so this complicates the diagnosing but did you mean to write EnableMarker here vs "Enabled"?
GoToState ("LightsOff")
Else
GoToState ("LightsOn")
EndIf

EndEvent

State LightsOff

Event OnBeginState()
EnableMarker.Disable()
End Event ; You have "End Event" vs EndEvent

Event OnActivate (ObjectReference akActionRef)
GoToState ("LightsOn")
EndEvent

EndState


State LightsOn
Event OnBeginState()
EnableMarker.Enable()
EndEvent

Event OnActivate(ObjectReference akActionRef)
GoToState("LightsOff")
EndEvent
EndState
Link to comment
Share on other sites

shatsnazzle thank you for your help. As I say I can read a script but I for the life of me, I cant write one. Ive tried many times and it never comes right. I have been able to fix a broke script in the past, but I couldn't fix this one.

 

 

the "extends" was a miss spell when I wrote the script out here. and the auto was written in the script. I wrote "auto" with a lower case "a" as that's how it was on the script source. It was something I weren't sure if it was supposed to be lower case or upper case. ive just checked the script in notepad and the section

 

Event OnInit

If(Enabled.isDisabled())

is how it was written In the script in the copy and paste file of the script I have in notepad. I had copied the script to notepad and saved it there, so if I needed to it was in a separate file with scripts I have that work incase I have a mess up with ck and have to rewrite it. then copied it from there to the ck. I also used the notepad file as a source to copy from notepad into the ck manually. As I say I do really appreciate your help. Scripting is the one area that I'm lacking in. I'm not saying my other modding skills are the best, but scripting is the weakest area, ive used modding tutorials to help learn to read scripts, ive tried learning to write them, which I'm still working on, its why I don't like to come out asking for scripting help, but after hours of trying to find the reason why the script wouldn't compile I had to reach out for help.

Edited by ben446
Link to comment
Share on other sites

The CK wiki page where the original script came from: https://www.creationkit.com/index.php?title=Light_Switch

Note that what the OP re-typed is located at the bottom of the page.

 

Also the post referring to the same script at TES Alliance: http://tesalliance.org/forums/index.php?/topic/7896-3-state-light-switch-script-please/&do=findComment&comment=119697

 

Perhaps seeing both sources will help with any resolution.

Knowing that the OP had to re-type rather than copy / paste, it is difficult to point out where the issue(s) may be. I would suggest performing a fresh copy / paste and trying again. There is nothing wrong with the original source scripts that would cause issue with the compiler.

Link to comment
Share on other sites

shatnazzle yeah that's the very first thing I checked. its the one thing id messed up before. Isharameradin ill try copying and pasting again into the ck. I wont lie. I had to try and copy and pasting twice as the first time I couldn't get the paste button to show up under edit in the ck. Its the same issue I had here when I tried to paste a copy of the script here.

Link to comment
Share on other sites

shatnazzle yeah that's the very first thing I checked. its the one thing id messed up before. Isharameradin ill try copying and pasting again into the ck. I wont lie. I had to try and copy and pasting twice as the first time I couldn't get the paste button to show up under edit in the ck. Its the same issue I had here when I tried to paste a copy of the script here.

 

 

ben446 I'm bout to change your life!

Ctrl C to copy things

Ctrl V to paste!

Link to comment
Share on other sites

i tried that in the ck too. lol it wouldn't work had to try 3 or 4 time just to get it to let me post the script in the ck

 

Edit just tried to CRTL + V to paste the exact script here. it wouldn't work

Edited by ben446
Link to comment
Share on other sites

  • Recently Browsing   0 members

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