Questions about deleting...
by Gonzo T. Clown · in Torque Game Engine · 07/29/2004 (6:30 pm) · 5 replies
In SimBase.cc there is this function...
The only place it's used is in the destruction of a server, which in most cases is at shutdown, or startup(as a safety precaution). However, the wording of the comments suggest that it would be good to do from time to time.
My questions are...
1. Should this be included at map changes as well?
2. Should this be run on the client at map change as well as the server?
3. Wouldn't deleteing the dataBlocks destroy both the client and the server? Or are they just particular blocks in memory that are temporary?
One last thing, Tribes had a...
deleteFunctions("MyFunctions*");
built into it that doesn't work in torque. Is there still such a function? If not how hard would it be to make, and is it a really bad idea for some reason?
Thanks in advance to anyone that can help.
ConsoleFunction(deleteDataBlocks, void, 1, 1, "Delete all the datablocks we've downloaded. "
"This is usually done in preparation of downloading a new set of datablocks, "
" such as occurs on a mission change, but it's also good post-mission cleanup.")The only place it's used is in the destruction of a server, which in most cases is at shutdown, or startup(as a safety precaution). However, the wording of the comments suggest that it would be good to do from time to time.
My questions are...
1. Should this be included at map changes as well?
2. Should this be run on the client at map change as well as the server?
3. Wouldn't deleteing the dataBlocks destroy both the client and the server? Or are they just particular blocks in memory that are temporary?
One last thing, Tribes had a...
deleteFunctions("MyFunctions*");
built into it that doesn't work in torque. Is there still such a function? If not how hard would it be to make, and is it a really bad idea for some reason?
Thanks in advance to anyone that can help.
About the author
#2
On the delete functions issue, off the top of my head, I don't think there is such a function. There is (or was recently at least) a deleteVariables([wildcard]) though. For such questions, I'd recommend searching Ron Yacketta's excellent script function reference.
edit: I dredged up this thread because Gonzo asked about it again recently. :)
09/12/2004 (7:44 am)
On the deteleDataBlocks question... the answer depends on your game. If you have datablocks which persist through mission changing (like PlayerData-based datablocks do in many game designs) , then it wouldn't make sense to call deleteDataBlocks between missions.On the delete functions issue, off the top of my head, I don't think there is such a function. There is (or was recently at least) a deleteVariables([wildcard]) though. For such questions, I'd recommend searching Ron Yacketta's excellent script function reference.
edit: I dredged up this thread because Gonzo asked about it again recently. :)
#3
09/12/2004 (8:15 am)
If I'm not mistaken, you want to call deleteDataBlocks on the client every time you change missions. It is responsible for clearing out datablock information in preparation for a fresh download.
#4
That's what I get for tryin' to help. ;)
-------
Edit: hmm... well, Ben has vastly greater Torque knowledge than me here-- he's been working the engine much longer-- so I'm probably mistaken. However, grepping example scripts and the source scripts of actual games, it appears that deleteDataBlocks() is called only in destroyServer() (which is, in turn, only called at disconnect). So, that's for scripts at least, unless I'm missing something. Looks like you probably would only call that function if you had some circumstance where you actually did not want to re-use any datablocks from mission to mission at all.
But yeah, I'm still a bit of a newb with this kind of stuff in in the engine, so... could be wrong.
09/12/2004 (10:54 am)
Ah :) Even when your datablocks stay the same?That's what I get for tryin' to help. ;)
-------
Edit: hmm... well, Ben has vastly greater Torque knowledge than me here-- he's been working the engine much longer-- so I'm probably mistaken. However, grepping example scripts and the source scripts of actual games, it appears that deleteDataBlocks() is called only in destroyServer() (which is, in turn, only called at disconnect). So, that's for scripts at least, unless I'm missing something. Looks like you probably would only call that function if you had some circumstance where you actually did not want to re-use any datablocks from mission to mission at all.
But yeah, I'm still a bit of a newb with this kind of stuff in in the engine, so... could be wrong.
#5
09/12/2004 (2:37 pm)
What's the citation for that line?
Torque Owner Gonzo T. Clown
I guess these were tougher questions than I first expected, lol
[/crickets_chirping]