My first contribution! Hope it works for everyone. Basically this just converts entity data into useable data in a dbpro program. There's one hitch though. Once you have exported the entity .txt file from CShop you will have to use a text editor (Ex: Notepad) to change all " (double quotes) into ' (single quotes). Thank god for the find/replace button. Anyways, enjoy!!!
Rem *** Include File: Parser.dba ***
Rem Created: 5/1/2004 7:03:02 PM
Rem Included in Project: C:\Documents and Settings\Ross\My Documents\Science\Game\Game.dbpro
REM FOR USE WITH EXTRACTING COORDINATES OF WAYPOINTS GENERATED BY CSHOP 4.1 ONLY
_Parser:
open to read 1,parseNodes$
dim NodeX(1)
dim NodeY(1)
dim NodeZ(1)
dim NodeType$(1)
while file end(1)<1
read string 1,toParser$
if left$(toParser$,8)="'Type'="
extract = 10
while mid$(toParser$,extract)<>"'"
NodeType$(omega)=NodeType$(omega)+mid$(toParser$,extract)
inc extract
endwhile
endif
if left$(toParser$,9)="'origin'="
extract=11
NodeX$=""
while mid$(toParser$,extract)<>" "
NodeX$=NodeX$+mid$(toParser$,extract)
inc extract
endwhile
inc extract
NodeX(omega)=val(NodeX$)
NodeY$=""
while mid$(toParser$,extract)<>" "
NodeY$=NodeY$+mid$(toParser$,extract)
inc extract
endwhile
inc extract
NodeY(omega)=val(NodeY$)
NodeZ$=""
while mid$(toParser$,extract)<>"'"
NodeZ$=NodeZ$+mid$(toParser$,extract)
inc extract
endwhile
NodeZ(omega)=-val(NodeZ$)
inc omega
array insert at bottom NodeX()
array insert at bottom NodeY()
array insert at bottom NodeZ()
endif
endwhile
return
In this particular code, I was turning entities into waypoint data for my AI. If anybody wants, I can post a commented version too.
There 10 kinds of people, those who understand binary and those who don't