Help with Wb3d_ButtonState

Blitz3D Forums/Blitz3D Programming/Help with Wb3d_ButtonState

How do you say if 1 button = another button?

Like If Wb3d_ButtonState(button1) = Wb3d_ButtonState(button2) then..

If Wb3d_ButtonState(button1) And Wb3d_ButtonState(button2)Then

Endif


No, I meant whats the exact command for this? Because this didnt work. I want to know how to cancel the 2nd button if the 1st button has been pressed.

Here's my code so far:

while not keyhit(1)

is_pressed(spacerock, waterfountain)
is_pressed(spacerock, waterfall)
is_pressed(spacerock, flamethrower)
is_pressed(spacerock, sparks)
is_pressed(spacerock, torch)
is_pressed(spacerock, smoke)
is_pressed(spacerock, rocks)
is_pressed(spacerock, smokeflares)
is_pressed(spacerock, explosion1)
is_pressed(spacerock, explosion2)
is_pressed(spacerock, sparkle)

is_pressed(waterfountain,spacerock)
is_pressed(waterfountain, waterfall)
is_pressed(waterfountain, flamethrower)
is_pressed(waterfountain, sparks)
is_pressed(waterfountain, torch)
is_pressed(waterfountain, smoke)
is_pressed(waterfountain, rocks)
is_pressed(waterfountain, smokeflares)
is_pressed(waterfountain, explosion1)
is_pressed(waterfountain, explosion2)
is_pressed(waterfountain, sparkle)

is_pressed(waterfall, spacerock)
is_pressed(waterfall, flamethrower)
is_pressed(waterfall, sparks)
is_pressed(waterfall, torch)
is_pressed(waterfall, smoke)
is_pressed(waterfall, rocks)
is_pressed(waterfall, smokeflares)
is_pressed(waterfall, explosion1)
is_pressed(waterfall, explosion2)
is_pressed(waterfall, sparkle)

is_pressed(flamethrower,spacerock)
is_pressed(flamethrower,waterfall)
is_pressed(flamethrower,waterfountain)
is_pressed(flamethrower,sparks)
is_pressed(flamethrower,torch)
is_pressed(flamethrower,smoke)
is_pressed(flamethrower,rocks)
is_pressed(flamethrower,smokeflares)
is_pressed(flamethrower,explosion1)
is_pressed(flamethrower,explosion2)
is_pressed(flamethrower,sparkle)

is_pressed(sparks, spacerock)
is_pressed(sparks, waterfountain)
is_pressed(sparks, waterfall)
is_pressed(sparks, flamethrower)
is_pressed(sparks, torch)
is_pressed(sparks, smoke)
is_pressed(sparks, rocks)
is_pressed(sparks, smokeflares)
is_pressed(sparks, explosion1)
is_pressed(sparks, explosion2)
is_pressed(sparks, sparkle)

is_pressed(torch, spacerock)
is_pressed(torch, waterfountain)
is_pressed(torch, waterfall)
is_pressed(torch, flamethrower)
is_pressed(torch, sparks)
is_pressed(torch, smoke)
is_pressed(torch, rocks)
is_pressed(torch, smokeflares)
is_pressed(torch, explosion1)
is_pressed(torch, explosion2)
is_pressed(torch, sparkle)

is_pressed(smoke, spacerock)
is_pressed(smoke, waterfountain)
is_pressed(smoke, waterfall)
is_pressed(smoke, flamethrower)
is_pressed(smoke, sparks)
is_pressed(smoke, torch)
is_pressed(smoke, rocks)
is_pressed(smoke, smokeflares)
is_pressed(smoke, explosion1)
is_pressed(smoke, explosion2)
is_pressed(smoke, sparkle)

is_pressed(rocks, spacerock)
is_pressed(rocks, waterfountain)
is_pressed(rocks, waterfall)
is_pressed(rocks, flamethrower)
is_pressed(rocks, sparks)
is_pressed(rocks, torch)
is_pressed(rocks, smoke)
is_pressed(rocks, smokeflares)
is_pressed(rocks, explosion1)
is_pressed(rocks, explosion2)
is_pressed(rocks, sparkle)

is_pressed(smokeflares, spacerock)
is_pressed(smokeflares, waterfountain)
is_pressed(smokeflares, waterfall)
is_pressed(smokeflares, flamethrower)
is_pressed(smokeflares, sparks)
is_pressed(smokeflares, torch)
is_pressed(smokeflares, smoke)
is_pressed(smokeflares, rocks)
is_pressed(smokeflares, explosion1)
is_pressed(smokeflares, explosion2)
is_pressed(smokeflares, sparkle)

is_pressed(explosion1, spacerock)
is_pressed(explosion1, waterfountain)
is_pressed(explosion1, waterfall)
is_pressed(explosion1, flamethrower)
is_pressed(explosion1, sparks)
is_pressed(explosion1, torch)
is_pressed(explosion1, smoke)
is_pressed(explosion1, rocks)
is_pressed(explosion1, smokeflares)
is_pressed(explosion1, explosion2)
is_pressed(explosion1, sparkle)

is_pressed(explosion2, spacerock)
is_pressed(explosion2, waterfountain)
is_pressed(explosion2, waterfall)
is_pressed(explosion2, flamethrower)
is_pressed(explosion2, sparks)
is_pressed(explosion2, torch)
is_pressed(explosion2, smoke)
is_pressed(explosion2, rocks)
is_pressed(explosion2, smokeflares)
is_pressed(explosion2, explosion1)
is_pressed(explosion2, sparkle)

is_pressed(sparkle, spacerock)
is_pressed(sparkle, waterfountain)
is_pressed(sparkle, waterfall)
is_pressed(sparkle, flamethrower)
is_pressed(sparkle, sparks)
is_pressed(sparkle, torch)
is_pressed(sparkle, smoke)
is_pressed(sparkle, rocks)
is_pressed(sparkle, smokeflares)
is_pressed(sparkle, explosion1)
is_pressed(sparkle, explosion2)

Function is_pressed(button, button2)

button3 = WB3D_ButtonState(button)
button4 = WB3D_ButtonState(button2)

If button3 = 1 And button4 = 1 Then button4 = 0 : WB3D_Notify "","You can't select 2 particles at once.",0
If button4 = 1 And button3 = 1 Then button3 =  0 : WB3D_Notify "","You can't select 2 particles at once.",0

End Function

updateworld
renderworld
flip
wend


Anyone?

You mean like radio buttons?

No. regular buttons. Wb3d_createbutton() is what i used.

can anyone else help? =/

Well, I have no experience with Wb3d but from youre code example, you are only setting a local variable of Button4 to 0, not the ACTUAL Buttonstate.

Of course I dunno what function would 'unpress the button, or set the state but the function should be something like this:
Function is_pressed(button1, button2)

	firstbutton = WB3D_ButtonState(button1)
	secondbutton = WB3D_ButtonState(button2)

	If ((firstbutton) And (secondbutton))
;		WB3D_SetButtonState(button2,False) ; There should be a function to Set the button state to False? or 'Unpress'? Not sure what this is
		WB3D_Notify "","You can't select 2 particles at once.",0
	EndIf

End Function