i would but...

by (no login)

 
im trying to create an entire default list with the editor. i can create text file and then load them up with the main mod but if i give the game to someone new, i want everyting to be automatic and create all the files with the default values


this is the editor program so far. eventually im going to alter the CREATEFILES sub so that it loads DATA statements and creates better default files. if worse comes to worse, i can always cut 100 monster entries out and 50-100 weapons and armors.



DECLARE SUB EDITSPELLS (z)
DECLARE SUB EDITCREATEFILES ()
DECLARE SUB EDITMONSTERS ()
DECLARE SUB EDITWEAPONARMOR (z)
DECLARE SUB EDITITEMS ()

OPEN "monster.txt" FOR APPEND AS #1
IF LOF(1) = 0 THEN CLOSE #1: KILL "monster.txt": CALL EDITCREATEFILES
CLOSE #1

DO: CLS
PRINT "Welcome to the Quest Editor!! What do you wish to view/edit?"
PRINT : PRINT : PRINT "(A)rmor Data"
PRINT : PRINT "(D)ark Spell Data"
PRINT : PRINT "(I)tem Data"
PRINT : PRINT "(L)ight Spell Data"
PRINT : PRINT "(M)onster Data"
PRINT : PRINT "(W)eapon Data"
PRINT : PRINT "(*) Reset All Data Files to Defaults"
PRINT : PRINT : PRINT "(Q)uit Editor"
PRINT : PRINT
PRINT "What is your choice?"
DO: A$ = UCASE$(INKEY$)
LOOP UNTIL A$ <> ""
SELECT CASE A$
CASE "Q": END
CASE "M": CALL EDITMONSTERS: RUN
CASE "W": z = 1: CALL EDITWEAPONARMOR(z): RUN
CASE "A": z = 2: CALL EDITWEAPONARMOR(z): RUN
CASE "I": CALL EDITITEMS: RUN
CASE "D": z = 1: CALL EDITSPELLS(z): RUN
CASE "L": z = 2: CALL EDITSPELLS(z): RUN
CASE "*": CALL EDITCREATEFILES: RUN
END SELECT
LOOP UNTIL A$ = "Q": END

SUB EDITCREATEFILES

CLS : m = 500
OPEN "monster.txt" FOR OUTPUT AS #1
FOR x = 1 TO m
A$ = STR$(x): WRITE #1, A$: 'this sets the monster #
A$ = "Cat": WRITE #1, A$: 'this sets monster name
A$ = "1": WRITE #1, A$: 'this sets monster hitpoints
A$ = "1": WRITE #1, A$: 'this sets monster attack
A$ = "1": WRITE #1, A$: 'this sets monster defence
A$ = "1": WRITE #1, A$: 'this sets monster intelligence
A$ = "1": WRITE #1, A$: 'this sets monster agility
A$ = "1": WRITE #1, A$: 'this sets monster ingenuity
A$ = "1": WRITE #1, A$: 'this sets monster min level
A$ = "2": WRITE #1, A$: 'this sets monster max level
A$ = "Claws": WRITE #1, A$: 'this sets monster weapon
A$ = "Grrrr!": WRITE #1, A$: 'this sets monster quote
A$ = "0": WRITE #1, A$: 'this sets extra monster value
A$ = "0": WRITE #1, A$: 'this set extra monster value
NEXT x
CLOSE #1
PRINT : PRINT "Monster Data File Reset!"

FOR A = 1 TO 4
IF A = 1 THEN OPEN "weapons.txt" FOR OUTPUT AS #1
IF A = 2 THEN OPEN "armor.txt" FOR OUTPUT AS #1
IF A = 3 THEN OPEN "drkspell.txt" FOR OUTPUT AS #1
IF A = 4 THEN OPEN "litspell.txt" FOR OUTPUT AS #1
IF A <= 2 THEN b = 300
IF A >= 3 THEN b = 50
FOR x = 1 TO b

A$ = STR$(x): WRITE #1, A$

IF A = 1 THEN A$ = "Knife": WRITE #1, A$
IF A = 2 THEN A$ = "Straw Shield": WRITE #1, A$
IF A = 3 THEN A$ = "Fire": WRITE #1, A$
IF A = 4 THEN A$ = "Heal": WRITE #1, A$

