scn SEObeliskNewSCRIPT
float timer
short respawn ; 0 = ready to respawn
; 1 = running timer before respawning
; 2 = respawning (can't activate me)
; 3 = finishing animation (can't activate me)
short heartCount ; counts the number of hearts the player has added to the obelisk
short button
short active ; set to 1 when the obelisk becomes active (responds to player, spawns, etc.)
short deactivated ; set to 1 when player deactivates
float temp
ref mySelf ; me, used for activation
ref myActivator ; who is activating me?
ref myParent ; energy box (linked through parents to the spawn marker)
ref mySpawn ; used to modify spawned knights
short respawnCount ; increment when one of my spawned knights dies (replaces global variable)
ref tempRef ; used for various temp purposes
; GLOBALS USED:
; SEObeliskMaxHearts -- how many hearts needed to deactivate obelisk?
; SEKnightRespawnDelay -- how long between respawning knights?
begin OnLoad
set myParent to GetParentRef
set mySelf to GetSelf
; activate parent to set up variables down the line
if myParent != 0
myParent.activate mySelf 1
endif
; destroy myself by default (so don't look like an activator)
if active == 0
setdestroyed 1
else
setdestroyed 0
if deactivated == 0
; I'm active -- play active animation
playgroup fastforward 1
endif
endif
end
begin OnActivate
set myActivator to GetActionRef
if isActionRef player == 1
if heartCount >= SEObeliskMaxHearts
; obelisk is already deactivated
message "Der Obelisk wurde deaktiviert."
; tell parent that player wants to open the container
if myParent != 0
myParent.activate SEObeliskOpenChest 1
endif
else
if player.getitemcount SEKnightHeart > 0
if respawn < 2
messageBox "Wollt Ihr ein Herz der Ordnung in den Obelisken legen?", "Ja", "Nein"
else
message "Der Obelisk reagiert nicht."
endif
else
message "Ihr besitzt keine Herzen der Ordnung, die Ihr in den Obelisken legen könntet."
endif
endif
else
if myActivator.GetInFaction SEOrderPriestFaction == 1
; priest is activating me
if deactivated == 1
; message "TEMP: Obelisk script -- priest activating me"
myActivator.removeitem SEOrderPriestWidget 10
myActivator.modav aggression 100 ; set aggression back to normal
myActivator.evp
; I've been deactivated, so activate me
set heartCount to 0
set deactivated to 0
clearownership
; play my active animation
playgroup forward 1
; tell linked objects to turn on
if myParent != 0
myParent.activate SEObeliskTurnOn 1
endif
; spawn a new knight
if respawnCount == 0
set respawnCount to 1
endif
; SPECIAL CASES:
; SE13 -- player bodyguard gives an audible warning
if getinworldspace SENSPalace == 1
set tempRef to SE13.bodyguardRef
if tempRef.getdead == 0
if myActivator.GetInFaction SEOrderPriestFactionA == 1
tempRef.sayto player SE13ObeliskAShout
elseif myActivator.GetInFaction SEOrderPriestFactionB == 1
tempRef.sayto player SE13ObeliskBShout
elseif myActivator.GetInFaction SEOrderPriestFactionC == 1
tempRef.sayto player SE13ObeliskCShout
endif
endif
endif
endif
elseif myActivator.GetInFaction SEOrderKnightRespawnFaction == 1
; knight is activating me to let me know he died
set respawnCount to respawnCount + 1
elseif myActivator.GetIsReference SEObeliskTurnOn == 1
; I'm being activated by script
set active to 1
set deactivated to 0
clearownership
; if I have no respawn count set, use default
if respawnCount == 0
set respawnCount to SEKnightRespawn
endif
; tell linked objects to turn on
if myParent != 0
; play my active animation -- put in here so it won't happen if not loaded
playgroup forward 1
myParent.activate SEObeliskTurnOn 1
endif
endif
endif
end
begin gameMode
If Active == 1 && GetDestroyed == 1 ; safety net for destroyed status
SetDestroyed 0
ElseIf Active == 0 && GetDestroyed == 0
SetDestroyed 1
EndIf
; if active == 0 || getstagedone SE13 200 == 1
; if getstagedone SE13 200 == 1
; return
; endif
set button to getbuttonpressed
if button == 0
set heartCount to heartCount + 1
if heartCount == 1
message "Ihr legt ein Herz der Ordnung in den Obelisken."
; tell linked objects
if myParent != 0
myParent.activate SEObeliskHeart1 1
endif
elseif heartCount == 2
message "Ihr legt ein zweites Herz der Ordnung in den Obelisken."
; tell linked objects
if myParent != 0
myParent.activate SEObeliskHeart2 1
endif
elseif heartCount == 3
message "Ihr legt ein drittes Herz der Ordnung in den Obelisken."
; tell linked objects
if myParent != 0
myParent.activate SEObeliskHeart3 1
endif
elseif heartCount == 4
message "Ihr legt ein viertes Herz der Ordnung in den Obelisken."
endif
if heartCount >= SEObeliskMaxHearts
; message "[TEMP: The obelisk is now deactivated. This will eventually be obvious from the animation.]"
endif
player.removeitem SEKnightHeart 1
; spawn a new knight
if respawnCount > 0 && respawn != 1
; grab one from the respawn queue if not already in process of respawning
set respawnCount to respawnCount - 1
endif
; in any case, no delay -- spawn next knight immediately
set respawn to 1
set timer to 0
; if I've put in the right number of hearts, shut the obelisk down
if heartCount >= SEObeliskMaxHearts
set deactivated to 1
; use ownership to trigger priest package (Giant Kluge)
setownership SEOrderPriestFaction
; tell obelisk to deactivate when done idling
set deactivated to 2
; clear respawning count as a reward
set respawnCount to 0
if getstage SE13 > 5
; triggers next phase of SE13
if getIsReference SE13Obelisk1Ref == 1
setstage SE13 23 ; obelisk1 shut down
elseif getIsReference SE13Obelisk2Ref == 1
setstage SE13 24 ; obelisk2 shut down
endif
endif
endif
endif
; check global variable to see if time to respawn a knight
if respawnCount > 0 && timer <= 0 && respawn == 0 && deactivated == 0
set respawnCount to respawnCount - 1
set respawn to 1
set timer to SEKnightRespawnDelay
endif
; finished waiting to respawn? If so, pop out a new knight
if timer <= 0 && respawn == 1
set respawn to 2
; tell my parent that it's time to spawn
myParent.activate SEObeliskSpawn 1
; put "spawning" shader on obelisk
pms SEOrderShader
; run timer (obelisk can't be activating during spawn)
set timer to SEKnightSpawnTime
endif
if timer <= 2 && respawn == 2
; spawn new Knight
; special cases:
set respawn to 3 ; still animating, so can't activate till done
endif
if timer <= 0 && respawn == 3
; done spawning
sms SEOrderShader
set respawn to 0
endif
if timer > 0
set timer to timer - getSecondsPassed
endif
if isAnimPlaying == 0
if deactivated == 0 && active == 1
; play idle when active
playgroup fastforward 1
elseif deactivated == 2
playgroup backward 1
set deactivated to 1
; tell linked objects
if myParent != 0
myParent.activate SEObeliskTurnOff 1
endif
endif
endif
end
ScriptName SE08XedQuestScript
;;
;; Var Declarations
;;
;; Throwing some of these in for later use - detailed comments pending
short EventFlag01
short EventFlag02 ; used in xpXeddefen01 to prevent re-triggering wave #1 of knights.
short EventFlag03 ; used in xpXeddefen02 to prevent re-triggering wave #1 of knights.
;; Vars for the blessings
short c1PriestStatus ; used to track blessing priest in xpXeddefen01
short DoBlessOnce ; These flags prevent priest from attempting multiple blessings per wave of knights.
short DoBless2Once ; doOnce flag for an event
short DoBless3Once ; doOnce flag for an event
;; Brazier light puzzle vars
short brazierBool ; flag this to track state of the brazier
; obsolete, puzzle sucked and was cut.
;; Shelden Bark Control vars
short SheldenCutoff
;;Important - This Var tracks if Erik's ready for the destruction show
short SE08CollapseFlag ; obsolete
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Vars for Ambience Loop ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
float timer ;;;;
float timerMin ;;;;
float timerMax ;;;;
;;;;
short DoAmbSetupOnce ;;;;
;;;;
float RumbleStrength ;;;;
short RumbMin ;;;;
short RumbMax ;;;;
;;;;
short RandSFX ;;;;
short SFXmin ;;;;
short SFXmax ;;;;
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Xiditte Variables (hijacking this script to avoid an extra quest script)
short XidPuzFlow1
short XidPuzFlow2
short XidPuzFlow3
short XidPuzFlow4
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
BEGIN gameMode
if getStageDone SE08 70 == 1
set SE08CollapseFlag to 1 ; obsolete but leaving in for sake of safety
SE08c3AFTERmarker.enable ; swap out relevant Geometry & stuff in XPXeddefen03
SE08c3BEFOREmarker.disable ; watch out to make sure this works with save/load states
endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;The Ambience Loop;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This set of blocks exists to periodically play visual and audio FX ;;
;; while the player is in the collapsing ruins of Xeddefen during SE08 ;;
;; randomization is used extensively to prevent player fatigue/repetition ;;
if getStage SE08 >= 70 && getStage SE08 <= 80
if player.getInCell XPXeddefen03 || player.getInCell XPXeddefen04 || player.getInCell XPXeddefen05 ; play only when player in these cells
if DoAmbSetupOnce == 0 ; this is an init block - do only 1x - TWEAK THESE CONTROL VARS - DON'T MESS WITH FORMULAE BELOW!!!!
set RumbMin to 1 ; set up range for rumble intensity
set RumbMax to 5
set SFXmin to 1 ; set up sound effects table
set SFXmax to 3
set timerMin to 3 ; set up range for periodic rumble & sfx
set timerMax to 12
set DoAmbSetupOnce to 1
endif
if timer <= 0
set RumbleStrength to (RumbMin + (GetRandomPercent * (RumbMax - RumbMin)) / 99) ; randomize strength of rumble to avoid repetition
[COLOR=Red]triggerHitShader RumbleStrength[/COLOR] ; play screen rumble w/result
set RandSFX to (SFXmin + (GetRandomPercent * (SFXmax - SFXmin)) / 99) ; simple randmoizer to choose ambient SFX to accompany our rumble
if RandSFX == 1
player.playSound AMBStoneShift01
elseif RandSFX == 2
player.playSound AMBStoneShift02
elseif RandSFX == 3
player.playSound AMBSToneShift03
endif
set timer to (timerMin + (getRandomPercent * (timerMax - timerMin)) / 99) ; randomize interval between ambient rumbles
endif
if timer > 0 ; vanilla timer control
set timer to (timer - getSecondsPassed)
endif
endif
endif
END
In Anbetracht der Erwähnung des Questes SE08 solltest du dir diesen vielleicht auch noch einmal anschauen, vielleicht befinden sich dort ein paar Script Befehle, die damit zusammenhängen. Ich denke du wirst es an einen Quest binden, von daher könnte das nur nützlich sein.The Ambience Loop
This set of blocks exists to periodically play visual and audio FX while the player is in the collapsing ruins of Xeddefen during SE08 randomization is used extensively to prevent player fatigue/repetition
if getStage SE08 >= 70 && getStage SE08 <= 80
if player.getInCell XPXeddefen03 || player.getInCell XPXeddefen04 || player.getInCell XPXeddefen05 ; nur wenn der Spieler in den genannten Zellen ist, die Zellen kannst du also durch deine ersetzen
if DoAmbSetupOnce == 0 ; aha wenn es also noch nicht durchgeführt wurde. TWEAK THESE CONTROL VARS - DON'T MESS WITH FORMULAE BELOW!!!!
set RumbMin to 1 ; Mindests eine "Erdbeben" Stärke von 1
set RumbMax to 5 ; Maximal eine Erdbeben stärke von 5
set SFXmin to 1 ; anscheinend für die Geräusche zuständig
set SFXmax to 3
set timerMin to 3 ; Offenbar für regelmäßge Geräusche und Beben zuständig
set timerMax to 12
set DoAmbSetupOnce to 1 ;Es wurde einmal ausgeführt und kann/sollte nach der obrigen Bestimmung nicht wiederholt werden, außer wir ändern den obrigen Wert
endif
if timer <= 0
set RumbleStrength to (RumbMin + (GetRandomPercent * (RumbMax - RumbMin)) / 99) ; Sorgt für die zufälligen Erschütterungen, mit einer Berechnung
triggerHitShader RumbleStrength ; Sorgt für den Effekt
set RandSFX to (SFXmin + (GetRandomPercent * (SFXmax - SFXmin)) / 99) ; simple randmoizer to choose ambient SFX to accompany our rumble
if RandSFX == 1
player.playSound AMBStoneShift01
elseif RandSFX == 2
player.playSound AMBStoneShift02
elseif RandSFX == 3
player.playSound AMBSToneShift03
endif
set timer to (timerMin + (getRandomPercent * (timerMax - timerMin)) / 99) ; randomize interval between ambient rumbles
endif
if timer > 0 ; vanilla timer control
set timer to (timer - getSecondsPassed)
endif
endif
endif
END
scn FNEarthShaking01
if getStage FNHQ01 >= 25
if player.getInCell FNContdoor
if DoAmbSetupOnce == 0
set RumbMin to 1
set RumbMax to 5
set SFXmin to 1
set SFXmax to 3
set timerMin to 3
set timerMax to 12
set DoAmbSetupOnce to 1
endif
if timer <= 0
set RumbleStrength to (RumbMin + (GetRandomPercent * (RumbMax - RumbMin)) / 99)
triggerHitShader RumbleStrength
set RandSFX to (SFXmin + (GetRandomPercent * (SFXmax - SFXmin)) / 99)
if RandSFX == 1
player.playSound AMBStoneShift01
elseif RandSFX == 2
player.playSound AMBStoneShift02
elseif RandSFX == 3
player.playSound AMBSToneShift03
endif
; randomize interval between ambient rumbles
endif
if timer > 0
set timer to (timer - getSecondsPassed)
endif
endif
endif
End
---------------------------
Warning
---------------------------
Script 'FNEarthShaking01', line 3:
All script commands must be inside a begin/end block.
Weiterspielen?
"Yes to all" will disable all Warnings this session.
---------------------------
Ja Nein Abbrechen
---------------------------
Doch ein Fehler tritt auf;
Müsste das nicht BeginOnStages sein?Code:--------------------------- Warning --------------------------- Script 'FNEarthShaking01', line 3: [COLOR="Red"]All script commands must be inside a begin/end block.[/COLOR] Weiterspielen? "Yes to all" will disable all Warnings this session. --------------------------- Ja Nein Abbrechen ---------------------------
Und ich kanns von mir aus in die Scriptsammlung eintragen
scn name
short doonce
Begin onTrigger player
if doonce == 0
set doonce to 1
TriggerHitShader <Wert>
endif
end
1. Im ResultScript der Queststage :roll: