Page 1 of 2

Coding Help

Posted: July 1st, 2010, 6:47 pm
by PizzaLover101
I am making a map about a dance club type thing
I was trying to make a window appear asking if you were on the admin list and this is what I got:

Code: Select all

level_trigger_1 = [showgui diolouge1; echo "Are you on the guest list?"]

newgui diolouge1[
guitext "If your not please leave and go to the front desk and pay the $100 fee." Chat
guitext "If you are that please enjoy this place and the dance floor above."]

Re: Coding Help

Posted: July 1st, 2010, 8:08 pm
by AName
Looks pretty good... three things:
1. You seemingly accidentally left out chat after the second quote - just pointing that out.
2. You need a mapmodel that will trigger this... In edit mode, press F1 to pull up a list of mapmodels. Place one that you want (press Z in edit mode to undo or Delete to kill it and try another model).
3. Press the period button on your keyboard. This will give you the preset coding for the currently selected model. The first two numbers are Yaw (rotation) and the Model # - don't change them. The third number is the trigger type - you probably want 5. The fourth number is the trigger number - in this case (because of your coding) it should be 1. This should be of great help: http://sandboxgamemaker.com/platinumart ... _mapmodel_.

Also, I figure since you have the code typed up you already knew this, but just in case: enter your coding by pressing F6 in edit mode - Make sure you save and execute when done.

Re: Coding Help

Posted: July 1st, 2010, 8:10 pm
by PizzaLover101
ok, thank you

edit: That didn't help, a message poped up in the top left corner, but nothing popped up

Re: Coding Help

Posted: July 2nd, 2010, 11:58 am
by arcones
I have to disagree with AName the F6 config editor. If you do that it won't register when you publish the map. It's best to do an out-game config file that you type the code into. I'd recommend using copying a map-art.cfg and renaming it to your map's name.

I'm gonna try and rewrite it all for you.

Code: Select all

level_trigger_1 = [showgui diolouge1; echo "Are you on the guest list?"]

newgui diolouge1[
guitext "If your not please leave and go to the front desk and pay the $100 fee." Chat
guitext "If you are that please enjoy this place and the dance floor above."]
This is what you have...

Code: Select all

"level_trigger_1" = showgui diolouge1; echo "Are you on the list?" 
newgui diolouge1 [
guitext "If you're not please leave and go to the front desk and pay the $100 fee." chat
guitext "If you are, please enjoy this place and the dance floor above." chat
guibutton "Alright." "cleargui"
] "Bouncer"
or if that doesn't work, try this:

Code: Select all

"level_trigger_1" = showgui diolouge1 
newgui diolouge1 [
guitext "Are you on the list?" chat
guitext "If you're not please leave and go to the front desk and pay the $100 fee." chat
guitext "If you are, please enjoy this place and the dance floor above." chat
guibutton "Alright." "cleargui"
] "Bouncer"

Re: Coding Help

Posted: July 2nd, 2010, 12:04 pm
by Leo_V117
You didnt format it correctly...
And I may as well make it better for you.

Code: Select all

cash = 200
admition = 0
admitonfee = 100

level_trigger_1 = [if (= $admition 1) [echo "Come on in!"; showgui dialogue1] [else (= $admition 0) [echo "Youre not on the Guest List!"; echo "Go pay the $100 Admiton fee and come back"]]]

level_trigger_2 = [if (= $admition 1) [echo "Youve already payed the admition fee"] [else (= $admition 0) [echo "Would you like admition to the Club?"; echo "Its $100"; showgui admition]]]

newgui dialogue1 [
   guitext "You Payed the admition fee" chat
   guitext "Before you go, please sign here" chat
   guilist [
      guitext "Signature:"
      guifield signature 20
      ]
   guibar
   guibutton (format "Set Signature as %1?" $signature)   [$name = $signature; cleargui; echo "Thanks"]
   ]
]

newgui admition [
   guitext (format "Your cash: $%1" $cash)
   guitext (format "Admition Fee: $%1" $admitionfee)
   guibar
   guitext "Would you like to pay the admition fee?"
   guilist [
      guibutton "Yes"   [if (< $cash 101) [admition = 1; cash = (- $cash $admitionfee); echo "You payed $100 for admition!"; echo "Thank You!"]]
      guibutton "No"   [cleargui; echo "Okay, See you!"]
      ]
   ]
]
That should fix it...

@arcones We replied at the same time... Mines more technical...

Re: Coding Help

Posted: July 2nd, 2010, 1:23 pm
by arcones
I find that hilarious :D

Re: Coding Help

Posted: July 2nd, 2010, 2:23 pm
by AName
I have to disagree with AName the F6 config editor. If you do that it won't register when you publish the map. It's best to do an out-game config file that you type the code into. I'd recommend using copying a map-art.cfg and renaming it to your map's name.
How are we supposed to know these things without you telling us first...? Also, what good is it to be ready to publish the map if you can't find a single tutorial anywhere explaining how to export your game as an exe?

Re: Coding Help

Posted: July 2nd, 2010, 5:44 pm
by PizzaLover101
Ummmmmm.......... Idk if i did something wrong, but noone's worked, but i did something else to work. If I want music in my game, how do i make it so that the selection is random?

Re: Coding Help

Posted: July 3rd, 2010, 2:06 am
by siimvuss
AName wrote:
I have to disagree with AName the F6 config editor. If you do that it won't register when you publish the map. It's best to do an out-game config file that you type the code into. I'd recommend using copying a map-art.cfg and renaming it to your map's name.
How are we supposed to know these things without you telling us first...? Also, what good is it to be ready to publish the map if you can't find a single tutorial anywhere explaining how to export your game as an exe?
The thing is: Tutorials are always made by the users of the program. But if all users want to have tutorials and are not willing to make them themselves then who will make them? Think about it before you start complaining.

Re: Coding Help

Posted: July 3rd, 2010, 8:18 am
by AName
The thing is: Tutorials are always made by the users of the program.
Let me rephrase this to have the same meaning but be more clear:
The thing is: Tutorials are only made by the users of the program.

...and that's exactly why this is not how it's supposed to work, especially when it comes to any sort of complex work like coding.

But if all users want to have tutorials and are not willing to make them themselves then who will make them? Think about it before you start complaining.
If none of the users have any knowledge of how to do something, what can anyone do besides complain? If the makers really want the users to use their program to its fully capabilities, they need to pass on the information - it really is as simple as that. I know nobody likes complaining, but I have come to the point where I now have to stop working on my game and wait for replies on how to do something (that "supposedly" is possible - e.g. making your game into an executable), but it seems like nobody can do it in the first place because the information isn't provided publicly anywhere.