I know there's no way to stop anyone who really wants to edit it.
I'm compiling the batch files into exe's.
Now, you may say that there's no point, but I disagree;
1: It stops the "honest people" from changing stuff; only those with the right tools can do it.
2: It stops someone accidently deleting something in one of the files...
Same goes for the inventory file. But I suppose if there's no way around it, I could just leave it as plain text...
One more question -
My file structure looks like this:
Game {
game.bat
Data {
ObjectData {
Armor {
Leather_Armor.bat
etc
}
Enemy
(None as of yet)
}
Object
(None as of yet)
}
Weapons
Bronze_Axe.bat
Bronze_Dagger.bat
etc
}
}
}
Plugins {
}
}
}
(there are more folders but they're un-relevant to the quesiton)
Inside Bronze_Axe.bat is this code -
Code: Select all
set weapon=Bronze_Axe
set weaponinfo=An axe made of bronze.
set weaponattack=9
set weapontype=melee
set weaponbonusattacktype=crush
set weaponrange=1
When someone types
equip Bronze_Axe
It'll check whether that file exists, then call it so that all the relevant information is updated.
What I'd like is for Bronze_Axe.bat to be Bronze_Axe.txt (or such) and for it to look like this -
Code: Select all
Bronze_Axe
An axe made of bronze.
9
melee
crush
1
then the equip.bat to loop through all the information and assign it to the neccasary variables.
This would decrease file size!
Also, I'd like to have a plugin system where the ObjectData folder is also under plugins, so people can put their own weapons, armor, etc into the game.
The only problem with this is that with the original method, people could put whatever batch code they want into the files... (now they can't)
How would you go about setting up the for loop to assign the data to the variables? (keeping in mind that it would need to check which folder the file is in because there are different variables for the armor files and so on).
THANKS SO MUCH FOR ALL THE HELP YOU GUYS HAVE GIVEN ME!!!!!!!!!!!!!!
reaper17
EDIT -
One more problem I've found -
drop.bat
Code: Select all
cls
IF NOT %1 == "" (
REM type Data\inventory.fldr | findtr /r /i /v "^%item%$" > Data\swap.fldr
REM move Data\swap.fldr Data\inventory.fldr >nul
echo YAY
pause
) else (
echo No item defined
pause
pause
)
If you don't send it a parameter, the cmd window closes?
reaper17