IF A <= 2 THEN A$ = "150": WRITE #1, A$
IF A = 3 THEN A$ = "burn your enemy!": WRITE #1, A$
IF A = 4 THEN A$ = "recover some hitpoints!": WRITE #1, A$

IF A <= 2 THEN A$ = "1": WRITE #1, A$
IF A >= 3 THEN A$ = "5": WRITE #1, A$

IF A <= 2 THEN A$ = "1": WRITE #1, A$
IF A = 3 THEN A$ = "10": WRITE #1, A$
IF A = 4 THEN A$ = "0": WRITE #1, A$

IF A <= 2 THEN A$ = "100": WRITE #1, A$
IF A = 3 THEN A$ = "0": WRITE #1, A$
IF A = 4 THEN A$ = "10": WRITE #1, A$

IF A = 1 THEN A$ = "Shiny but dull.": WRITE #1, A$
IF A = 2 THEN A$ = "Poorly constructed.": WRITE #1, A$
IF A >= 3 THEN A$ = "0": WRITE #1, A$

A$ = "0": WRITE #1, A$

A$ = "0": WRITE #1, A$

NEXT x
CLOSE #1
NEXT A
PRINT : PRINT "Weapon Data File Reset!"
PRINT : PRINT "Armor Data File Reset!"
PRINT : PRINT "Light Spell Data File Reset!"
PRINT : PRINT "Dark Spell Data File Reset"
PRINT : PRINT "Press a Key"
DO: A$ = UCASE$(INKEY$)
LOOP UNTIL A$ <> ""
END SUB

SUB EDITITEMS
END SUB

SUB EDITMONSTERS


EDITMONSTERS: m = 500
DIM monnum(1 TO m) AS INTEGER
DIM monname(1 TO m) AS STRING
DIM monhp(1 TO m) AS INTEGER
DIM monatt(1 TO m) AS INTEGER
DIM mondef(1 TO m) AS INTEGER
DIM monintell(1 TO m) AS INTEGER
DIM monag(1 TO m) AS INTEGER
DIM moning(1 TO m) AS INTEGER
DIM monminlv(1 TO m) AS INTEGER
DIM monmaxlv(1 TO m) AS INTEGER
DIM monweap(1 TO m) AS STRING
DIM monquote(1 TO m) AS STRING
DIM monextra1(1 TO m) AS INTEGER
DIM monextra2(1 TO m) AS INTEGER

CLS
OPEN "monster.txt" FOR INPUT AS #1
x = 0
DO WHILE NOT EOF(1)
x = x + 1
INPUT #1, A$: monnum(x) = VAL(A$)
INPUT #1, monname$(x)
INPUT #1, A$: monhp(x) = VAL(A$)
INPUT #1, A$: monatt(x) = VAL(A$)
INPUT #1, A$: mondef(x) = VAL(A$)
INPUT #1, A$: monintell(x) = VAL(A$)
INPUT #1, A$: monag(x) = VAL(A$)
INPUT #1, A$: moning(x) = VAL(A$)
INPUT #1, A$: monminlv(x) = VAL(A$)
INPUT #1, A$: monmaxlv(x) = VAL(A$)
INPUT #1, monweap$(x)
INPUT #1, monquote$(x)
INPUT #1, A$: monextra1(x) = VAL(A$)
INPUT #1, A$: monextra2(x) = VAL(A$)
LOOP
CLOSE #1
x = 1

