Skip to content

Variable not printable in second run #3

@mowgli

Description

@mowgli

I made a simple track race NPC with the following script:

=Start
:set myname=Theo
:if (isSet(@[playername]@.start)) then goto zeit3
Hallo @[playername]@
>name:Wer bist Du?
>zweck:Was kann man hier machen?
>end:Tschüß

=Name
Ich bin @[myname]@.
>zweck:Was kann man hier machen?
>end:Tschüß

=Zweck
Das ist eine Rennstrecke. Probiere doch, wie schnell Du bist!
>zeit1:kannst Du die Zeit stoppen?
>name:Wie heißt Du?
>end:Tschüß

=Zeit1
Klar!

Fertig?
>zeit2:LOS!
>end:Tschüß

=Zeit2
:set @[playername]@.start=timeOfDay()
@[@[playername]@.start]@
LOS!
:goto end

=Zeit3
@[@[playername]@.start]@
:set stop=timeOfDay()
:set @[playername]@.last=calc((@[stop]@ - @[@[playername]@.start]@)*60)
Super! Du hast @[@[playername]@.last]@ Spielminuten benötigt.
:set @[playername]@.start=
>end:Tschüß

The first time (in Zeit2) gets printed out but the second (in Zeit3) doesn't. The strange thing is that the value is available in calculation two lines later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions