Jump to content

Klaxon Light Pack In


grimmsin

Recommended Posts

So I'm new to modding and I am currently trying to get 2 klaxons to work with a terminal and door. I'd like to have it so when the door is opened by the terminal the Klaxons go off but i have limited knowledge on scripting and could use a hand. I've looked for guides and youtube videos but have not had any luck finding the solution. Any help would be very appreciated.

 

 

 

Thanks,

Grimmsin

Link to comment
Share on other sites

I assume you know how to make a terminal and a sound descriptor.

The following script should do what you want:
First you need to make some properties.

These can be named whatever you want but if you change them they also need to change in the script.

- YourDoor is an ObjectReference and points to the door you want to open.
- KlaxonSound is a sound property and needs to be filled with the sound descriptor you made for the sound effects.
- Klaxon is an ObjecReference for the Klaxon objects in the game so the sound originates from them.

Paste this in the papyrus fragment field of the option that opens the door:

YourDoor.Unlock()   ; you only need to add this if the door is locked at first this ensures the player can open and close it afterwards
YourDoor.SetOpen(true)   ;Opens the door, if you want to close it again replace the true with false
KlaxonSound.Play(Klaxon)   ;This plays the sound coming from the klaxons
Link to comment
Share on other sites

I know how to make a Terminal but not a sound descriptor. also on the Klaxon it already has scripts on it not sure if i need to do anything with them or just leave as is. lastly do i need to connect my 2 klaxons with an Xmarker or is there some other method to do so? Or do i just leave them as is.

 

base objects im using are:

 

GenericKlaxon2DLPMMarker

KlaxonLightGlow

KlaxonLight01

Link to comment
Share on other sites

I had a look at the item you are referring to. And the script you mention is used to animate the lights. If you want that to work You'll probably have to add another line or two if you have 2 like this: Klaxon.Activate(Self)

And looking at the pack in it might even be easier then the script above. because there is already a sound marker in the pack in. I haven't used these before but it looks like enabling them might just work. Try the following:

Make a property for both GenericKlaxon2DLPMMarkers (I'll use SoundMarker1 and 2 in the script.
Make a property for each Klaxon (Klaxon1 and Klaxon2)

Klaxon1.Activate(Self)
Klaxon2.Activate(Self)
SoundMarker1.Enable()
SoundMarker2.Enable()


You might have to disable them again afterwards or they might keep going.
If this doesn't work use the script from before and add the Activate lines and the sound descriptor you are looking for is called AMBIntAlarmGeneric2DLPM.

Link to comment
Share on other sites

I'm forgetting to do something i know just not sure what >.<

 

ers\grimmsin\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalWallCOPY_0200A619.psc(9,0): variable Klaxon1 is undefined
C:\Users\grimmsin\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalWallCOPY_0200A619.psc(9,8): none is not a known user-defined script type
C:\Users\grimmsin\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalWallCOPY_0200A619.psc(10,0): variable Klaxon2 is undefined
C:\Users\grimmsin\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalWallCOPY_0200A619.psc(10,8): none is not a known user-defined script type
C:\Users\grimmsin\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalWallCOPY_0200A619.psc(11,0): variable SoundMarker1 is undefined
C:\Users\grimmsin\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalWallCOPY_0200A619.psc(11,13): none is not a known user-defined script type
C:\Users\grimmsin\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalWallCOPY_0200A619.psc(12,0): variable SoundMarker2 is undefined
C:\Users\grimmsin\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalWallCOPY_0200A619.psc(12,13): none is not a known user-defined script type
No output generated for Fragments:Terminals:TERM_DefaultTerminalWallCOPY_0200A619, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on Fragments:Terminals:TERM_DefaultTerminalWallCOPY_0200A619
Do i need to make some kind of scripts for the Klaxons and sounds?
Link to comment
Share on other sites

I'm forgetting to do something i know just not sure what >.<

ÃÂ

ers\grimmsin\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalWallCOPY_0200A619.psc(9,0): variable Klaxon1 is undefined

C:\Users\grimmsin\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalWallCOPY_0200A619.psc(9,8): none is not a known user-defined script type

C:\Users\grimmsin\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalWallCOPY_0200A619.psc(10,0): variable Klaxon2 is undefined

C:\Users\grimmsin\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalWallCOPY_0200A619.psc(10,8): none is not a known user-defined script type

C:\Users\grimmsin\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalWallCOPY_0200A619.psc(11,0): variable SoundMarker1 is undefined

C:\Users\grimmsin\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalWallCOPY_0200A619.psc(11,13): none is not a known user-defined script type

C:\Users\grimmsin\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalWallCOPY_0200A619.psc(12,0): variable SoundMarker2 is undefined

C:\Users\grimmsin\AppData\Local\Temp\PapyrusTemp\Fragments\Terminals\TERM_DefaultTerminalWallCOPY_0200A619.psc(12,13): none is not a known user-defined script type

No output generated for Fragments:Terminals:TERM_DefaultTerminalWallCOPY_0200A619, compilation failed.

ÃÂ

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

Failed on Fragments:Terminals:TERM_DefaultTerminalWallCOPY_0200A619

ÃÂ

ÃÂ

Do i need to make some kind of scripts for the Klaxons and sounds?

You should define variables and point them to base objects from properties.

 

Like, open properties of that script, add new property of type light and name it klaxon1 and point it to base light object you want to use. Do that for other variables too

Edited by shavkacagarikia
Link to comment
Share on other sites

Shavacagarikia is right you need to make properties. Use the button below the papyrus fragment labelled properties to add them. But because you already have an error you might have to click on the advanced tab and click edit script then remove the properties. They will be below the line ";end fragment code...." then save this and in the CK empty the papyrus field and type a single ";" in it (whitout quotes and click compile. Then Click ok and open the terminal again. This should clean up the errors.

Now make the propterties. Click the properties button and click add property a new window will open in there for type select ObjectReference and for the name Type Klaxon1 Then click OK and Edit value. Select the first claxon object in the render window.
Repeat this for the other properties.

Types are as follows:
Klaxon2: ObjectReference
KlaxonSound: Sound You only need this if you are using the .play() function (first one) this is filled by selecting AMBIntAlarmGeneric2DLPM in the dropdown list
SoundMarker1: ObjectReference
SoundMarker2: ObjectReference
YourDoor: ObjectReferece


After they are all added click ok on the properties window and Ok on the terminal. Then open the terminal again and Add the fragment.

YourDoor.Unlock()   ; you only need to add this if the door is locked at first this ensures the player can open and close it afterwards
YourDoor.SetOpen(true)   ;Opens the door, if you want to close it again replace the true with false
Klaxon1.Activate(Self)
Klaxon2.Activate(Self)
SoundMarker1.Enable()
SoundMarker2.Enable()
Link to comment
Share on other sites

  • Recently Browsing   0 members

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