DISPLAYMONDATA: CLS
IF x = 0 THEN x = m
IF x = m + 1 THEN x = 1
PRINT "Current Monster Data:"
PRINT "====================="
PRINT "Monster number:"; x
LOCATE 6, 1: PRINT "Monster Name: "; monname$(x)
LOCATE 9, 1: PRINT "Monster Hitpoints:"; monhp(x)
LOCATE 12, 1: PRINT "Monster Attack Strength:"; monatt(x)
LOCATE 15, 1: PRINT "Monster Defend Strength:"; mondef(x)
LOCATE 18, 1: PRINT "Monster Intelligence:"; monintell(x)
LOCATE 21, 1: PRINT "Monster Agility:"; monag(x)
LOCATE 24, 1: PRINT "Monster Ingenuity:"; moning(x)
LOCATE 27, 1: PRINT "Min Level:"; monminlv(x)
LOCATE 30, 1: PRINT "Max Level:"; monmaxlv(x)
LOCATE 33, 1: PRINT "Monster Weapon: "; monweap$(x)
LOCATE 36, 1: PRINT "Monster Quote: "; monquote$(x)
LOCATE 39, 1: PRINT "Extra Space"; monextra1(x)
LOCATE 42, 1: PRINT "Extra Space"; monextra2(x)
LOCATE 45, 1: PRINT "(N)ext (P)revious (E)dit (M)ain Menu"
DO: A$ = UCASE$(INKEY$)
LOOP UNTIL A$ <> ""
SELECT CASE A$
CASE "M": EXIT SUB
CASE "N": x = x + 1: GOTO DISPLAYMONDATA
CASE "P": x = x - 1: GOTO DISPLAYMONDATA
CASE "E": GOSUB EDITMONDATA: GOTO DISPLAYMONDATA
END SELECT: GOTO DISPLAYMONDATA

EDITMONDATA: 'this edits the monster data
OPEN "monster.txt" FOR INPUT AS #1
DO UNTIL EOF(1)
INPUT #1, num$, name$, hp$, att$, def$, intell$, ag$, ing$, minlv$, maxlv$, weap$, quote$, extra1$, extra2$
n = n + 1
LOOP
CLOSE #1

newmonnum$ = STR$(x)
COLOR 8
LOCATE 7, 1: INPUT "Enter new Monster name:"; A$
IF A$ = "" THEN
newmonname$ = monname$(x)
ELSE newmonname$ = A$
END IF
LOCATE 10, 1: INPUT "Enter new Monster Hitpoints:"; A$
IF A$ = "" THEN
newmonhp$ = STR$(monhp(x))
ELSE newmonhp$ = A$
END IF
LOCATE 13, 1: INPUT "Enter new Monster Attack:"; A$
IF A$ = "" THEN
newmonatt$ = STR$(monatt(x))
ELSE newmonatt$ = A$
END IF
LOCATE 16, 1: INPUT "Enter new Monster Defend:"; A$
IF A$ = "" THEN
newmondef$ = STR$(mondef(x))
ELSE newmondef$ = A$
END IF
LOCATE 19, 1: INPUT "Enter new Monster Intelligence:"; A$
IF A$ = "" THEN
newmonintell$ = STR$(monintell(x))
ELSE newmonintell$ = A$
END IF
LOCATE 22, 1: INPUT "Enter new Monster Agility:"; A$
IF A$ = "" THEN
newmonag$ = STR$(monag(x))
ELSE newmonag$ = A$
END IF
LOCATE 25, 1: INPUT "Enter new Monster Ingenuity:"; A$
IF A$ = "" THEN
newmoning$ = STR$(moning(x))
ELSE newmoning$ = A$
END IF
LOCATE 28, 1: INPUT "Enter new Monster Min Level:"; A$
IF A$ = "" THEN
newmonminlv$ = STR$(monminlv(x))
ELSE newmonminlv$ = A$
END IF
LOCATE 31, 1: INPUT "Enter new Monster Max Level:"; A$
IF A$ = "" THEN
newmonmaxlv$ = STR$(monmaxlv(x))
ELSE newmonmaxlv$ = A$
END IF
LOCATE 34, 1: INPUT "Enter new Monster Weapon:"; A$
IF A$ = "" THEN
newmonweap$ = monweap$(x)
ELSE newmonweap$ = A$
END IF
LOCATE 37, 1: INPUT "Enter new Monster Quote:"; A$
IF A$ = "" THEN
newmonquote$ = monquote$(x)
ELSE newmonquote$ = A$
END IF
LOCATE 40, 1: INPUT "Enter new Monster extra1:"; A$
IF A$ = "" THEN
newmonextra1$ = STR$(monextra1(x))
ELSE newmonextra1$ = A$
END IF
LOCATE 43, 1: INPUT "Enter new Monster extra2:"; A$
IF A$ = "" THEN
newmonextra2$ = STR$(monextra2(x))
ELSE newmonextra2$ = A$
END IF

