Game Development Community

Deleting datablocks mid-game

by Sean H. · in Torque Game Engine · 06/19/2006 (8:23 pm) · 4 replies

Is it legal to delete and re-send datablocks while the mission is running? I'm just curious about some of the mission loading functionality and I'm wondering whether these functions could be put to use in situations other than mission loading.

also, would it be possible to load multiple terrains and switch between them while the game is running? I don't see why this wouldnt work if you place multiple terrain object definitions in the mission file...

#1
06/19/2006 (8:50 pm)
I'm pretty sure deleting datablocks is illegal and I doubt you have a good reason to be doing so. It is possible to resend them during the mission, but there isn't likely a reason to be doing that either. If you're trying to change data on them during the game, you really need to get the full source code so you can update their data properly an a per-variable, per-instance basis. As for the terrain thing, something like that _might_ be plausible, though probably not as a script hack. Stock terrain hadoesn't have any methods for hiding/unhiding, though other classes in the engine do, so it might work like that.
#2
06/20/2006 (3:23 am)
No I'm not trying to do any fancy stuff with the datablocks. In fact I'm not trying to do anything right now except get a little information...

when it comes to the terrains, they can be moved so I don't see why you couldnt just move them around when you're ready to use'em. I just wonder if the engine will still process all the terrains or only the one thats visible.
#3
06/20/2006 (4:45 am)
Hmmm moving them in and out at realtime? I think there's a big deal where you can't have more than one terrain object in the stock engine at once though. So... you can try it but I don't think it works. Dunno how hard it is to just make multiple terrains allowed to show up. That could be a hackish way to do it though, they should be culled if you move them well out of the visible distance like, way below the terrain being used or something. What is it you would want multiple terrains for though?
#4
06/20/2006 (5:38 am)
I just loaded up two different terrain blocks just now. both are visible, however only one seems to be collidable at any time, after deleting one i was free to walk about just fine on the other.


With some proper thinking, you may be able to constructs some interesting environments using multiple terrain blocks if you can find some way to switch which one to collide with.



img119.imageshack.us/img119/5290/editor3nn.jpg

Also you can only, of course, edit one terrain at a time.

Here's a shot of me editing the terrain below the one i'm on.