ok, not sure why it did not put the code in, so here it is:
REM Project: object_test
REM Created: 11/7/2005 8:17:11 PM
REM
REM ***** Main Source File *****
REM
REMSTART
this user defined type will be used to create all the non-living objects in a game. Most
objects will not use every field, and any functions that reference an object will drop
out as soon as possible to save time.
example: "rock", "a rock", 5, 0, 1, 0, 0, 10, 50, 0, 4, 1, "blunt", "throwing", 12, "",
0, 1, 90, 90, 50, 100, 25
Basically, I can use this to randomly populate a map with items by reading from a file into
an array. Once it is read in, I can use a for...next loop to randomly select items from the
array and plop them down on my map.
REMEND
TYPE tObject
sName as string
sDescr as string
nObjNum as integer `3d object number of the item
sModelName as string `3d model name
sSpriteName as string `inventory picture
nObjType as integer REM each object can only have one object type, naturally
nItemImmobile as integer `object can not be picked up
nItemWeight as integer
nItemCap as integer `if not zero, the item can contain this amount of weight
nItemHP as integer `how much damage it can take before breaking
nItemRange as integer `how far can it be thrown or launched?
nLauncherType as integer `if this is empty it can not be launched, otherwise it uses nObjectType
nMaxDamage as integer `how much (maximum) damage does it do on a successful attack?
nMinDamage as integer
sDamageType as string `what kind of damage does it do (blunt, elctrical, etc)?
sPrimarySkill as string `what skill does the player use to do stuff with this object?
nStackable as integer `if not zero, then the item is stackable equal to this number
sItemSpell as string `if this is not empty, cast this spell
nItemCharges as integer `if not zero, the item will cast a spell this many times
nItemHands as integer `is it one handed or two-handed?
nColdResist as integer `percentage based resistance to damage types
nHeatResist as integer
nChemResist as integer
nShockResist as integer
nPhysResist as integer
nToHitmod as integer `bonuses or penalties to hit, if any
nToDamMod as integer
sBonusDamType as string `in case the extra damage is fire or something
ENDTYPE
Dim tNewObjects() as tObject
`very rough object creator skeleton
do
inputObject()
loop
function inputObject
Add To Queue tNewObjects()
INPUT "Enter sName >";tNewObjects().sName
INPUT "Enter sDescr >";tNewObjects().sDescr
INPUT "Enter nObjNum >";tNewObjects().nObjNum
INPUT "Enter sModelName >";tNewObjects().sModelName
INPUT "Enter sSpriteName >";tNewObjects().sSpriteName
INPUT "Enter nObjType >";tNewObjects().nObjType
INPUT "Enter nItemImmobile >";tNewObjects().nItemImmobile
INPUT "Enter nItemWeight >";tNewObjects().nItemWeight
INPUT "Enter nItemCap >";tNewObjects().nItemCap
INPUT "Enter nItemHP >";tNewObjects().nItemHP
INPUT "Enter nItemRange >";tNewObjects().nItemRange
INPUT "Enter nLauncherType >";tNewObjects().nLauncherType
INPUT "Enter nMaxDamage >";tNewObjects().nMaxDamage
INPUT "Enter nMinDamage >";tNewObjects().nMinDamage
INPUT "Enter sDamageType >";tNewObjects().sDamageType
INPUT "Enter sPrimarySkill >";tNewObjects().sPrimarySkill
INPUT "Enter nStackable >";tNewObjects().nStackable
INPUT "Enter sItemSpell >";tNewObjects().sItemSpell
INPUT "Enter nItemCharges >";tNewObjects().nItemCharges
INPUT "Enter nItemHands >";tNewObjects().nItemHands
INPUT "Enter nColdResist >";tNewObjects().nColdResist
INPUT "Enter nHeatResist >";tNewObjects().nHeatResist
INPUT "Enter nChemResist >";tNewObjects().nChemResist
INPUT "Enter nShockResist >";tNewObjects().nShockResist
INPUT "Enter nPhysResist >";tNewObjects().nPhysResist
INPUT "Enter nToHitmod >";tNewObjects().nToHitmod
INPUT "Enter nToDamMod >";tNewObjects().nToDamMod
INPUT "Enter sBonusDamType >";tNewObjects().sBonusDamType
INPUT "Quit? Type yes or no.>";sDone$
if sDone$ = "yes"
WriteObjects()
END
endif
endfunction
function WriteObjects
Filename$="objects.txt"
If File Exist(Filename$)=1
delete file Filename$
Endif
Open To Write 1,Filename$
counter=0
while ARRAY INDEX VALID(tNewObjects(counter))=1
write string 1, tNewObjects(counter).sName
write string 1, tNewObjects(counter).sDescr
write string 1, str$(tNewObjects(counter).nObjNum)
write string 1, tNewObjects(counter).sModelName
write string 1, tNewObjects(counter).sSpriteName
write string 1, str$(tNewObjects(counter).nObjType)
write string 1, str$(tNewObjects(counter).nItemImmobile)
write string 1, str$(tNewObjects(counter).nItemWeight)
write string 1, str$(tNewObjects(counter).nItemCap)
write string 1, str$(tNewObjects(counter).nItemHP)
write string 1, str$(tNewObjects(counter).nItemRange)
write string 1, str$(tNewObjects(counter).nLauncherType)
write string 1, str$(tNewObjects(counter).nMaxDamage)
write string 1, str$(tNewObjects(counter).nMinDamage)
write string 1, tNewObjects(counter).sDamageType
write string 1, tNewObjects(counter).sPrimarySkill
write string 1, str$(tNewObjects(counter).nStackable)
write string 1, tNewObjects(counter).sItemSpell
write string 1, str$(tNewObjects(counter).nItemCharges)
write string 1, str$(tNewObjects(counter).nItemHands)
write string 1, str$(tNewObjects(counter).nColdResist)
write string 1, str$(tNewObjects(counter).nHeatResist)
write string 1, str$(tNewObjects(counter).nChemResist)
write string 1, str$(tNewObjects(counter).nShockResist)
write string 1, str$(tNewObjects(counter).nPhysResist)
write string 1, str$(tNewObjects().nToHitmod)
write string 1, str$(tNewObjects().nToDamMod)
write string 1, tNewObjects().sBonusDamType
Inc Counter
endwhile
endfunction