OPEN "monster.txt" FOR INPUT AS #1
OPEN "temp.txt" FOR OUTPUT AS #2
n = 0
DO WHILE NOT EOF(1)
n = n + 1
INPUT #1, num$, name$, hp$, att$, def$, intell$, ag$, ing$, minlv$, maxlv$, weap$, quote$, extra1$, extra2$
IF x <> n THEN
WRITE #2, num$, name$, hp$, att$, def$, intell$, ag$, ing$, minlv$, maxlv$, weap$, quote$, extra1$, extra2$
ELSEIF x = n THEN WRITE #2, newmonnum$, newmonname$, newmonhp$, newmonatt$, newmondef$, newmonintell$, newmonag$, newmoning$, newmonminlv$, newmonmaxlv$, newmonweap$, newmonquote$, newmonextra1$, newmonextra2$
END IF
LOOP
CLOSE #1, #2
KILL "monster.txt"
NAME "temp.txt" AS "monster.txt"

OPEN "monster.txt" FOR INPUT AS #1
n = 0
DO WHILE NOT EOF(1)
n = n + 1
INPUT #1, A$: monnum(n) = VAL(A$)
INPUT #1, monname$(n)
INPUT #1, A$: monhp(n) = VAL(A$)
INPUT #1, A$: monatt(n) = VAL(A$)
INPUT #1, A$: mondef(n) = VAL(A$)
INPUT #1, A$: monintell(n) = VAL(A$)
INPUT #1, A$: monag(n) = VAL(A$)
INPUT #1, A$: moning(n) = VAL(A$)
INPUT #1, A$: monminlv(n) = VAL(A$)
INPUT #1, A$: monmaxlv(n) = VAL(A$)
INPUT #1, monweap$(n)
INPUT #1, monquote$(n)
INPUT #1, A$: monextra1(n) = VAL(A$)
INPUT #1, A$: monextra2(n) = VAL(A$)
LOOP
CLOSE #1
COLOR 7: RETURN


END SUB

SUB EDITSPELLS (z)

s = 50
DIM spellnum(1 TO s) AS INTEGER
DIM spellname(1 TO s) AS STRING
DIM spelldescrip(1 TO s) AS STRING
DIM spellcost(1 TO s) AS INTEGER
DIM spellatt(1 TO s) AS INTEGER
DIM spellheal(1 TO s) AS INTEGER
DIM spelldef(1 TO s) AS INTEGER
DIM spellextra1(1 TO s) AS INTEGER
DIM spellextra2(1 TO s) AS INTEGER

CLS

IF z = 1 THEN z$ = "Dark Spell": OPEN "drkspell.txt" FOR INPUT AS #1
IF z = 2 THEN z$ = "Light Spell": OPEN "litspell.txt" FOR INPUT AS #1
x = 0
DO WHILE NOT EOF(1)
x = x + 1
INPUT #1, A$: spellnum(x) = VAL(A$)
INPUT #1, spellname$(x)
INPUT #1, spelldescrip$(x)
INPUT #1, A$: spellcost(x) = VAL(A$)
INPUT #1, A$: spellatt(x) = VAL(A$)
INPUT #1, A$: spellheal(x) = VAL(A$)
INPUT #1, A$: spelldef(x) = VAL(A$)
INPUT #1, A$: spellextra1(x) = VAL(A$)
INPUT #1, A$: spellextra2(x) = VAL(A$)
LOOP
CLOSE #1
x = 1

DISPLAYSPELLDATA: CLS
IF x = 0 THEN x = s
IF x = s + 1 THEN x = 1
PRINT "Current "; : PRINT z$; : PRINT " Data:"
PRINT "====================="
PRINT z$; : PRINT " number:"; x
LOCATE 6, 1: PRINT z$; : PRINT " Name: "; spellname$(x)
LOCATE 9, 1: PRINT z$; : PRINT " Description: "; spelldescrip$(x)
LOCATE 12, 1: PRINT z$; : PRINT " Mana Cost:"; spellcost(x)
LOCATE 15, 1: PRINT z$; : PRINT " Max Attack Damage:"; spellatt(x)
LOCATE 18, 1: PRINT z$; : PRINT " Max Heal Amount:"; spellheal(x)
LOCATE 21, 1: PRINT z$; : PRINT " Max Defence Amount:"; spelldef(x)
LOCATE 24, 1: PRINT z$; : PRINT " extra1:"; spellextra1(x)
LOCATE 27, 1: PRINT z$; : PRINT " extra2:"; spellextra2(x)
PRINT : PRINT
PRINT : PRINT "(N)ext (P)revious (E)dit (M)ain Menu"
DO: A$ = UCASE$(INKEY$)
LOOP UNTIL A$ <> ""
SELECT CASE A$
CASE "M": EXIT SUB
CASE "N": x = x + 1: GOTO DISPLAYSPELLDATA
CASE "P": x = x - 1: GOTO DISPLAYSPELLDATA
CASE "E": GOSUB EDITSPELLDATA: GOTO DISPLAYSPELLDATA
END SELECT: GOTO DISPLAYSPELLDATA

