okay now it is failing with "Could not understand command at line 345". Line 345 being "procprop(t,b$)"
function load_npc(map$)
dim ai_entity(100) as string
if file exist("Profile\"+profile$+"\"+map$+".npc")
load array "Profile\"+profile$+"\"+map$+".npc", ai_entity()
else
load array "Media\Maps\"+map$+".npc", ai_entity()
endif
for t=0 to 100
lin$ = ai_entity(t)
if len(lin$) >2
b$=first token$(lin$,";")
procprop(t,b$)
repeat
procprop(t,b$)
until b$=""
endif
next t
end function
function procprop(ent_id,prop$)
key$=STR Get Left From(prop$,":")
value$=STR Get right From(prop$,":")
select key$
case "name" : npc(ent_id).name = value$ : endcase
endselect
endfunction
EDIT: The input file being;
name:Drew;model:Media\Models\hool1.3ds;texture:Media\Models\hool1.bmp;position:0,0,0;scale:100;angle:0;team:Neutral;class:Person;stance:Cautious;darea:0,0;dradius:256;Roam:0;strafe:0;path:Road;dialogue:{};
name:The Fish;model:Media\Models\hool1.3ds;texture:Media\Models\hool1.bmp;position:200,54,300;scale:100;angle:0;team:Neutral;class:Person;stance:Cautious;darea:0,0;dradius:256;Roam:1;strafe:0;path:Road;dialogue:{};