tssmods

Hosted by freeforums.org
Home Page Play games in the arcade Home Page Home Page Home Page
  Register
Login 
View unanswered posts View active topics

Delete all board cookies

All times are UTC



Welcome
Welcome to <strong>tssmods</strong>.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!


Home Page Home Page  [ 8 posts ] 
  Print view
Previous topic | Next topic 
Author Message
Offline 
 Post subject: BagTrack
PostPosted: Wed May 20, 2009 8:49 am 

Joined: Tue May 19, 2009 5:57 pm
Posts: 4
Greetings!, here has found some errors:
1. At a game quit on escape the heap of memory the lost,
Engine.Free not working...

change:
function TG2Mdl_Tss.Quit(const P: G2Array; const Script: TG2Execute): TG2Variant;
begin
Result:=nil;
if G2ParamMaxError(0, P, Script) then Exit;
Engine.Running := False;// PostQuitMessage(0);
end;

and in main loop:
function CTssApp.MsgProc(hWnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT;
begin
if Engine.Running = False then SendMessage(m_hWnd,WM_CLOSE,0,0);
...
end;


Top
 Profile  
 
Offline 
 Post subject:
PostPosted: Wed May 20, 2009 8:05 pm 

Joined: Mon May 04, 2009 8:46 am
Posts: 30
Thanks for that, but what is Engine.Running? Is this a custom variable you have added, as I cannot find it in my version of the source.

EDIT: Never mind, I got it working :)


Top
 Profile  
 
Offline 
 Post subject:
PostPosted: Wed May 20, 2009 10:00 pm 

Joined: Tue May 19, 2009 5:57 pm
Posts: 4
This variable should be added, I have forgotten about it to write)


Top
 Profile  
 
Offline 
 Post subject:
PostPosted: Thu May 21, 2009 1:02 am 

Joined: Mon May 04, 2009 8:46 am
Posts: 30
Yep, I added the variable and got it working, thanks for that :)

So does doing this prevent a memory leak or something?


Top
 Profile  
 
Offline 
 Post subject:
PostPosted: Thu May 21, 2009 5:03 am 

Joined: Tue May 19, 2009 5:57 pm
Posts: 4
Then i write small stuff to save console command bufer to file:

destructor TTssConsole.Destroy;
var
FileName: string;
begin
...
FileName := ChangeFileExt(ParamStr(0),'.lst');
FOldCommands.SaveToFile(FileName);
FOldCommands.Free;
inherited;
end;

then file game.lst not exist!
interesting that at Alt+F4 all work corect...


Top
 Profile  
 
Offline 
 Post subject:
PostPosted: Fri May 22, 2009 2:43 am 

Joined: Mon May 04, 2009 8:46 am
Posts: 30
I would assume it's because you are trying to change the currently running program to a .lst file.


Top
 Profile  
 
Offline 
 Post subject:
PostPosted: Fri May 22, 2009 5:57 am 

Joined: Tue May 19, 2009 5:57 pm
Posts: 4
PimpDaddy wrote:
I would assume it's because you are trying to change the currently running program to a .lst file.


HeHe))), no, a'm save console command bufer to file named like program(with full path), and extension .lst)))

example: ChangeFileExt(ParamStr(0),'.lst') return:
d:\prj\tss\tss_demo\game.lst

same as i use: ChangeFileExt(ParamStr(0),'.log') to get log file name.

pascal I know normally, that not say about Direct3D and English...(((


Top
 Profile  
 
Offline 
 Post subject:
PostPosted: Fri May 22, 2009 9:48 am 

Joined: Mon May 04, 2009 8:46 am
Posts: 30
Oh ok, now I get it :)

That's interesting about the .lst file though, from using your code, it worked for me.

This is what I used:

Code:
destructor TTssConsole.Destroy;
var
  str : string;
begin
FTickCount.Free;
FBuffer.Free;
str := ChangeFileExt(ParamStr(0),'.lst');
FOldCommands.SaveToFile(str);
FOldCommands.Free;
FreeMem(FCommands);
inherited;
end;


It created an empty .lst file in the directory of the exe.


Top
 Profile  
 
Search for:
Display posts from previous:  Sort by  
Home Page Home Page  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to: