I've looked into eventqueue.h which seems to offer the functionality needed for this. I haven't quite figured out how it works though. Maybe it's possible to add the server command to stop the demo at a specific time to a command queue and also the one that moves the demo (moving/renaming the file should be possible using the functions offered in filebase.h). Maybe it's possible this way cause the event of "renaming the file" is called as long as the command is in the queue. The only other way I could think of would be to call the move function every frame after the player touched the trigger until the server finished writing the demo file and the moving process succeeds.
Then again, I wouldn't know how to do that either. I'm having a hard time understanding how exactly the engine works anyway. Obviously there are functions that get called every frame and others that are only called when activated by a certain event. How or where is this all declared? I guess this is more of a general question. I'm getting the feeling that it would be easier for me to find a solution to my problem myself if I had a better understanding of how the game works. Bear with me, I'm just doing this for fun and this is the first time I'm looking into the source code of a game. So forgive me if this question sounds rather 2009/11/18 Grash <[email protected]> > I feel real dirty suggesting this. But it's how I'd go about doing it > myself... > > you can use system() [or _wsystem()] > http://msdn.microsoft.com/en-us/library/aa273022%28VS.60%29.aspx > > http://www.cplusplus.com/reference/clibrary/cstdlib/system/ > This describes as the function taking over the program till the command > finishes. Given we're talking about disk operation, and that's slow as shit > to perform this could be a concern! > > Is there a safer method in the source engine? > > --- On Tue, 11/17/09, N K <[email protected]> wrote: > > > From: N K <[email protected]> > > Subject: Re: [hlcoders] Change default demo directory and move demos > after creation > > To: "Discussion of Half-Life Programming" < > [email protected]> > > Date: Tuesday, November 17, 2009, 3:30 PM > > Well, that's embarrassing. I know I > > tried to record to another directory by > > using record "bla/temp.dem" and for some reason it didn't > > work. Now I > > realise it does work so I must have messed up with the > > syntax when I tested > > it before. So okay, one problem solved; one to go... and > > the renaming thing > > is actually the more important one. > > > > 2009/11/17 Spencer 'voogru' MacDonald <[email protected]> > > > > > Why not just record the demo to where it will end up > > anyway and skip the > > > whole moving part? > > > > > > With SourceTV you can change the demo path by simply > > doing like tv_record > > > "path/to/demo.dem", probably the same with the > > standard record command. > > > > > > -----Original Message----- > > > From: [email protected] > > > [mailto:[email protected]] > > On Behalf Of N K > > > Sent: Tuesday, November 17, 2009 2:06 PM > > > To: [email protected] > > > Subject: [hlcoders] Change default demo directory and > > move demos after > > > creation > > > > > > Hello everyone. I've got two rather special questions > > which I doubt have > > > been asked before. I'm guessing that's also why I > > haven't been able to find > > > anything about it on the internet so far. > > > > > > First of, I'm working with the OB version of the SDK. > > I've added a custom > > > trigger to triggers.cpp that is supposed to start and > > stop a demo when the > > > player touches it. That's where my first question > > comes up. I'm recording > > > the demo to a temporary file that I want to rename and > > move after it's > > > fully > > > recorded. For that purpose I'd like to save the > > temporary demo in another > > > folder than the root dir of my mod in /sourcemods (say > > in > > > /sourcemods/mymod/temp). Is that possible somehow or > > is it not in the hands > > > of modders? I have not been able to find anything > > about it in the source > > > code the SDK provides so I'm getting the feeling it's > > not. > > > > > > Secondly, once the demo is stopped, I want to rename > > it after a certain > > > scheme and then move it out of it's temporary folder > > (respectively the root > > > dir if I can't change that). The problem is that it > > takes a certain time > > > until the demo is stopped. Right now, touching the > > stopping trigger calls > > > the Touch( CBaseEntity *pOther ) method from where it > > issues the following > > > two commands: > > > > > > engine->ServerCommand( "stop\n" ); > > > pPlayer->MoveDemo( pPlayer ); > > > > > > I've implemented the MoveDemo method in > > basecombatcharacter.cpp cause I > > > need > > > to access player specific variables I added to the > > class. Now my question > > > is > > > simply how I could work around this problem, meaning > > how could I make sure > > > the MoveDemo function gets called when I can be sure > > that the demo isn't > > > used by the application anymore. > > > > > > In that context I just thought of another question > > that's of similar > > > nature. > > > I don't want to stop the demo at the exact moment the > > player touches the > > > trigger. I'd rather have a little time difference of > > say 6+ seconds so the > > > demo doesn't stop so abruptly. > > > > > > I'm really happy about any input from you guys cause > > I'm completely stuck > > > because of these problems right now. Thank you. > > > _______________________________________________ > > > To unsubscribe, edit your list preferences, or view > > the list archives, > > > please visit: > > > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > > > > > > > _______________________________________________ > > > To unsubscribe, edit your list preferences, or view > > the list archives, > > > please visit: > > > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > > > > > > _______________________________________________ > > To unsubscribe, edit your list preferences, or view the > > list archives, please visit: > > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > > > > > > > _______________________________________________ > To unsubscribe, edit your list preferences, or view the list archives, > please visit: > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders

