help with scripting
8 posts • Page 1 of 1
help with scripting
I am trying to make a slot machine and can't get the scripting right. There are 3 wheels with 4 charactors on each. A laser is attached to each charactor on all 3 wheels and each laser is on a different collision layer (D,E,F,G) with matched targets outside the wheel. (confused yet?) What I am trying to get is to have a motor start but only if 3 matched (one on each wheel) targets are hit. I have attached the scene as I have it so far. If you can help me please be specific. I am just learning all this and I don't yet understand all the vocabulary. Thanks
Edit: If the "bucket" spawns out of control upon starting, pause the scene, hit the undo key. and delete the "bucket". That's a little bug I have not fixed yet.
Edit: If the "bucket" spawns out of control upon starting, pause the scene, hit the undo key. and delete the "bucket". That's a little bug I have not fixed yet.
- Attachments
-
slot machine help.phz- (292.73 KiB) Downloaded 48 times
- kbrtom
- Posts: 9
- Joined: Thu Mar 24, 2011 12:40 pm
Re: help with scripting
Can you please explain this in simpler terms? I have no idea what you are talking about.
Phundementalism?
Ain't nobody got thyme fo dat.
Ain't nobody got thyme fo dat.
-

mold999 - Posts: 225
- Joined: Sun Jan 02, 2011 1:35 am
- Location: [176436, 3763234]
Re: help with scripting
Yes, that and upload it on Algobox.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: help with scripting
Well, it's a slot machine. A button is pushed spinning 3 wheels. If all 3 wheels stop on the same charactor ( say, all cherrys), the machine pays off. If all 3 wheels do not match, nothing is payed out and the player spins again, I believe it would be an "if" statement, but I am not sure how to write it out. As far as downloading, the scene is applied to the attachment in my original message. Maybe someone could show me the proper way to write an "if" statement and I might be able to figure it out. A statement such as " if a box is collided with 3 times, then a motor will start", (or somethin similar). I have searched thru a lot of the tutorials, but I don't think I would know it if I saw it. Thanks for any help you can give.
- kbrtom
- Posts: 9
- Joined: Thu Mar 24, 2011 12:40 pm
Re: help with scripting
IF statement:
{condition} ? {true} : {false}
Ex: {variable1 > 3} ? {variable2=15} : {variable2=16}
{condition} ? {true} : {false}
Ex: {variable1 > 3} ? {variable2=15} : {variable2=16}
-

TC42 - Posts: 984
- Joined: Sun Jan 09, 2011 1:53 pm
- Location: $ sudo apt get-install sandwich_
Re: help with scripting
Thanks TC42, that is what I needed to see. I'm still trying to learn all this.
- kbrtom
- Posts: 9
- Joined: Thu Mar 24, 2011 12:40 pm
Re: help with scripting
TC42 wrote:IF statement:
{condition} ? {true} : {false}
Ex: {variable1 > 3} ? {variable2=15} : {variable2=16}
stop putting {} wherever you want
correct syntax a ? b : c means scene.my.a = a + b > c ? 0 : 1 is correct code and you don't need {}
{} is "procedure" type.
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: help with scripting
I find it easier to comprehend code that is in braces like TC42 demonstrated.
Thus, I always do it that way.
And if I can ever find a time to download the scene, I will try to fix it myself, mainly because you, kbrtom, make absoloutely no sense. Please break up your paragraphs like I'm doing.
Thus, I always do it that way.
And if I can ever find a time to download the scene, I will try to fix it myself, mainly because you, kbrtom, make absoloutely no sense. Please break up your paragraphs like I'm doing.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
8 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests




