scn Toolsscriptboat
short stage
short button
short Target
short Target2
short Target3
begin OnActivate
if stage == 0 ;Abfrage
messagebox "Wollt ihr dieses Boot für 700 Gold kaufen???", "Ja", "Nein"
set stage to 1
elseif Stage == 2 && player.getitemcount oar01 >= 1 ;Activation
set stage to 3
elseif stage == 2 && player.getitemcount oar01 < 1
message "Ihr braucht ein Ruder"
endif
end
begin Gamemode
if Stage == 1; Antwort und Kauf
set button to getbuttonpressed
if button == 0
if player.getitemcount Gold001 >= 700
player.removeitem Gold001 700
Message "Sucht euch ein Ruder und rudert los"
set stage to 2
elseif player.getitemcount Gold001 < 700
message "Ihr habt nicht genug Gold"
set stage to 0
endif
elseif button == 1
set stage to 0
endif
endif
if stage == 3;Target
messagebox "Wo wollt ihr hin" "Hafenviertel" "Nordkanal" "Südostkanal" "Gefängniskanal/Vilverin" "Fanacasecul" "Culotte" "Schlosshof" "Nentala/Cadlewpriorei" "Abbrechen" "Mehr"
set stage to 4
endif
if stage == 4
set Target to getbuttonpressed
if target == 0
[COLOR=Red]Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat[/COLOR]
player.Movetomarker ToolsboatWaterfrontplayer
[COLOR=Red]set stage to 2[/COLOR]
elseif target == 1
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target == 2
Tollsonlyboat.Movetomarker ToolsboatVilverinboat
player.Movetomarker Toolsboatvilverinplayer
set stage to 2
elseif target == 3
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target == 4
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target == 5
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target == 6
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target == 7
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target == 8
set stage to 2
elseif Target == 9
set stage to 5
endif
endif
if stage == 5
messagebox "Mehr" "Pells Tor/Alte Brücke" "Weye" "Staadte" "Erpelgrund" "Bravil" "Leyawiin" "Kaiserbrücke" "Gipfelbrücke" "Abbrechen" "Mehr"
set stage to 6
endif
if stage == 6
set target2 to getbuttonpressed
if target2 == 0
Tollsonlyboat.Movetomarker Toolsboatpellsboat
player.Movetomarker Toolsboatpellsplayer
set stage to 2
elseif target2 == 1
Tollsonlyboat.Movetomarker ToolsboatWeyeboat
player.Movetomarker ToolsboatWeyeplayer
set stage to 2
elseif target2== 2
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target2 == 3
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target2 == 4
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target2 == 5
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target2 == 6
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target2 == 7
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target2 == 8
set stage to 2
elseif Target2 == 9
set stage to 7
endif
endif
if stage == 7
messagebox "Mehr" "Fettrückenhöhle" "Quellhöhle" "Schienbeinhöhle" "Veyondshöhle" "Gezeitenhöhle" "Schilfstandhöhle" "Pantehermaul" "Festung Grief" "Festung Ironie" "Abbrechen"
set stage to 8
endif
if stage == 8
set Target3 to getbuttonpressed
if target3 == 0
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target3 == 1
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target3 == 2
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target3 == 3
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target3 == 4
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target3 == 5
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target3 == 6
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target3 == 7
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif target3 == 8
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
player.Movetomarker ToolsboatWaterfrontplayer
set stage to 2
elseif Target3 == 9
set stage to 2
endif
endif
end
scn Toolsscrollscript
ref Scroll
short done
short button
begin OnEquip
Toolsscrollcontainer1.removeallitems
if done == 0
messagebox "Wollt ihr eine Rolle Kopieren?","Ja","Nein"
set done to 1
endif
end
begin Gamemode
if done == 1
set button to getbuttonpressed
if button == 0
if player.getitemcount Inkwell01 >= 1 && player.getitemcount BlankSheet >= 1
set done to 2
else
set done to 0
message "Ihr braucht Tinte und Pergament"
endif
elseif button == 1
set done to 0
endif
endif
if done == 2
Toolsscrollcontainer1.activate player
message "Deponiert NUR die zu Kopierende Rolle" 10
set scroll to Toolsscrollcontainer1.getinventoryobject 0
if scroll != 0
SET DONE TO 3
endif
endif
if done == 3
if scroll.getbookisscroll == 1 && Scroll != 0
Toolsscrollcontainer1.additem Scroll 1
player.removeitem Inkwell01 1
player.removeitem Blanksheet 1
Toolsscrollcontainer1.activate player
Message "Entnehmt eure Kopie"
set done to 0
elseif Scroll.getbookisscroll == 0 && Scroll != 0
message "Ihr habt keine Rolle deponiert. Entnehmt allen Inhalt"
set done to 0
Toolsscrollcontainer1.activate player
elseif scroll == 0
message "BUUUUUUUUUUGGGGG"
endif
endif
Ich brauche ein script für ein objekt damit es bei ekiner Aktivierung das Alchemie-menü öffnet!
schon mal danke für antworten!
scn ...
begin OnActivate player
[Ref-ID der normalen Verion].activate player
end
Was getbookisscroll angeht, schlag die Syntax doch einfach hier nach: http://cs.elderscrolls.com/constwiki/index.php/List_of_Functions
Tollsonlyboat.Movetomarker ToolsboatWaterfrontboat
Streich das rotmarkierte, dann sollte es hinhauen. Wenn in einem Skript der Spieler teleportiert wurde, werden dannach auszuführende Befehle nicht mehr verarbeitet. Bei der Verwendung von Moveto musst du die Funktionen und Befehle VOR .moveto setzen.
Gruß.
Vielleicht hilft Dir das weiter? Ich habe ein ähnliches Problem gehabt, das aber durch zwei Persistent References gelöst, von denen jeweils eine disabled wird. Wirkt im Spiel genauso aus wie moveto.This function works as expected for Actors. For most other object types, like containers and activators, the object's coordinates are updated but its world art is not. Additional scripting may be necessary to ensure the object moves properly: myObject.disable
myObject.moveTo [location]
myObject.enable
set xp to myObject.getPos x
myObject.setPos x xp
scn SotANFollowerScript
short button
short boxchoice
short boxclass
short act
short boxtest
begin OnActivate player
if (act == 0)
set boxclass to 1
set boxchoice to 0
set button to -1
set act to 1
endif
end
begin GameMode
if (boxclass == 4)
Message "boxclass 4"
set boxclass to 0
if (boxchoice == 1)
if (button == 0)
SetActorValue Energy 75
elseif (button == 1)
SetActorValue Energy 0
elseif (button == 2)
SetActorValue Aggression 100
elseif (button == 3)
SetAlert 1
elseif (button == 4)
movetomarker SotANFollowStartMarker
endif
elseif (boxchoice == 2)
if (button == 0)
Message "Gehen"
elseif (button == 1)
Message "Rennen"
elseif (button == 2)
Message "Schleichen"
endif
elseif (boxchoice == 3)
if (button == 0)
Message "Klinge"
elseif (button == 1)
Message "Bogen"
elseif (button == 2)
Message "Magie"
endif
endif
set boxchoice to 0
set button to -1
set act to 0
elseif (boxclass == 3)
Message "boxclass 3"
set boxclass to 4
if (boxchoice == 1)
MessageBox "Was verlangt ihr von eurem treuen Gehilfen?", "Folgt mir" "Bleibt hier" "Vergießt Blut" "Seid vorsichtig" "Geht mir aus den Augen" "Beenden"
elseif (boxchoice == 2)
MessageBox "Wie soll ich mich verhalten?", "Gehen" "Rennen" "Schleichen" "Beenden"
elseif (boxchoice == 3)
MessageBox "Womit soll ich an eurer Seite kämpfen?", "Klinge" "Bogen" "Magie" "Beenden"
endif
set boxtest to 2
elseif (boxclass == 2)
Message "boxclass 2"
set boxclass to 3
if (button == 0)
set boxchoice to 1
elseif (button == 1)
set boxchoice to 2
elseif (button == 2)
set boxchoice to 3
elseif (button == 3)
set boxclass to 0
endif
set button to -1
elseif (boxclass == 1)
Message "boxclass 1"
set boxclass to 2
MessageBox "Was wollt ihr befehlen?", "Bewegung" "Verhalten" "Kampfstil" "Beenden"
set boxtest to 1
endif
end
begin GameMode
if (boxtest == 1)
set button to GetButtonPressed
set boxtest to 0
Message "Abfrage 1"
elseif (boxtest == 2)
set button to GetButtonPressed
set boxtest to 0
Message "Abfrage 2"
endif
end
Heißt das, dass "button" gleich wieder auf -1 gesetzt wird, sobald es einmal auf den richtigen Wert gesetzt wird? Sollte eigentlich durch die Abfrage im 2. GameModeBlock verhindert werden, aber nach wie vor zeigt sich nur die erste MessageBox, danach Stille.The first time this is called after a MessageBox button has been pressed, it returns the button number (0 indicates the first button, 1 the second, etc.). At all other times it returns -1.
Außerdem habe ich festgestellt, dass in der boxclass 2 die Abfragen alle negativ sind, also "button" nicht richtig gesetzt wird. Also warscheinlich ein Fehler bei GetButtonPressed. Daher habe ich es auch in einen eingenen GameModeBlock gesetzt.
elseif (boxclass == 2)
Message "boxclass 2"
set boxclass to 3
if (button == 0)
set boxchoice to 1
elseif (button == 1)
set boxchoice to 2
elseif (button == 2)
set boxchoice to 3
elseif (button == 3)
set boxclass to 0
endif
[COLOR="Red"]set button to -1[/COLOR]
scn SotANFollowerScript
short button1
short button2
short choice
short act
begin OnActivate player
if (act == 0)
set button1 to -1
MessageBox "Was wollt ihr befehlen?", "Bewegung" "Verhalten" "Kampfstil" "Beenden"
set act to 1
endif
end
begin GameMode
set button1 to GetButtonPressed
if (act == 1)
if (button1 == 0)
set act to 2
set choice to 1
MessageBox "Was verlangt ihr von eurem treuen Gehilfen?", "Folgt mir" "Bleibt hier" "Vergießt Blut" "Seid vorsichtig" "Geht mir aus den Augen" "Beenden"
elseif (button1 == 1)
set act to 2
set choice to 2
MessageBox "Wie soll ich mich verhalten?", "Gehen" "Rennen" "Schleichen" "Beenden"
elseif (button1 == 2)
set act to 2
set choice to 3
MessageBox "Womit soll ich an eurer Seite kämpfen?", "Klinge" "Bogen" "Magie" "Beenden"
elseif (button1 == 3)
Message "Menu verlassen"
set act to 0
endif
endif
end
begin GameMode
if (act == 2)
if (choice == 1)
if (button1 == 0)
SetActorValue Energy 75
elseif (button1 == 1)
SetActorValue Energy 0
elseif (button1 == 2)
SetActorValue Aggression 100
elseif (button1 == 3)
SetAlert 1
elseif (button2 == 4)
movetomarker SotANFollowStartMarker
endif
set act to 0
set choice to 0
elseif (choice == 2)
if (button1 == 0)
Message "Gehen"
elseif (button1 == 1)
Message "Rennen"
elseif (button1 == 2)
Message "Schleichen"
endif
set act to 0
set choice to 0
elseif (choice == 3)
if (button1 == 0)
Message "Klinge"
elseif (button1 == 1)
Message "Bogen"
elseif (button1 == 2)
Message "Magie"
endif
set act to 0
set choice to 0
endif
endif
end
GetButtonPressed funktioniert nur 1x !!!2. GetButtonPressed will only return the correct button press the first time it's called in a script; any other use of GetButtonPressed will return -1. For instance, if the player presses the first button, then in the following script
if (GetButtonPressed == -1)
...
elseif (GetButtonPressed == 0)
GetButtonPressed will return 0 the first time, move on to the 'elseif' test, and return –1 the second time.
To take care of this, set a variable to GetButtonPressed, and test the variable instead, as such:
short Choice
...
set Choice to GetButtonPressed
if (Choice == -1)
...
elseif (Choice == 0)
Likewise, GetButtonPressed will return -1 for all following frames (until the script runs another messagebox).
Ich doof sein. :roll: Ich habe einfach nicht nachgedacht. Movetomarker war mir völlig unbekannt und ist mir noch nie über den Weg gelaufen. Hab's mal nachgeschlagen und siehe da, es gibt bei der ganzen Moveto Sache ein paar mögliche Haken.
Über Moveto aus dem cs wiki:
Vielleicht hilft Dir das weiter? Ich habe ein ähnliches Problem gehabt, das aber durch zwei Persistent References gelöst, von denen jeweils eine disabled wird. Wirkt im Spiel genauso aus wie moveto.
Quelle: http://cs.elderscrolls.com/constwiki/index.php/MoveTo
edit:
Ich glaube, ich weiß den Fehler:
2. GetButtonPressed will only return the correct button press the first time it's called in a script; any other use of GetButtonPressed will return -1. For instance, if the player presses the first button, then in the following script
if (GetButtonPressed == -1)
...
elseif (GetButtonPressed == 0)
GetButtonPressed will return 0 the first time, move on to the 'elseif' test, and return –1 the second time.
To take care of this, set a variable to GetButtonPressed, and test the variable instead, as such:
short Choice
...
set Choice to GetButtonPressed
if (Choice == -1)
...
elseif (Choice == 0)
Likewise, GetButtonPressed will return -1 for all following frames (until the script runs another messagebox).
GetButtonPressed funktioniert nur 1x !!!
Wie kann ich das umgehen?
scn SotANFollowerScript
short button1
short button2
short choice
short act
begin OnActivate player
if (act == 0)
set button1 to -1
MessageBox "Was wollt ihr befehlen?", "Bewegung" "Verhalten" "Kampfstil" "Beenden"
set act to 1
endif
end
begin GameMode
set button1 to GetButtonPressed
if (act == 1)
if (button1 == 0)
set act to 2
set choice to 1
MessageBox "Was verlangt ihr von eurem treuen Gehilfen?", "Folgt mir" "Bleibt hier" "Vergießt Blut" "Seid vorsichtig" "Geht mir aus den Augen" "Beenden"
elseif (button1 == 1)
set act to 2
set choice to 2
MessageBox "Wie soll ich mich verhalten?", "Gehen" "Rennen" "Schleichen" "Beenden"
elseif (button1 == 2)
set act to 2
set choice to 3
MessageBox "Womit soll ich an eurer Seite kämpfen?", "Klinge" "Bogen" "Magie" "Beenden"
elseif (button1 == 3)
Message "Menu verlassen"
set act to 0
endif
endif
end
begin GameMode
if (act == 2)
if (choice == 1)
if (button1 == -1)
return
elseif (button1 == 0)
SetActorValue Energy 75
elseif (button1 == 1)
SetActorValue Energy 0
elseif (button1 == 2)
SetActorValue Aggression 100
elseif (button1 == 3)
SetAlert 1
elseif (button2 == 4)
movetomarker SotANFollowStartMarker
endif
set act to 0
set choice to 0
elseif (choice == 2)
if (button1 == -1)
return
elseif (button1 == 0)
Message "Gehen"
elseif (button1 == 1)
Message "Rennen"
elseif (button1 == 2)
Message "Schleichen"
endif
set act to 0
set choice to 0
elseif (choice == 3)
if (button1 == -1)
return
elseif (button1 == 0)
Message "Klinge"
elseif (button1 == 1)
Message "Bogen"
elseif (button1 == 2)
Message "Magie"
endif
set act to 0
set choice to 0
endif
endif
end
scn FNNocteTrapFloor
short triggered
float timer
Begin onTrigger player
if triggered == 0
set timer to 4
set triggered to 1
endif
End
Begin GameMode
if triggered == 0
return
endif
if timer >= 0 && triggered == 1
set timer to timer - getSecondsPassed
endif
if timer <=3
DisablePlayerControls
endif
if timer <= 0
FNNocteTrapFloor01.playgroup forward 1
FNOpenTrapFloorAnimation01.playgroup equip 1
endif
End
scn FNNocteTrapFloor
short triggered
float timer
Begin onTrigger player
if triggered == 0
set timer to 4
set triggered to 1
endif
End
Begin GameMode
if triggered == 0
return
endif
if timer >= 0 && triggered == 1
set timer to timer - getSecondsPassed
endif
if timer <=3
DisablePlayerControls
endif
if timer <= 0
FNNocteTrapFloor01.playgroup forward 1
FNOpenTrapFloorAnimation01.playgroup equip 1
enableplayercontrols
endif
End