hi
im using vorple with inform7 and i stumbled on a problem. i save players commands and reload them when he comes back to the game at any given time… now my problem is if he/she wants to restart game i need to delete his/her commands and restart is made of two steps where second is confirmation and report and succesfully is not working… this is what i tried
to successful attempt by player Restarting the game:
say "recalculating";
execute JavaScript command "return deletePlayerCommands();".
report Restarting the game:
say "recalculating";
execute JavaScript command "return deletePlayerCommands();".
both do compile atleast did before copying here but none executes. …the only way i see is checking if user wants to restart catch his command and dismiss it with my own action followed by restart …the only thing restart is of two steps with confirmation …im not complitly sure how to handle this.
2 Likes
Report never runs for restarting (carry out restarts the game, I guess).
You could replace the carry out restarting the game
rule with your own, in which you prompt for confirmation and then run your extra JS in that before doing follow the immediately restart the VM rule.
I’m on mobile right now, but I’ll take a look at the library and see exactly how it works when I get to a computer.
1 Like
i’m missing too many pieces here…i understand the logic you suggest but unable to write it down.
I forgot about this yesterday, sorry!
This should do what you want, put your JS code in place of the comment line.
To decide whether the player really means it: (- (YesOrNo() ~= 0) -).
The restart the game rule is not listed in any rulebook.
Carry out restarting the game:
say "Are you sure you want to restart?[line break] > ";
If the player really means it:
[ Do Javascript stuff here. ]
follow the immediately restart the VM rule;
say "You choose to go on? Very well...".
I tested this on 10.1.0.
1 Like
thank you very much…i can’t yet test it 100% on website with JS code but it seems like its working
in inform 
2 Likes
yes it is working also on web page 
1 Like