EDITSPELLDATA: IF z = 1 THEN OPEN "drkspell.txt" FOR INPUT AS #1
IF z = 2 THEN OPEN "litspell.txt" FOR INPUT AS #1
DO UNTIL EOF(1)
INPUT #1, num$, name$, desc$, cost$, att$, heal$, def$, xtr1$, xtr2$
n = n + 1
LOOP
CLOSE #1

newspellnum$ = STR$(x)
COLOR 8
LOCATE 7, 1: INPUT "Enter new name:"; A$
IF A$ = "" THEN
newspellname$ = spellname$(x)
ELSE newspellname$ = A$
END IF
LOCATE 10, 1: INPUT "Enter new description:"; A$
IF A$ = "" THEN
newspelldescrip$ = spelldescrip$(x)
ELSE newspelldescrip$ = A$
END IF
LOCATE 13, 1: INPUT "Enter new Cost:"; A$
IF A$ = "" THEN
newspellcost$ = STR$(spellcost(x))
ELSE newspellcost$ = A$
END IF
LOCATE 16, 1: INPUT "Enter new Attack Value:"; A$
IF A$ = "" THEN
newspellatt$ = STR$(spellatt(x))
ELSE newspellatt$ = A$
END IF
LOCATE 19, 1: INPUT "Enter new Heal Value:"; A$
IF A$ = "" THEN
newspellheal$ = STR$(spellheal(x))
ELSE newspellheal$ = A$
END IF
LOCATE 22, 1: INPUT "Enter new Defence Value:"; A$
IF A$ = "" THEN
newspelldef$ = STR$(spelldef(x))
ELSE newspelldef$ = A$
END IF
LOCATE 25, 1: INPUT "Enter new Extra1:"; A$
IF A$ = "" THEN
newspellxtr1$ = STR$(spellextra1(x))
ELSE newspellxtr1$ = A$
END IF
LOCATE 28, 1: INPUT "Enter new Extra2:"; A$
IF A$ = "" THEN
newspellxtr2$ = STR$(spellextra2(x))
ELSE newspellxtr2$ = A$
END IF


IF z = 1 THEN OPEN "drkspell.txt" FOR INPUT AS #1
IF z = 2 THEN OPEN "litspell.txt" FOR INPUT AS #1
OPEN "temp.txt" FOR OUTPUT AS #2
n = 0
DO WHILE NOT EOF(1)
n = n + 1
INPUT #1, num$, name$, desc$, cost$, att$, heal$, def$, xtr1$, xtr2$
IF x <> n THEN
WRITE #2, num$, name$, desc$, cost$, att$, heal$, def$, xtr1$, xtr2$
ELSEIF x = n THEN WRITE #2, newspellnum$, newspellname$, newspelldescrip$, newspellcost$, newspellatt$, newspellheal$, newspelldef$, newspellxtr1$, newspellxtr2$
END IF
LOOP
CLOSE #1, #2
IF z = 1 THEN KILL "drkspell.txt": NAME "temp.txt" AS "drkspell.txt"
IF z = 2 THEN KILL "litspell.txt": NAME "temp.txt" AS "litspell.txt"

IF z = 1 THEN OPEN "drkspell.txt" FOR INPUT AS #1
IF z = 2 THEN OPEN "litspell.txt" FOR INPUT AS #1
n = 0
DO WHILE NOT EOF(1)
n = n + 1
INPUT #1, A$: spellnum(n) = VAL(A$)
INPUT #1, spellname$(n)
INPUT #1, spelldescrip$(n)
INPUT #1, A$: spellcost(n) = VAL(A$)
INPUT #1, A$: spellatt(n) = VAL(A$)
INPUT #1, A$: spellheal(n) = VAL(A$)
INPUT #1, A$: spelldef(n) = VAL(A$)
INPUT #1, A$: spellextra1(n) = VAL(A$)
INPUT #1, A$: spellextra2(n) = VAL(A$)
LOOP
CLOSE #1
COLOR 7: RETURN




