ID:160975
 
how do i prevent a map from loading at run time?

the only way i know how to prevent the map from loading is unchecking the box next to the map, but thats at compile time
Theosco wrote:
the only way i know how to prevent the map from loading is unchecking the box next to the map, but thats at compile time

That's basically the best way to do it. What you said doesn't matter, because you're going to need to use your own custom method (or a library's of course) to load the map in the middle of runtime regardless of whether it's ticked or not (you obviously need it to be available in the game's directory though).
If you mean something different though, then you're going to need to explain in more detail.
In response to Kaioken
Kaioken wrote:
Theosco wrote:
the only way i know how to prevent the map from loading is unchecking the box next to the map, but thats at compile time

That's basically the best way to do it. What you said doesn't matter, because you're going to need to use your own custom method (or a library's of course) to load the map in the middle of runtime regardless of whether it's ticked or not (you obviously need it to be available in the game's directory though).
If you mean something different though, then you're going to need to explain in more detail.

Yeah, I seem to forgot about the #include function when I was trying to find a way to do this.
In response to Theosco
Pre-processors directives take effect only at compile-time - they're not functions. Including a file by #include is virtually the same as checking the box - what checking the box does is automatically add an #include line to your DME file.
In response to Kaioken
Kaioken wrote:
Pre-processors directives take effect only at compile-time - they're not functions. Including a file by #include is virtually the same as checking the box - what checking the box does is automatically add an #include line to your DME file.

well are there any problems with using #ifdef and just reloading the world?
In response to Theosco
Compiling in between. Not everyone will have the source code, unless you are going to make it so that only you and the host will have the source code.
In response to Theosco
Yes, there are, see below*. But you wanted to do this at runtime... you'd need a function like a library such as hub://LummoxJR.SwapMaps , to do it truly at runtime.

*: To do that, you'd need to do these things before you reboot, naturally:
1) Change your code, so your #include gets compiled now
2) Recompile your code, so the DMB is updated.
3) Reboot.

If you do all that properly, then it should work (projects can be compiled from DM code by running the command-line tool dm.exe from shell()). But that's not going to be truly at game runtime, as you probably realize.