 |
Server Help Community forums for Subgame, ASSS, and bots
|
| Author |
Message |
Creatix Newbie
Joined: Feb 27 2004 Posts: 15 Offline
|
Posted: Mon May 10, 2004 3:55 pm Post subject: Caption problem - regarding .ini generating |
 |
|
|
|
Hello
atm im programming a little cute Tool with Delphi to create Lvz's. This will make it possible for any1 to create a lvz without needing to know about it. Well i gotten pretty far with the programming but thers 1 problem left:
The top of a lvz starts with 'outfile=lvzname.lvz'. Due the lvz is an ini file, every category has a caption such as [ Objectimages ] and [ mapobjects ]. But Delphi forces me to define a category wich means it doesnt seem to be possible for me to create The 'outfile' and the 'file=' part because it does not have a category. When delphi generates a .ini file it gives me a Fatal Error when i leave the category part empty.
Does any1 have an idea how to solve the problem?
Greetz
Creatix
P.s. im sure thers a solution for the problem somehow.. just werent in the mood to think of it very long... any1 an idea?
|
|
| Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Mon May 10, 2004 4:40 pm Post subject: |
 |
|
|
|
Ask Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole...., he made LIE in Delphi. _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
|
|
| Back to top |
|
 |
Creatixy Guest
Offline
|
Posted: Mon May 10, 2004 5:01 pm Post subject: |
 |
|
|
|
| ask him? how?
|
|
| Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:42 Gender: Joined: Aug 01 2002 Posts: 3616 Location: Las Vegas Offline
|
Posted: Mon May 10, 2004 5:11 pm Post subject: |
 |
|
|
|
| Creatixy wrote: | | ask him? how? |
Check his user profile, contains his email address among other things.
|
|
| Back to top |
|
 |
Jackmn Newbie
Joined: Apr 02 2004 Posts: 13 Offline
|
Posted: Mon May 10, 2004 6:52 pm Post subject: |
 |
|
|
|
| You could just manually code the ini i/o routines. That would probably be easiest.
|
|
| Back to top |
|
 |
Guest
Offline
|
Posted: Tue May 11, 2004 6:25 am Post subject: |
 |
|
|
|
| yeah, lol. silly me
|
|
| Back to top |
|
 |
k0zy Server Help Squatter

Gender: Joined: Jan 11 2003 Posts: 571 Location: Germany Offline
|
Posted: Tue May 11, 2004 5:54 pm Post subject: |
 |
|
|
|
To solve this problem I coded my own Ini parser in LIE.
//procedure that reads the ini into several arrays
procedure TMainFrm.Open(Datei:String);
var f: TextFile;
section,Flag,i: integer;
Line,Help: string;
begin
MapCount := 0;
ScreenCount := 0;
ImageCount := 0;
section := 0;
AssignFile(f,Datei);
Reset(f);
while not EOF(f) do
begin
Flag := 0;
ReadLn(f,Line);
If (LowerCase(Copy(Line,1,7)) = 'outfile') then
begin
eOutFile.Text := Copy(Line,9,Length(Line)-8);
end;
If (LowerCase(Copy(Line,1,4)) = 'file') then
begin
FileList.Items.Add(Copy(Line,6,Length(Line)-5));
end;
If (LowerCase(Copy(Line,1,14)) = '[objectimages]') then
begin
section := 1;
Flag := 1;
end;
If (LowerCase(Copy(Line,1,12)) = '[mapobjects]') then
begin
section := 2;
Flag := 1;
end;
If (LowerCase(Copy(Line,1,15)) = '[screenobjects]') then
begin
section := 3;
Flag := 1;
end;
If (Flag = 0) then
begin
if (section = 1) and (Copy(Line,1,1) <> ';') and (Length(Line) <> 0) then
begin
// ObjectImages
ImageCount := ImageCount + 1;
{Get ImageNumber}
Help := '';
For i := 1 to Length(Line) do
begin
Help := Help + Copy(Line,i,1);
If Copy(Line,i,1) = '=' then
begin
Help := Copy(Help,1,Length(Help)-1);
Help := Copy(Help,6,Length(Help)-5);
SetLength(Images,ImageCount);
SetLength(ImageT,ImageCount);
SetLength(ImageY,ImageCount);
SetLength(ImageX,ImageCount);
SetLength(ImageFile,ImageCount);
Images[ImageCount-1] := StrToInt(Help);
ImageBox.Items.Add('IMAGE'+IntToStr(Images[ImageCount-1]));
end;
end;
{Get File of the Image}
Help := GetImageFile(Line);
ImageFile[ImageCount-1] := Help;
{Other attributes}
ImageX[ImageCount-1] := GetOption(Line,1,True);
ImageY[ImageCount-1] := GetOption(Line,2,True);
ImageT[ImageCount-1] := GetOption(Line,3,True);
end;
if (section = 2) and (Copy(Line,1,1) <> ';') and (Length(Line) <> 0) then
begin
// MapObjects
MapObjectList.Items.Add(Line);
MapCount := MapCount + 1;
SetLength(MapX,MapCount);
SetLength(MapY,MapCount);
SetLength(MapImage,MapCount);
SetLength(MapLayer,MapCount);
SetLength(MapMode,MapCount);
SetLength(MapTime,MapCount);
SetLength(MapID,MapCount);
MapX[MapCount-1] := IntToStr(GetOption(Line,0,False));
MapY[MapCount-1] := IntToStr(GetOption(Line,1,False));
MapImage[MapCount-1] := GetOption(Line,2,False);
MapLayer[MapCount-1] := GetOption(Line,3,False);
MapMode[MapCount-1] := GetOption(Line,4,False);
MapTime[MapCount-1] := GetOption(Line,5,False);
MapID[MapCount-1] := GetOption(Line,6,False);
end;
if (section = 3) and (Copy(Line,1,1) <> ';') and (Length(Line) <> 0) then
begin
// ScreenObjects
ScreenObjectList.Items.Add(Line);
ScreenCount := ScreenCount + 1;
SetLength(ScreenX,ScreenCount);
SetLength(ScreenY,ScreenCount);
SetLength(ScreenImage,ScreenCount);
SetLength(ScreenLayer,ScreenCount);
SetLength(ScreenMode,ScreenCount);
SetLength(ScreenTime,ScreenCount);
SetLength(ScreenID,ScreenCount);
ScreenX[ScreenCount-1] := GetObjectXY(Line,0);
ScreenY[ScreenCount-1] := GetObjectXY(Line,1);
ScreenImage[ScreenCount-1] := GetOption(Line,2,False);
ScreenLayer[ScreenCount-1] := GetOption(Line,3,False);
ScreenMode[ScreenCount-1] := GetOption(Line,4,False);
ScreenTime[ScreenCount-1] := GetOption(Line,5,False);
ScreenID[ScreenCount-1] := GetOption(Line,6,False);
end;
end;
end;
CloseFile(f);
end; | GetOption and GetObjectXY are functions I coded myself, too.
The whole sourcecode is attached. Feel free to contact me if you have any questions!
Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole.... _________________ It's a shark! Oh my god! Unbelievable!
src.zip - 29.76 KB
File downloaded or viewed 9 time(s)
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
Software by php BB © php BB Group Server Load: 69 page(s) served in previous 5 minutes.
|