Tommy
Hausbruder
Die von Killfetzer vorgeschlagene Variante mit Kreatur/NPC, kannst du dir hier anschauen: Grosser Sack by ReneMiner
begin kf_sk_door_journalblock_script
if ( OnActivate == 1 )
if ( GetJournalIndex, "kf_testthema" >= 10 )
if ( GetJournalIndex, "kf_testthema" < 20 )
Journal, "kf_testthema", 20
endif
Activate
endif
endif
end
Dein Script funktioniert, setzt aber dank des ersten GetJournalIndex >= 10 eine aktive Quest bzw. einen vorherigen Journaleintrag voraus ohne den die Tür nicht funktioniert. Also müsste man das Öffnen der Tür durch Setzen eines passenden Journaleintrags erlauben. Sofern das gewollt ist, gut. Geht es aber darum, beim ersten Öffnen einen Journaleintrag zu erhalten, zum Beispiel, weil das Öffnen der Tür die Quest starten soll, wäre eine gekürzte Version geeigneter:So wird das leider nicht funktionieren. Probier es mal so:
begin kf_sk_door_journalblock_script
if ( OnActivate == 1 )
if ( GetJournalIndex, "kf_testthema" < 10 )
Journal, "kf_testthema", 10
endif
Activate
endif
end
begin ID_Detonator_SCR
DontSaveObject
Short FrameCounter
IF ( GetDisabled == 0 )
IF ( FrameCounter < 5 )
set FrameCounter to ( FrameCounter + 1 )
ELSE
ExplodeSpell "ID_EXPLOSION_SPL"
Disable
EndIF
EndIF
end
begin NPCID_SCR
IF ( GetDisabled == 0 )
IF ( GetHealth <= 0 )
PlaceAtMe "ID_Detonator", 1, 0, 0
Disable
EndIF
EndIF
end
begin _vdm_door_xyz_script
short done
short doonce
if (done == 1)
return
endif
if ( OnActivate == 1 )
if ( player->GetItemCount, "_vdm_key_xyz" < 1 )
MessageBox "no key!" "Ok"
if(GetJournalIndex "_vdm_hf_init" == 3)
if(doonce == 0)
set "_vdm_xy_status" to ("_vdm_xy_status" + 1)
set doonce to 1
MessageBox "xyz"
endif
endif
else
set done to 1
Activate
endif
endif
if ( OnActivate == 1 )
if (GetJournalIndex "_vdm_xyz_init" == 4)
if ( player->GetItemCount, "ingred_dreugh_wax_01" < 1 )
MessageBox "imprint wax?", "Yes", "No"
set doonce to 2
endif
endif
endif
if ( doonce == 2 )
set button to GetButtonPressed
if ( button == -1 )
return
elseif ( button == 0 )
if ( player->getitemcount "ingred_dreugh_wax_01" < 1 )
messagebox "no wax"
set doonce to 3
else
messagebox "key imprint wax"
player->removeitem, "ingred_dreugh_wax_01", 1
player->additem, "_vdm_xy_imprint", 1
set doonce to 4
endif
elseif ( button == 1 )
set doonce to 3
endif
endif
End
begin _vdm_door_xyz_script
short MessageOn
short Button
IF ( MenuMode )
return
EndIF
IF ( MessageOn != 1 )
IF ( OnActivate == 1 )
IF ( MessageOn > -1 )
IF ( player->GetItemCount, "_vdm_key_xyz" < 1 )
MessageBox "no key!" "Ok"
IF (GetJournalIndex "_vdm_hf_init" == 3)
set "_vdm_xy_status" to ("_vdm_xy_status" + 1)
Journal "_vdm_hf_init", 4
;hier besser auch einen Journaleintrag setzen, ersetzt das lokale DoOnce
;falls "4" schon belegt ist, alle Einträge verschieben und "4" neu einfügen!
ElseIF (GetJournalIndex "_vdm_xyz_init" == 4)
IF ( player->GetItemCount, "ingred_dreugh_wax_01" >= 1 )
MessageBox "imprint wax?", "Yes", "No"
set MessageOn to 1
EndIF
EndIF
return
ELSE
set MessageOn to -1
EndIF
EndIF
Activate
EndIF
ELSE
set Button to GetButtonPressed
IF ( button >= 0 )
IF ( Button == 0 )
IF ( player->getitemcount "ingred_dreugh_wax_01" < 1 )
messagebox "no wax"
ELSE
IF ( player->getitemcount "_vdm_xy_imprint" > 0 )
messagebox "Already got Imprint"
ELSE
player->removeitem, "ingred_dreugh_wax_01", 1
player->additem, "_vdm_xy_imprint", 1
messagebox "key imprint wax"
EndIF
EndIF
EndIF
set MessageOn to 0
EndIF
EndIF
end
begin _vdm_dwrv_doors_01
float timer
short start
if ( MenuMode == 1 )
return
;don't run time in Menu Mode. Very bad.
endif
if ( OnActivate == 1)
if ( "_vdm_dwemer_status" == 0 )
Playsound "Dwemer Door Open"
MessageBox "no power!"
endif
endif
if ( OnActivate == 1)
if ( "_vdm_dwemer_status" == 1 )
if ( start == 0 )
set start to 1
Playsound "Dwemer Door Open"
endif
endif
endif
if ( start == 0 )
return
;if we have't started, stop here for speed
endif
if ( timer < 9 )
if ( timer > 1 )
if ( start == 1 )
PlaySound "Door Stone Open"
Set start to 2
endif
endif
Rotate X 20
;above line rotates the crank itself
"_vdm_dwrv_door_00"->Rotate Z -10
"_vdm_dwrv_door_01"->Rotate Z 10
;above two lines open the doors.
;you may need to adjust the times or the rotate value.
;right now they open over 9 seconds to about 100 degrees.
endif
if ( timer > 14 )
if ( start == 2 )
PlaySound "Door Stone Open"
Set start to 3
endif
"_vdm_dwrv_door_00"->Rotate Z 10
"_vdm_dwrv_door_01"->Rotate Z -10
;these lines close the doors 14 seconds after you activate
;or 5 seconds after the doors are fully open
endif
if ( timer > 23 )
set start to 0
set timer to 0
"_vdm_dwrv_door_00"->SetAngle Z 205.3
"_vdm_dwrv_door_01"->SetAngle Z 295.3
;after 9 more seconds, the doors are back to their original position
;reset timer and start
endif
set timer to ( timer + GetSecondsPassed )
;above line increments the timer... should be last here outside if
;statements
;otherwise bad things can happen
end
IF ( OnActivate == 1)
IF ( start == 0 )
IF ( "_vdm_dwemer_status" == 0 )
Playsound "Dwemer Door Open"
MessageBox "no power!"
Else
set start to 1
EndIF
EndIF
EndIF