END SUB

SUB EDITWEAPONARMOR (z)

w = 300
DIM weapnum(1 TO w) AS INTEGER
DIM weapname(1 TO w) AS STRING
DIM weapcost(1 TO w) AS INTEGER
DIM weapstrength(1 TO w) AS INTEGER
DIM weapminlv(1 TO w) AS INTEGER
DIM weapcurse(1 TO w) AS INTEGER
DIM weapdescrip(1 TO w) AS STRING
DIM weapextra1(1 TO w) AS INTEGER
DIM weapextra2(1 TO w) AS INTEGER

CLS

IF z = 1 THEN z$ = "Weapon": OPEN "weapons.txt" FOR INPUT AS #1
IF z = 2 THEN z$ = "Armor": OPEN "armor.txt" FOR INPUT AS #1
x = 0
DO WHILE NOT EOF(1)
x = x + 1
INPUT #1, A$: weapnum(x) = VAL(A$)
INPUT #1, weapname$(x)
INPUT #1, A$: weapcost(x) = VAL(A$)
INPUT #1, A$: weapstrength(x) = VAL(A$)
INPUT #1, A$: weapminlv(x) = VAL(A$)
INPUT #1, A$: weapcurse(x) = VAL(A$)
INPUT #1, weapdescrip$(x)
INPUT #1, A$: weapextra1(x) = VAL(A$)
INPUT #1, A$: weapextra2(x) = VAL(A$)
LOOP
CLOSE #1
x = 1

DISPLAYWEAPDATA: CLS
IF x = 0 THEN x = w
IF x = w + 1 THEN x = 1
PRINT "Current "; : PRINT z$; : PRINT " Data:"
PRINT "====================="
PRINT z$; : PRINT " number:"; x
LOCATE 6, 1: PRINT z$; : PRINT " Name: "; weapname$(x)
LOCATE 9, 1: PRINT z$; : PRINT " Cost:"; weapcost(x)
LOCATE 12, 1: PRINT z$; : PRINT " Strength:"; weapstrength(x)
LOCATE 15, 1: PRINT z$; : PRINT " Min Level:"; weapminlv(x)
LOCATE 18, 1: PRINT z$; : PRINT " Cursed:"; weapcurse(x)
LOCATE 21, 1: PRINT z$; : PRINT " Description: "; weapdescrip$(x)
LOCATE 24, 1: PRINT z$; : PRINT " extra1:"; weapextra1(x)
LOCATE 27, 1: PRINT z$; : PRINT " extra2:"; weapextra2(x)
PRINT : PRINT
PRINT : PRINT "(N)ext (P)revious (E)dit (M)ain Menu"
DO: A$ = UCASE$(INKEY$)
LOOP UNTIL A$ <> ""
SELECT CASE A$
CASE "M": EXIT SUB
CASE "N": x = x + 1: GOTO DISPLAYWEAPDATA
CASE "P": x = x - 1: GOTO DISPLAYWEAPDATA
CASE "E": GOSUB EDITWEAPDATA: GOTO DISPLAYWEAPDATA
END SELECT: GOTO DISPLAYWEAPDATA

EDITWEAPDATA: 'this edits the weapon data
IF z = 1 THEN OPEN "weapons.txt" FOR INPUT AS #1
IF z = 2 THEN OPEN "armor.txt" FOR INPUT AS #1
DO UNTIL EOF(1)
INPUT #1, num$, name$, cost$, stren$, minlv$, curse$, descrip$, xtr1$, xtr2$
n = n + 1
LOOP
CLOSE #1

