Jump to content

Recommended Posts

Posted

How about in real 3D? I'm skinning the machine chassis and the arm, the wheels already spin when you click on the arm.

Script, models, downloads, etc, later today. ^_^

Posted (edited)

Download the spinning 3D slot machine (with no game yet, I'm still working out how to get that part.)

Click on the handle to make the wheels spin. ^_^

Esc, Q, q quits out. There seems to be some sort of odd bug causing a crash on certain clicks.

GUIGetCursorInfo() Causing a crash for click testing. I'm looking for a different method now. Just don't do a bunch of random clicking and it will display nicely, though. lol...

Edited by JRowe
Posted

That's pretty cool, neat effect. Yours looks more like the "older" one arm bandit, WideBoys looks more like a "modern" digital style.

The arm looks awesome when it bounces and snaps back into position, but it doesn't need to spin ( looks a little cheesy)

cool guys!!

8)

NEWHeader1.png

Posted

Thanks!

Lol, I thought the arm spinning was kinda neat. The snap-back was an unintended result, turned out well though. ^_^

Anyway, here's the fixed machine.au3 :

CODE

#include <GUIConstants.au3>

#include <Constants.au3>

#include <WindowsConstants.au3>

#include <WINAPI.au3>

#include "IrrlichtPluginUtils.au3"

#Include <Misc.au3>

Opt("MouseCoordMode", 2)

HotKeySet("{ESC}", "Terminate")

HotKeySet("{Q}", "Terminate")

HotKeySet("{q}", "Terminate")

#Region - GUI Create

$gui = GUICreate("One Armed Bandit", 1024, 768, -1, -1, -1, $WS_EX_LAYERED)

GUISetBkColor(0xABCDEF)

_WinAPI_SetLayeredWindowAttributes($gui, 0x010101)

CreateDeviceOnWindow( $gui, $EDT_BURNINGSVIDEO, 10, 10, 1024, 768, 32, 0, 0 )

GUISetState()

WinSetOnTop("One Armed Bandit", "", 1)

Global $Reel[4]

Global $Pot = IniRead("SlotWinnings.ini", "Pot", "Pot", "1000")

Global $BackGround = 0xD8A308

Global $WhiteColor = 0xFFFFFF

Global $MAXBET = 10

$Points = ""

$Bet = 0

$Credits = $Pot

$Wheel1IsTurning = 0

$Wheel2IsTurning = 0

$Wheel3IsTurning = 0

;Getting meshs

$MachineMesh = GetMesh( "Machine.obj" )

$ArmMesh = GetMesh( "Arm.obj" )

$WheelMesh = GetMesh( "Wheel2.obj")

$Machine = AddMeshSceneNode( $MachineMesh )

$Arm = AddMeshSceneNode( $ArmMesh )

SetPosition($Arm, 0, 0, 4)

SetRotation( $Arm, 0, 90, 0 )

$Wheel1 = AddMeshSceneNode( $WheelMesh )

SetScale( $Wheel1, .73, .73, .73 )

SetPosition($Wheel1, 0, 0, -2.4)

SetRotation( $Wheel1, 0, 90, 0 )

$Wheel2 = AddMeshSceneNode( $WheelMesh )

SetScale( $Wheel2, .73, .73, .73 )

SetPosition($Wheel2, 0, 0, -.10)

SetRotation( $Wheel2, 0, 90, 0 )

$Wheel3 = AddMeshSceneNode( $WheelMesh )

SetScale( $Wheel3, .73, .73, .73 )

SetPosition($Wheel3, 0, 0, 2.3)

SetRotation( $Wheel3, 0, 90, 0 )

SetPosition($Machine, 0, -12, 0)

SetRotation( $Machine, 0, 90, 0 )

$Camera = AddCameraSceneNode( 0, 20, 0, 0, 0, 0, 0 )

SetMaterialFlag( $Wheel1, $EMF_LIGHTING, 0 )

SetMaterialFlag( $Wheel2, $EMF_LIGHTING, 0 )

SetMaterialFlag( $Wheel3, $EMF_LIGHTING, 0 )

SetMaterialFlag( $Machine, $EMF_LIGHTING, 0)

SetMaterialFlag( $Arm, $EMF_LIGHTING, 0 )

#Region - GUI SelectLoop

GUISetStyle($WS_POPUP, -1, $gui)

_WinAPI_SetLayeredWindowAttributes($gui, 0xABCDEF, 255)

$Y = 0

$ArmRotation = 0

$Rotations1 = 0

$Rotations2 = 0

$Rotations3 = 0

$WheelsTurning = 0

$Wheel1Rate = 24

$Wheel2Rate = 24

$Wheel3Rate = 24

While IrrRun( )

$Y = $Y + 1

If $Y >15 Then $Y = 0

If $Wheel1IsTurning = 1 Then

$WheelsTurning = 1

EndIf

If $Wheel2IsTurning = 1 Then

$WheelsTurning = 1

