if newname$ = player3ds$ then temp$ = playerq$ : Gosub PrintEntity
if newname$ = dmatch3ds$ then temp$ = dmatchq$ : Gosub PrintEntity
if newname$ = coop3ds$ then temp$ = coopq$ : Gosub PrintEntity
if newname$ = torch3ds$ then temp$ = torchq$ : Gosub PrintEntity
if newname$ = flameLY3ds$ then temp$ = flameLYq$ : Gosub PrintEntity
if newname$ = flameSY3ds$ then temp$ = flameSYq$ : Gosub PrintEntity
if newname$ = flameSW3ds$ then temp$ = flameSWq$ : Gosub PrintEntity
if newname$ = boombox3ds$ then temp$ = boomboxq$ : Gosub PrintEntity
if newname$ = army3ds$ then temp$ = armyq$ : Gosub PrintEntity
if newname$ = dog3ds$ then temp$ = dogq$ : Gosub PrintEntity
if newname$ = ogre3ds$ then temp$ = ogreq$ : Gosub PrintEntity
if newname$ = knight3ds$ then temp$ = knightq$ : Gosub PrintEntity
if newname$ = zombie3ds$ then temp$ = zombieq$ : Gosub PrintEntity
if newname$ = zombiec3ds$ then temp$ = zombiecq$ : spawnflag = 1 : Gosub PrintEntity
if newname$ = wizard3ds$ then temp$ = wizardq$ : Gosub PrintEntity
if newname$ = demon3ds$ then temp$ = demonq$ : Gosub PrintEntity
if newname$ = shambler3ds$ then temp$ = shamblerq$ : Gosub PrintEntity
if newname$ = tarbaby3ds$ then temp$ = tarbabyq$ : Gosub PrintEntity
if newname$ = cthon3ds$ then temp$ = cthonq$ : Gosub PrintEntity
if newname$ = armorG3ds$ then temp$ = armorGq$ : Gosub PrintEntity
if newname$ = armorY3ds$ then temp$ = armorYq$ : Gosub PrintEntity
if newname$ = armorR3ds$ then temp$ = armorRq$ : Gosub PrintEntity
if newname$ = shotgun3ds$ then temp$ = shotgunq$ : Gosub PrintEntity
if newname$ = nailgun3ds$ then temp$ = nailgunq$ : Gosub PrintEntity
if newname$ = snailgun3ds$ then temp$ = snailgunq$ : Gosub PrintEntity
if newname$ = grenade3ds$ then temp$ = grenadeq$ : Gosub PrintEntity
if newname$ = rocket3ds$ then temp$ = rocketq$ : Gosub PrintEntity
if newname$ = thunder3ds$ then temp$ = thunderq$ : Gosub PrintEntity
if newname$ = shells3ds$ then temp$ = shellsq$ : Gosub PrintEntity
if newname$ = bshells3ds$ then temp$ = bshellsq$ : spawnflag = 1 : Gosub PrintEntity
if newname$ = nails3ds$ then temp$ = nailsq$ : Gosub PrintEntity
if newname$ = bnails3ds$ then temp$ = bnailsq$ : spawnflag = 1 : Gosub PrintEntity
if newname$ = rockets3ds$ then temp$ = rocketsq$ : Gosub PrintEntity
if newname$ = brockets3ds$ then temp$ = brocketsq$ : spawnflag = 1 : Gosub PrintEntity
if newname$ = cells3ds$ then temp$ = cellsq$ : Gosub PrintEntity
if newname$ = bcells3ds$ then temp$ = bcellsq$ : spawnflag = 1 : Gosub PrintEntity
if newname$ = health3ds$ then temp$ = healthq$ : Gosub PrintEntity
if newname$ = bhealth3ds$ then temp$ = bhealthq$ : spawnflag = 2 : Gosub PrintEntity
if newname$ = suit3ds$ then temp$ = suitq$ : Gosub PrintEntity
if newname$ = quake3ds$ then temp$ = quakeq$ : Gosub PrintEntity
if newname$ = star3ds$ then temp$ = starq$ : Gosub PrintEntity
if newname$ = invisible3ds$ then temp$ = invisibleq$ : Gosub PrintEntity
if newname$ = silverkey3ds$ then temp$ = silverkeyq$ : Gosub PrintEntity
if newname$ = goldkey3ds$ then temp$ = goldkeyq$ : Gosub PrintEntity
if newname$ = sigil3ds$ then temp$ = sigilq$ : Gosub PrintEntity
if newname$ = lift3ds$ then Gosub FixName2 : temp$ = liftq$ : Gosub PrintLift
if newname$ = door3ds$ then Gosub FixName2 : temp$ = doorq$ : Gosub PrintDoor
if newname$ = sdoor3ds$ then Gosub FixName2 : temp$ = sdoorq$ : Gosub PrintDoor
if newname$ = button3ds$ then Gosub FixName2 : temp$ = buttonq$ : Gosub PrintButton
if newname$ = plat3ds$ then Gosub FixName2 : temp$ = platq$ : Gosub PrintPlat
if newname$ = tport3ds$ then Gosub FixName2 : tp = 0 : temp$ = subname$ : Gosub PrintTport
if newname$ = dmtport3ds$ then Gosub FixName2 : tp = 1 : temp$ = subname$ : Gosub PrintTport
if newname$ = spike3ds$ then temp$ = spikeq$ : spawnflag = 1024 : Gosub PrintSpikeShooter
if newname$ = fireball3ds$ then temp$ = fireballq$ : Gosub PrintFireBall
if newname$ = wall3ds$ then Gosub PrintWall
if newname$ = changelevel3ds$ then Gosub FixName2 : Gosub PrintChangeLevel
if NodeType = 4 then Gosub FixName2 : Gosub PrintLight
if NodeType = 2 then Gosub PrintCamera
Next i
close #1
End
@CheckName
namecheck = 0
if newname$ = player3ds$ or newname$ = dmatch3ds$ or newname$ = coop3ds$ then namecheck = -1
if newname$ = torch3ds$ or newname$ = flameLY3ds$ or newname$ = flameSY3ds$ or newname$ = flameSW3ds$ or newname$ = boombox3ds$ then namecheck = -1
if newname$ = army3ds$ or newname$ = dog3ds$ or newname$ = ogre3ds$ or newname$ = knight3ds$ then namecheck = -1
if newname$ = zombie3ds$ or newname$ = zombiec3ds$ or newname$ = wizard3ds$ or newname$ = demon3ds$ or newname$ = shambler3ds$ or newname$ = tarbaby3ds$ or newname$ = cthon3ds$ then namecheck = -1
if newname$ = armorG3ds$ or newname$ = armorY3ds$ or newname$ = armorR3ds$ then namecheck = -1
if newname$ = shotgun3ds$ or newname$ = nailgun3ds$ or newname$ = snailgun3ds$ or newname$ = grenade3ds$ or newname$ = rocket3ds$ or newname$ = thunder3ds$ then namecheck = -1
if newname$ = shells3ds$ or newname$ = nails3ds$ or newname$ = rockets3ds$ or newname$ = cells3ds$ or newname$ = health3ds$ then namecheck = -1
if newname$ = bshells3ds$ or newname$ = bnails3ds$ or newname$ = brockets3ds$ or newname$ = bcells3ds$ or newname$ = bhealth3ds$ then namecheck = -1
if newname$ = star3ds$ or newname$ = quake3ds$ or newname$ = suit3ds$ or newname$ = invisible3ds$ then namecheck = -1
if newname$ = silverkey3ds$ or newname$ = goldkey3ds$ or newname$ = sigil3ds$ then namecheck = -1
if newname$ = lift3ds$ or newname$ = door3ds$ or newname$ = sdoor3ds$ or newname$ = button3ds$ or newname$ = plat3ds$ or newname$ = spike3ds$ or newname$ = fireball3ds$ then namecheck = -1
if newname$ = tport3ds$ or newname$ = dmtport3ds$ then namecheck = -1
if newname$ = wall3ds$ or newname$ = changelevel3ds$ or newname$ = medieval3ds$ then namecheck = -1
Return
@FixName
newname$ = ""
length = len(NodeName$)
for z = 0 to length - 1
char$ = (mid$(NodeName$,z,1))
if char$ <= "9" & char$ >= "0" or char$ = "-" then return
newname$ = newname$ + char$
Next z
Return
@FixName2
subname$ = "" : subtype$ = ""
btemp = 0
fix2check = 0
z2 = z
for z2 = z to length - 1
char$ = (mid$(NodeName$,z2,1))
if char$ = "-" then fix2check = fix2check + 1 : z2 = z2 + 1
char$ = (mid$(NodeName$,z2,1))
if fix2check = 1 then subname$ = subname$ + char$
if fix2check = 2 then subtype$ = char$ : return
Next z2
Return
@OpenOutputFile
Selectfile "Select animation file to output to", outdir$, guyname$ :'Selecting and opening ASC file to output to
if speed != 0 then print #1,chr$(34);"speed";chr$(34),chr$(34);speed;chr$(34)
if wait != 0 then print #1,chr$(34);"wait";chr$(34),chr$(34);wait;chr$(34)
if length != 0 then print #1,chr$(34);"lip";chr$(34),chr$(34);(lip*(-1));chr$(34)
Gosub PrintBrush
print #1,"}"
Return
@PrintTport
GetXForm NodeName$,0,xform
GetKeyByNumber NodeName$,0,rot
if rot.axis(2) > 0 then rot.angle = rot.angle * (-1)
theta = ((rot.angle)+3870)%360
print #1,"{"
if tp=0 & subtype$ = "s" or subtype$ = "S" then print #1,chr$(34);"classname";chr$(34),chr$(34);tportS$;chr$(34)
if tp=0 & subtype$ = "d" or subtype$ = "D" then print #1,chr$(34);"classname";chr$(34),chr$(34);tportD$;chr$(34)
if tp=0 & subtype$ = "s" or subtype$ = "S" then print #1,chr$(34);"target";chr$(34),chr$(34);subname$;chr$(34)
if tp=0 & subtype$ = "d" or subtype$ = "D" then print #1,chr$(34);"targetname";chr$(34),chr$(34);subname$;chr$(34)
if tp=0 & subtype$ = "d" or subtype$ = "D" then print #1,chr$(34);"origin";chr$(34),chr$(34);int(xform.tm(3,0));" ";int(xform.tm(3,1));" ";int(xform.tm(3,2));chr$(34)
if tp=1 & subtype$ = "s" or subtype$ = "S" then print #1,chr$(34);"classname";chr$(34),chr$(34);dmtportS$;chr$(34)
if tp=1 & subtype$ = "d" or subtype$ = "D" then print #1,chr$(34);"classname";chr$(34),chr$(34);dmtportD$;chr$(34)
if tp=1 & subtype$ = "s" or subtype$ = "S" then print #1,chr$(34);"target";chr$(34),chr$(34);subname$;chr$(34)
if tp=1 & subtype$ = "d" or subtype$ = "D" then print #1,chr$(34);"targetname";chr$(34),chr$(34);subname$;chr$(34)
if tp=1 & subtype$ = "d" or subtype$ = "D" then print #1,chr$(34);"origin";chr$(34),chr$(34);int(xform.tm(3,0));" ";int(xform.tm(3,1));" ";int(xform.tm(3,2));chr$(34)
if tp=1 then print #1,chr$(34);"spawnflags";chr$(34),chr$(34);"1792";chr$(34)
if subtype$ = "d" or subtype$ = "D" then print #1,chr$(34);"angle";chr$(34),chr$(34);theta;chr$(34)
if subtype$ = "s" or subtype$ = "S" then Gosub PrintBrush