Jump to content

LoneRaptor

Premium Member
  • Posts

    155
  • Joined

  • Last visited

Everything posted by LoneRaptor

  1. Like this: Scriptname DFLTOonTriggerEnter extends ObjectReference scene property myscene auto quest property myquest auto int property nextStage auto Event OnTriggerEnter(ObjectReference akTriggerRef) if akTriggerRef == Game.GetPlayer() && myquest .GetStage() == 10 ;changed myQuest to myquest myquest .SetStage(nextStage) ; changed myQuest to myquest debug.notification("you entered the trigger area") endif EndEvent try checking the quest stage in game after you get the debug message to confirm it is actually getting changed.
  2. there is another error in the script you wrote the myquest variable differently in the property declaration from the SetStage line (myQuest) These need to be the same. The second script you posted also doesn't check for stage 10 anymore (assuming this was done for testing).
  3. The script should work when it is on the trigger and all properties are filled correctly. if it still doesn't work check the settings on your trigger (in the primitive tab) activation layer: L_ActorZone do not check player activation.
  4. It still won't compile or the trigger doesn't show the message?
  5. That part of the script (the if statement) is correct, i meant the first line underneath the if statement Scriptname DFLTOonTriggerEnter extends ObjectReference scene property myscene auto quest property myquest auto int property nextStage auto Event OnTriggerEnter(ObjectReference akTriggerRef) if akTriggerRef == Game.GetPlayer() && myQuest.GetStage() == 10 myQuest.GetStage(nextStage) ;<---- this one debug.notification("you entered the trigger area") endif EndEvent I'm not sure what you are trying to do with that one, the line above it will make sure that anything inside the if statement will only occur if the quest is at stage 10
  6. That error is telling you that you have too many arguments for the GetStage function, this function doesn't have arguments. Are you trying to set a quest stage if so you should use myQuest.SetStage(nextStage) instead.
  7. The error is because you have to define the event you want to register for in the RegisterForTutorialEvent() This page has a list of all the valid tutorial events. Also the if statement needs to compare to a string write it like this: if asEventName == "PowerArmorWorkbenchEntered"
  8. Yes anything you add that needs to be enabled when the power is turned on can just be linked to the enable parent without having to edit the script
  9. Yes that will work but also setup the new object as the enable parent for the spark/smoke/sound effects. The script has only changed by adding 2 lines to enable/disable the marker so just adding those 2 lines would be enough (starting from Event the 4th and the 9th line where added).
  10. There is an EnableMarker in the statc category that you can use. Place one (these are invisible in game) and use that as the enable parent. Then in the script add a property: (ObjectReference Property EnableMaker Auto) fill it with the ref for the enableMarker and change the script to this: Event OnActivate(ObjectReference akActionRef) If ActivatorRef.IsDisabled();if the teleporter activator is disabled enable it ActivatorRef.Enable();disables the teleporter activator EnableMaker.Enable() EmitterRef.PlayGamebryoAnimation("stage3loop", True);starts animation stage3loop SoundEffectIncetanceID = OBJTeleporterJammerLP.Play(EmitterRef);starts the sound effects ElseIf !ActivatorRef.IsDisabled();if the teleporter activator is enabled disable it ActivatorRef.Disable();enables the teleporter activator EnableMaker.Disable() If SoundEffectIncetanceID ; checks if there is sound playing EmitterRef.PlayGamebryoAnimation("stage1", True); stops the animation Sound.StopInstance(SoundEffectIncetanceID) ;stops the audio loop ;SoundEffectIncetanceID = None ; clears the inctance property so the script knows there is no sound playing EndIf EndIf EndEvent
  11. For the sparks you can place some SplineSparks02 (a movableStatic) there might be others as well look around a bit in the CK, and set them to initially disable and link them to an enable parent and enable/disable that via the script on the power switch. there should also be some accompanying sound effects in the ck as well. I don't remember if the sound gets stopped when you disable it but i think it does so you should be able to add them to the same enable parent as the visual effects. There are also plenty of smoke effects (movable static category) in there as well, these can be enabled/disable the same way.
  12. I meant the one inside the if statement like this: Event OnActivate(ObjectReference akActionRef) If ActivatorRef.IsDisabled();if the teleporter activator is disabled enable it ActivatorRef.Enable();disables the teleporter activator EmitterRef.PlayGamebryoAnimation("stage3loop", True);starts animation stage3loop SoundEffectIncetanceID = OBJTeleporterJammerLP.Play(EmitterRef);starts the sound effects ElseIf !ActivatorRef.IsDisabled();if the teleporter activator is enabled disable it ActivatorRef.Disable();enables the teleporter activator If SoundEffectIncetanceID ; checks if there is sound playing EmitterRef.PlayGamebryoAnimation("stage1", True); stops the animation Sound.StopInstance(SoundEffectIncetanceID) ;stops the audio loop ;SoundEffectIncetanceID = None ; clears the inctance property so the script knows there is no sound playing EndIf EndIf EndEvent
  13. Turns out it was my mistake, you copied the script before i noticed and changed it. replace ActivatorRef.Disable() with ActivatorRef.Enable() and ActivatorRef.Enable() in the section below elseIf with ActivatorRef.Disable(). see post #33 for reference
  14. The script sould be on the power switch. Make sure you have all of the properties filled. ActivatorRef is the teleporter activator, EmitterRef is the objectReference of the static model of the emitter, OBJTeleporterJammerLP is the sound effect (can be auto filled)
  15. Just remove the const but the rest after that should be on the next line
  16. These errors are because the default script adds a const flag to the end of the scriptname (first line of the script) if you remove that it should work.
  17. The compilation error is because I made a mistake in the script i posted the line: SoundEffectIncetanceID = None won't work because you can't set an int property to none. If you remove that line it should work. with store power state i mean create a global variable that you can then reference somewhere else to check if the power is on or not (default value = 0 when powered set it to 1) you can do this with NamOfGlobal.SetValue(1) to change it to 1. You can read the value with NameOfGlobal.GetValueInt()
  18. There is no need to have those 2 emitters. Instead of enabling and disabling them you can create one emitter and activate/deactivate the effects on that. using the same activator: ObjectReference Property ActivatorRef Auto ;objectreference of the teleporter activator ObjectReference Property EmitterRef Auto ;objecreference of the emitter Sound Property OBJTeleporterJammerLP Auto;sound effects Int Property SoundEffectIncetanceID Auto Hidden ; no need to fill this the script will do that Event OnActivate(ObjectReference akActionRef) If ActivatorRef.IsDisabled();if the teleporter activator is disabled enable it ActivatorRef.Enable();enables the teleporter activator EmitterRef.PlayGamebryoAnimation("stage3loop", True);starts animation stage3loop SoundEffectIncetanceID = OBJTeleporterJammerLP.Play(EmitterRef);starts the sound effects ElseIf !ActivatorRef.IsDisabled();if the teleporter activator is enabled disable it ActivatorRef.Disable();disables the teleporter activator If SoundEffectIncetanceID ; checks if there is sound playing EmitterRef.PlayGamebryoAnimation("stage1", True); stops the animation Sound.StopInstance(SoundEffectIncetanceID) ;stops the audio loop EndIf EndIf EndEvent You could add in a global variable to store the power state if you need to know in another script or as a condition for certain effects. Edit: removed SoundEffectIncetanceID = None beacuse this won't work :facepalm:
  19. I'm not sure i follow why would you need 2 emittors? Adding my script to the power activator will work. How did you do the power switch, are you just enabling/disabling the teleport activator. if so you can make it a toggle by adding an if statement that check if it is enabled to the onActivate this can then enable the activator and the effects as well as disabling everything again.
  20. These effects don't require power. They are actually animations inside the nif for that model wich you can play using PlayGamebryoAnimation() you can do this by adding something like this to the activator: ObjectReference Property EmitterRef Auto ;fill this with the reference of the emittor EmitterRef.PlayGamebryoAnimation("stage3loop", True); place this inside the OnActivate event There are more than just this animation in the nif, you can find them using nifscope in the animation dropdown. then you can replace stage3loop with the name of the animation you would like This only plays the visual effects for sound effects you have to find the corresponding sound descriptor and play that at the same time as the animation using the following line: ;First add 2 more properties: Sound Property OBJTeleporterJammerLP Auto; you should be able to auto fill this Int Property SoundEffectIncetanceID Auto Hidden ; no need to fill this the script will do that, this will later be used to stop the sound effect SoundEffectIncetanceID = OBJTeleporterJammerLP.Play(EmitterRef);place this below the PlayGamebryoAnimation line Both the animation and the sound effect are looping so you'll have to stop them at some point. This can be done on a timer or using an activator when you want them to stop. To stop both use the following lines: Sound.StopInstance(SoundEffectIncetanceID) ;stops the audio loop EmitterRef.PlayGamebryoAnimation("stage1", True); stops the animation loop
  21. Default empty trigger should work without defaultActivateSelf script but you need to attach the seccond script i posted to it to test if it works you can add some debug lines which will tell you in game if it's working or not I ussually create my triggers a little dirfferently, slelect your teleporter model and click on the create trigger button . This will create a triggerbox around the mesh you selected (you might have to resize it a little afteward). It will ask you which trigger to add here you can select the defaultEmptyTrigger. For the trigger leave all settings as is (do not select player activation). After it's created add this script on the trigger: Scriptname LR_TriggerScript extends ObjectReference ObjectReference Property ActivatorRef Auto Event OnTriggerEnter(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() Debug.MessageBox("trigger enter") ;this will create a messagebox letting you know the trigger works remove or comment this out to disable the messageboxes ActivatorRef.BlockActivation(False) EndIf EndEvent Event OnTriggerLeave(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() ActivatorRef.BlockActivation(True, True) Debug.MessageBox("Trigger Leave") ;this will create a messagebox letting you know the trigger works remove or comment this out to disable the messageboxes EndIf EndEvent Fill the ActivatorRef property with your activator( not this trigger)
  22. You could make a trigger the size of the teleporter and in its primitive tab select player activation. this should do what you want. The only issue is that it can be activated from outside the teleporter. This can easily be fixed by creating a second trigger as an actual trigger and changing the code on the activator to this (leave the properties and scriptname as they are): Event OnInit() Self.BlockActivation(True, True) ;This disables the activator initialy EndEvent Event OnActivate(ObjectReference akActionRef) If !Self.IsActivationBlocked() ; this makes sure the player can't accidentally activate the activator even if they can't see it Game.GetPlayer().MoveTo(TeleportDestination) EndIf EndEvent And adding the following script to the trigger: ;scriptname part goes here (extends ObjectReference) ObjectReference Property ActivatorRef Auto ; fill this with the activator's reference Event OnTriggerEnter(ObjectReference akActionRef) If akActionRef == Game.GetPlayer(); this makes sure only the player can enable the activator ActivatorRef.BlockActivation(False) ; this enables activation again EndIf EndEvent Event OnTriggerLeave(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() ActivatorRef.BlockActivation(True, True) ; this disables the activator again after the player leaves it EndIf EndEvent You can add additional checks to these if you end up needing power or not
  23. The first script only has one property, the second one has 2. What object did you change it to? i think the power requirement is either a property on a script attached to each workshopobject(i think this is called workshopobjectscript but i'm not sure) or a keyword and the main settlement script (can't recall what that is called now). When you clicked save did the compiler give you an error? The lightning effects don't necessarily have to be controlled via script i just assumed they were if not that try to find the effect itself in the ck and look at the use info to see what uses them.
  24. To add a script in the CK click add, give it a name and uncheck the constant checkbox, click ok the documentation string is not needed. next the properties window will open. You can either click on add property and add the properties that way or click on cancel, right click on the script and select "edit source". A very basic text editor will open and in there you can paste the script i posted minus the scriptname line as that will already be generated. Click file save some information will appear in the compiler output. after that you can close this window and fill the properties using the property button next to the list of scripts if you named the property for the global variable the same as the editor id of the global then you can select it and click on auto fill and the ck will fill it for you. For objectReferences you will have to select it in the worldspace by clicking edit value and then pick reference in render window
×
×
  • Create New...