EndIf

If $Wheel2IsTurning = 1 Then

$WheelsTurning = 1

EndIf

$mousePos = MouseGetPos()

If GetSceneNodeFromScreenCoordinatesBB( $mousePos[0], $mousePos[1]) = $Arm Then

If _IsPressed("01") And $WheelsTurning = 0 Then

;MsgBox(0,"Woot", "Worked")

ArmPulled()

EndIf

EndIf

If $Wheel1IsTurning = 1 Then

SetRotation( $Wheel1, 0, 90, -$Wheel1Rate*$Rotations1 )

EndIf

If $Wheel2IsTurning = 1 Then

SetRotation( $Wheel2, 0, 90, -$Wheel2Rate*$Rotations2 )

EndIf

If $Wheel3IsTurning = 1 Then

SetRotation( $Wheel3, 0, 90, -$Wheel3Rate*$Rotations3 )

EndIf

SetRotation( $Arm, 0, 90, -$Y*$ArmRotation )

BeginScene( true, true, 0, 171, 205, 239 )

SceneDraw( )

GuiDraw( )

EndScene( )

Sleep(10)

If $Rotations1 > 1 Then $Wheel1IsTurning = 1

If $Rotations2 > 1 Then $Wheel2IsTurning = 1

If $Rotations3 > 1 Then $Wheel3IsTurning = 1

If $Rotations1 > 1 Then $Rotations1 = $Rotations1 - 1

If $Rotations2 > 1 Then $Rotations2 = $Rotations2 - 1

If $Rotations3 > 1 Then $Rotations3 = $Rotations3 - 1

If $Rotations1 <= 1 Then $Wheel1IsTurning = 0

If $Rotations2 <= 1 Then $Wheel2IsTurning = 0

If $Rotations3 <= 1 Then $Wheel3IsTurning = 0

If $Wheel1IsTurning = 0 And $Wheel2IsTurning = 0 And $Wheel3IsTurning = 0 Then

$WheelsTurning = 0

EndIf

$ArmRotation = $ArmRotation - 1

If $ArmRotation <= 0 Then $ArmRotation = 0

WEnd

Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)

If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03

If Not $isColorRef Then

$i_transcolor = Hex(String($i_transcolor), 6)

$i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))

EndIf

Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)

Select

Case @error

Return SetError(@error, 0, 0)

Case $Ret[0] = 0

Return SetError(4, _WinAPI_GetLastError(), 0)

Case Else

Return 1

EndSelect

EndFunc;==>_WinAPI_SetLayeredWindowAttributes

Func ArmPulled()

If $Rotations1 <= 1 Then

$Rotations1 = Random(10,200,1)

EndIf

If $Rotations2 <= 1 Then

$Rotations2 = Random(10,200,1)

EndIf

If $Rotations3 <= 1 Then

$Rotations3 = Random(10,200,1)

EndIf

$ArmRotation = 90

EndFunc

Func Terminate()

IniWrite("SlotWinnings.ini", "Pot", "Pot", $Credits)

Exit 0

EndFunc

No more crashing. All that's here is basic spin tests and a randomly timed spin function. There are 15 separate "slots" on each wheel, 3 each of the 7, cherry, bar, 2bar, and 3bar.

Posted

OK, WOW! That is cool! I am sleepy tho and did not see in your code, how/where are you controlling the speed of the reels. they spin a little long for me.. LOL

Posted

I'd really like to take a look at this but I can't because the reels don't display *at all* for me ^_^

WBD

Posted (edited)

for some reason, that happened to someone else. i think i did something wrong with the new script. i need to look at it thoroughly.

and for some reason, i can see the reels... WEIRD

Edited by billthecreator

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Posted

Ok. problem fixed.

If you dont have the new font, it will install it for you.

And the problem that the reels weren't showing is fixed.

No reels here but that could be because bmp's not included in download.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Posted

I now have reels but are there supposed to be blanks on the reels.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Posted (edited)

I now have reels but are there supposed to be blanks on the reels.

i put a lost file extractor on there. try using that to get the files. if that doesnt work. delete all the files from the directories, and run it again. maybe that will work..

EDIT:

I think i miss-read your post. are you asking if there are supposed to be blanks, or aren't there supposed to be blank, (like they're not there, and they should be)?

Edited by billthecreator

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

  • 2 weeks later...
  • 1 month later...
Posted

hmm i´m getting this error:

line 404 (file "...\slotmachine\include\bass.au3" )

return seterror(0 "" , $bass_ret_[0])

return seterror(0 "" , $bass_ret_ÊRROR

error: subscript used with non-array variable

whats the problem? :D

Posted

hmm i´m getting this error:

line 404 (file "...\slotmachine\include\bass.au3" )

return seterror(0 "" , $bass_ret_[0])

return seterror(0 "" , $bass_ret_ÊRROR

error: subscript used with non-array variable

whats the problem? :D

I have no idea.

ill take a look....

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...