Kumquat, The Master Scrivener
It feels so strange not having to click that link every day...
This is a demonstration of the scripts I have written to store and display a word entered by the reader.
Please note that there is a better way to do this. I will update this example as soon as I can.
Recent PostsSet variables to letters. on 2/4/2009 1:16:49 PM
%LETTER1:="D" sets %LETTER1 to 0. If you meant to type 4 instead of "D" then our scripts are the same (except mine has shorter names and no spaces).
This is a demonstration of how saving and recalling words must be done now. Again, would it be feasible to change the editor to allow variables to be set to letters (and perhaps symbols)?
Set variables to letters. on 2/3/2009 2:32:57 PM
I already have it saved on a WordPad document and on two pages in my storygame. The problem is that it is 9,270 characters long and I would rather use something that is 2 characters long.
Set variables to letters. on 2/3/2009 12:23:54 PM
Or: Less restrictive variables.
Would it be possible to allow variables to be set to letters? I want to save and display a word that is entered by the reader, but my current method requires a very long line of code to be used every time the word is to be displayed. Allowing variables to be set to letters would allow me to use the code once and the variable every time after that. For example:
[Very long line of code that sets $LINKTEXT31 to the word.]
Link #31 would not be visible, of course. Alternatively:
If that would set %N to "Name" then I would be able to skip using a link and the code would be significantly shorter.
Are either of these feasible, or will I be stuck using a very long line of code every time I want the word to be displayed?
Cold Blood on 1/21/2009 4:05:30 PM
Your code will not work, solostrike. It will add the difference between the limit and the amount you would have without the limit to the ammunition, which allows it to go over the limit. It will also decrease the amount of ammunition you have if you already have a low enough amount.
IF %TOTALAMMO + %NEWAMMO > 200 THEN BEGIN
%WASTEAMMO:= %TOTALAMMO + %NEWAMMO - 200
%NEWAMMO:= %NEWAMMO - %WASTEAMMO
%TOTALAMMO:= %TOTALAMMO + %NEWAMMO
IF %AMMOTYPE=1 THEN %AMMO1:= %AMMO1 + %NEWAMMO
IF %AMMOTYPE=2 THEN %AMMO2:= %AMMO2 + %NEWAMMO
IF %AMMOTYPE=3 THEN %AMMO3:= %AMMO3 + %NEWAMMO
This should work. %TOTALAMMO is the total amount of ammunition you have. %NEWAMMO is the amount of ammunition that was found. %WASTEAMMO is the amount you cannot carry. %AMMOTYPE is the type of ammunition that was found. %AMMO1, %AMMO2, and %AMMO3 are the amounts of ammunition each weapon has.
Please forgive me if I have made a mistake.