Sign in to follow this  
Followers 0
Kickassjoe

Variable / GUI Help

9 posts in this topic

#1 ·  Posted (edited)

O.K. I have been working on this program for about a week now.

It is still in it's early stages, so please don't critisize, There is still much to be done!

Now, for my problem...

When I click the "Show Player Properties" or the "Show Computer Properties" the window comes up, but the properties aren't showing up. The window just sits there and is blank.

Download Here <-------- Download!

Download the file and run Board.au3 to see what I mean. (It is a game of monopoly by the way, or going to be soon)

EDIT: added DL link

Edited by Kickassjoe

What goes around comes around... Payback's a bitch.

Share this post


Link to post
Share on other sites



I added testing and got this to "show" ( player #1 only )

Func _ShowPropertyList($PlayerNum)
    
    For $i = 0 To 39
        $p1propertysearch[$i] = _ArraySearch($p1properties, 1, $i, $i + 1)
        $p2propertysearch[$i] = _ArraySearch($p2properties, 1, $i, $i + 1)
    Next
    
    $propertylistGUI = GUICreate("Player " & $PlayerNum & " Property List", 200, @DesktopHeight - 100)
    
    If $PlayerNum = 1 Then
        For $i = 0 To 39
            If $p1propertysearch[$i] <> - 1 Then
                $owned = $p1propertysearch[$i]
            Else
                $owned = 40
            EndIf
            GUICtrlCreateLabel($i & ". " & $owned, 10, $i * 30, 80, 20)
            ;GUICtrlCreateLabel($i & ". " & $space[$owned], 10, $i * 30, 80, 20)
        Next
        GUISetState()
        
        While 1
            $msg = GUIGetMsg()
            If $msg = $GUI_EVENT_CLOSE Then GUIDelete($propertylistGUI)
            Return 1
        WEnd

looks like a big under-taking...good luck with it!

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

seems to me that the error is in the _buy function, but I can't figure out where, and i have been looking forever!

EDIT: FOUND IT! I think that $Money isn't set right.

And I was right.

I fixed that, but now, when a label shows up, it shows up in the first place, and where it is supposed to be... I will upload a new version of the game if you want to help me.

EDIT: Uploaded New Version.

I think it is only with the railroad properties.

Edited by Kickassjoe

What goes around comes around... Payback's a bitch.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

seems to me that the error is in the _buy function, but I can't figure out where, and i have been looking forever!

EDIT: FOUND IT! I think that $Money isn't set right.

And I was right.

I fixed that, but now, when a label shows up, it shows up in the first place, and where it is supposed to be... I will upload a new version of the game if you want to help me.

EDIT: Uploaded New Version.

I think it is only with the railroad properties.

Would'nt it be nice, rather than have a property GUI for both players, to put a picture of the gamePiece of the player who bought a place on the blue carpet, on top of each bought places ?

Edited by tresa

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Wow... Never thought of that, and it's way easier now that I think about it. (after I make a UDF for placing them. (UGH))

And besides that, there is still a problem with my GUI's anyways.

Thanks much for the idea, and thank you Valuater for helping me help myself out so much. :whistle: Without you pointing that out, it would have taken me much longer. (even though I'm probably going to do what tresa suggested(I always end up doing something else that someone suggests right AFTER I fix the problem I had... rather annoying, really! -.-))

EDIT: I just realized that I could have just made a variable that I could have put in the GUI, that would just &= the name of the property bought, and an @CRLF... Again, after I had already fixed the problem I was having......

Edited by Kickassjoe

What goes around comes around... Payback's a bitch.

Share this post


Link to post
Share on other sites

Cool!!

cant wait to see it in action

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Wow... Never thought of that, and it's way easier now that I think about it. (after I make a UDF for placing them. (UGH))

With that, you may be able to inform of the change in the value

eg change color or size or border of the picture when the player has the whole set of a color set of places (which makes the price of renting higher).

For the railway stations it will be nice to do the same kind of thing (with the player picture or the engine picture) to show the higher cost of them the more railway stations the player has. Same with waterworks.

On the right side of the screen it would be nice to show several financial thermometers to show how many bucks the players have, the loans amount, the cumulative value of their real estate properties (for the total and mortgage possible value?). On a network version have the possibility to see other players situation or not via an option.

I have'nt thought yet for the auction play when a player has to sell some property. This would be interesting with a network version of monopoly

When the player move (also for the computer), make the picture move with a small speed with a noise (motor or sidewalks - best-or...), so that you can realise what's happening

Edited by tresa

Share this post


Link to post
Share on other sites

Good ideas you have there.

I will probably use most of them.

As for the sound, It will be kind of hard for me, seeing as how my sound card is messed up/ broken :whistle:

Maybe for selling of property... could just be 2 times what was paid for it? It seems unreasonable in the beginning, but later in the game I don't think it would be that unreasonable. Maybe 1.5 times the original price, or make it raise after a certain amount of turns?


What goes around comes around... Payback's a bitch.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Good ideas you have there.

I will probably use most of them.

As for the sound, It will be kind of hard for me, seeing as how my sound card is messed up/ broken :whistle:

Maybe for selling of property... could just be 2 times what was paid for it? It seems unreasonable in the beginning, but later in the game I don't think it would be that unreasonable. Maybe 1.5 times the original price, or make it raise after a certain amount of turns?

I was talking about the real monopoly rules !

A few suggestions

In your Board.au3 I would have put the

_choosegamepieces() outside the main loop as it is an init task.

I would make a kind of Monopoly.au3 with the main program, like

_initBoard()

_choosegamepieces()

while 1

.....

wend

For the places on the board I would make a two dimension array with first dimension of 40 (number of spaces) and the second dimension to put

left coordinate of space

top

right

bottom

xPos of Owner >>> the pos of the picture on the blue board

yPos of Owner

xPos of player 1 >>> where to put the player after dicing

yPos of plater 1

....

xPos of player 4 >>> if 4 is the max number of players

yPos of plater 4

price to buy

price of house

price of hotel

number of houses >>> (if 4 is max num then 5 is hotel)

actionFuncName >>> if a special action is to be done when arriving (buyOrPayRent,chance, tax, ...)

mortgageDone

then write funcs to calculate the entries in the second dimension that relies on the left top right bottom coordinates (they vary/side on the board)

do funcs to set the other values and to get them

Edited by tresa

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0