Page 1 of 2
Map loading trigger replaces original map?
Posted: May 9th, 2011, 11:41 am
by Rueppells-Fox
I thought I had it figured out, based on
viewtopic.php?f=15&t=2730. I upgraded to sandbox 2.6.1, and I was working with two maps (Game1map1 and Game1map2).
Using the in game config editor, I typed this code:
Code: Select all
level_trigger_2=[
echo "Teleporting..."
echo "Location found."
echo "Welcome home!"
sleep 5000
map Game1map2
I don't know what I'm supposed to do after I typed it, but I started playing around with the buttons and clicked 'exec'. Game1map1 promptly disappeared and was replaced with Game1map2. The problem is that no matter what I do, I can't make the first map reappear - Game1map2 loads when I open map1 from the starting screen.
Re: Map loading trigger replaces original map?
Posted: May 9th, 2011, 2:48 pm
by arcones
Are you saving the code and the map?
If you execute BEFORE saving the map, then it'll remove any work you did. You must save the map before executing.
Re: Map loading trigger replaces original map?
Posted: May 11th, 2011, 12:19 am
by Rueppells-Fox
I reviewed this:
viewtopic.php?f=15&t=2690&hilit=coding and used the exact same coding used in the example, but none of it worked (I did remove the <---- Bracket thing). Just to be sure, I made a new map (and saved it) and used ConTEXT to write the codes.
I saved the cfg file to have the exact same name as the map and saved it in the area with the other test files. The code currently looks like this:
Code: Select all
"on_start" = [
coin = 0
horse = 0
sword = 0
food = 0
]
"level_trigger_1" = [ coin = ( + $money 10000 )
echo "You got 5 moneys."
]
"level_trigger_2" = "showgui Shopkeeper"
newgui Shopkeeper [
guitext "What will it be today?" chat
guibar
guilist [
guibutton "Food: 10 coins" [
if ( > $coin 9 ) [
coin = ( - $coin 10 )
food = ( + $food 1 )
]
]
guibar
guibutton "Sword: 150 coins" [
if ( > $coin 149 ) [
coin = ( - $coin 150 )
sword = ( + $sword 1 )
]
]
guibar
guibutton "Horse: 7050 coins" [
if ( > $money 7049 ) [
money = ( - $money 7050 )
horse = ( + $horse 1 )
]
]
]
]
newgui Inventory
guibutton "Back" "cleargui 1"
guibar
guitext ( format "You have %1 coins in your wallet." $coin )
guitext ( format "You have %1 Food." $food )
guitext ( format "You have %1 swords." $sword )
guitext ( format "You have %1 horse." $horse )
]
newgui main [
guilist [
guilist [
guibutton "Inventory" "showgui Inventory"
]
]
guibar
@main
]
And I used the proper trigger levels to match with the code. I have no idea what's going on anymore. Is there something I'm doing horribly wrong in this process?
Re: Map loading trigger replaces original map?
Posted: May 11th, 2011, 8:55 am
by arcones
I have two questions then:
What mode are you using: RPG, FPS, etc.
What gamemode are you using: Run-around, coopedit, single player, banana relay, etc.
Re: Map loading trigger replaces original map?
Posted: May 12th, 2011, 12:39 pm
by Rueppells-Fox
I'm using FPS in coopedit
Re: Map loading trigger replaces original map?
Posted: May 12th, 2011, 1:00 pm
by arcones
Alrighty, that's your problem. You need to be in Single Player gamemode.
Re: Map loading trigger replaces original map?
Posted: May 13th, 2011, 10:44 pm
by Rueppells-Fox
With the coding test map, the inventory shows up in the main menu, but nothing else works (Sorry, I must be becoming a bit of a pain by now - I can only imagine how many millions of questions the support team receives daily).
Re: Map loading trigger replaces original map?
Posted: May 14th, 2011, 10:11 am
by arcones
Haha, that's fine
So you've got a mmodel in the game? An ogre or perhaps an RC as the shopkeeper? If so, his level trigger must be 2. Make sure you've got some sort of coin that is level trigger 1.
If you have the mmodel's in-game then you should be fine.
Re: Map loading trigger replaces original map?
Posted: May 14th, 2011, 10:09 pm
by kid matthew
Rueppells-Fox
There realy isnt alot of questions asked, We all learn from every post we make. =]
Cheers
Matthew
Re: Map loading trigger replaces original map?
Posted: May 15th, 2011, 1:24 pm
by arcones
True true. Although I get more PM's then one might think about Support