newweapnum$ = STR$(x)
COLOR 8
LOCATE 7, 1: INPUT "Enter new name:"; A$
IF A$ = "" THEN
newweapname$ = weapname$(x)
ELSE newweapname$ = A$
END IF
LOCATE 10, 1: INPUT "Enter new Cost:"; A$
IF A$ = "" THEN
newweapcost$ = STR$(weapcost(x))
ELSE newweapcost$ = A$
END IF
LOCATE 13, 1: INPUT "Enter new Strength:"; A$
IF A$ = "" THEN
newweapstren$ = STR$(weapstrength(x))
ELSE newweapstren$ = A$
END IF
LOCATE 16, 1: INPUT "Enter new Min Level:"; A$
IF A$ = "" THEN
newweapminlv$ = STR$(weapminlv(x))
ELSE newweapminlv$ = A$
END IF
LOCATE 19, 1: INPUT "Enter new Curse:"; A$
IF A$ = "" THEN
newweapcurse$ = STR$(weapcurse(x))
ELSE newweapcurse$ = A$
END IF
LOCATE 22, 1: INPUT "Enter new Description:"; A$
IF A$ = "" THEN
newweapdescrip$ = weapdescrip$(x)
ELSE newweapdescrip$ = A$
END IF
LOCATE 25, 1: INPUT "Enter new Extra1:"; A$
IF A$ = "" THEN
newweapxtr1$ = STR$(weapextra1(x))
ELSE newweapxtr1$ = A$
END IF
LOCATE 28, 1: INPUT "Enter new Extra2:"; A$
IF A$ = "" THEN
newweapxtr2$ = STR$(weapextra2(x))
ELSE newweapxtr2$ = A$
END IF


IF z = 1 THEN OPEN "weapons.txt" FOR INPUT AS #1
IF z = 2 THEN OPEN "armor.txt" FOR INPUT AS #1
OPEN "temp.txt" FOR OUTPUT AS #2
n = 0
DO WHILE NOT EOF(1)
n = n + 1
INPUT #1, num$, name$, cost$, stren$, minlv$, curse$, descrip$, xtr1$, xtr2$
IF x <> n THEN
WRITE #2, num$, name$, cost$, stren$, minlv$, curse$, descrip$, xtr1$, xtr2$
ELSEIF x = n THEN WRITE #2, newweapnum$, newweapname$, newweapcost$, newweapstren$, newweapminlv$, newweapcurse$, newweapdescrip$, newweapxtr1$, newweapxtr2$
END IF
LOOP
CLOSE #1, #2
IF z = 1 THEN KILL "weapons.txt": NAME "temp.txt" AS "weapons.txt"
IF z = 2 THEN KILL "armor.txt": NAME "temp.txt" AS "armor.txt"

IF z = 1 THEN OPEN "weapons.txt" FOR INPUT AS #1
IF z = 2 THEN OPEN "armor.txt" FOR INPUT AS #1
n = 0
DO WHILE NOT EOF(1)
n = n + 1
INPUT #1, A$: weapnum(n) = VAL(A$)
INPUT #1, weapname$(n)
INPUT #1, A$: weapcost(n) = VAL(A$)
INPUT #1, A$: weapstrength(n) = VAL(A$)
INPUT #1, A$: weapminlv(n) = VAL(A$)
INPUT #1, A$: weapcurse(n) = VAL(A$)
INPUT #1, weapdescrip$(n)
INPUT #1, A$: weapextra1(n) = VAL(A$)
INPUT #1, A$: weapextra2(n) = VAL(A$)
LOOP
CLOSE #1
COLOR 7: RETURN


END SUB

Posted on Jan 17, 2010, 9:11 AM

Respond to this message   

Return to Index

Response TitleAuthor and Date
Files would work better than DATA. DATA consumes valuable space. on Jan 17
 i know DATA will take up space. on Jan 17
  i forgot to add.. on Jan 17
   Let me save you a lot of hell... on Jan 17
    few QB64 questions on Jan 17
     Yes to both. You can also continue to program in the QB IDE. on Jan 17
     32 bit is good. Try it and see. It should work! on Jan 17
  *You could put all the files in a folder and ZIP them up to send to people.Solitaire on Jan 17
   My hunch is, Solitaire, (and an alternative for Mike) is that since it is a game... on Jan 17
    exactly pete on Jan 17
     You could use ASCII encryption on Jan 17
      If you use that, just be sure you don't have a CHR$(26) in your data... on Jan 17
       I normally only change letter\number codes from 48 up. I leave lowers alone. on Jan 17

 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement