you don't have to use the method of the 'ifused' but if you have them there in the level somewhere it will let the GG standalone process pick them up automatically - rather than you having to do it.
i.e. even putting the level names in the ifused field of static entities with no script etc will still make GG create the standalone include those maps.
for the actual script you can do it either way,
1 way is like belidos said and involves a bunch of zones/entities and a variable for each to tell them if they should jumptoifused or not - this method works well with the default way GG handles the inclusion of other levels as you will already be inputting the level names in them anyway so a script on each is just a little extra.
so something like this
properties of entity 1;
name = level1
ifused = level1.fpm (note not sure if you need the .fpm or not, been ages since i made a multilevel standalone)
properties of entity 2;
name = level2
ifused = level2.fpm
etc for all levels needed
now for the script they have will look something like this (untested but should work and 1 script should fit all - just name them the same as in the selection script, i would name them like level1, level2 (as i have for this example) or with appropriate titles based on the map etc)
local level_name = ""
level_selected = 0
function level_choice_init_name(e,name)
level_name = name
end
function level_choice_main(e)
if level_selected == level_name then
JumpToLevelIfUsed(e)
Destroy(e)
end
end
now you just need a script to select the level (which is probably very similar to what you already have).
note i wont write a full working script but the basic idea is -
this code would assume all buttons have already been created and are in a column down the center of the screen (if it doesnt work)
function level_selector_main(e)
ActivateMouse()
TextCenterOnX(50,13,3,"Level 1")
TextCenterOnX(50,23,3,"Level 2")
if g_MouseClick == 1 then
if g_MouseX >= 40 and g_MouseX <= 60 then
if g_MouseY >= 10 and g_MouseY <= 15 then
level_selected = "level1" --name as same in entity properties from entity with level1.fpm in ifused
elseif g_MouseY >= 20 and g_MouseY <= 25 then
level_selected = "level2" --name from 2nd entity with ifused property
end
end
end
end
the 2nd option (which i think is what you currently have) is very similar to just the last code snippet but you just call the level directly from there and don't need the first script (but you do need to manually make all your standalones or do the trick we mentioned earlier)
i.e.
function level_selector_main(e)
ActivateMouse()
TextCenterOnX(50,13,3,"Level 1")
TextCenterOnX(50,23,3,"Level 2")
if g_MouseClick == 1 then
if g_MouseX >= 40 and g_MouseX <= 60 then
if g_MouseY >= 10 and g_MouseY <= 15 then
JumpToLevel("level1")
elseif g_MouseY >= 20 and g_MouseY <= 25 then
JumpToLevel("level2")
end
end
end
end
code written quickly and untested so forgive any mistakes but i hope you get the idea.
edit, forgot you also need to activate the mouse