Create a Dice Game with random trigger Created 8 years ago2016-04-10 01:58:47 UTC by keevlicious keevlicious

Created 8 years ago2016-04-10 01:58:47 UTC by keevlicious keevlicious

Posted 8 years ago2016-04-10 01:58:47 UTC Post #329749
Hey,

I want to create a dice game on my CS:GO map. So when someone press a button, a random texture will appear. I got dice textures from 1-6. Everytime when i press it, it should appear a random texture.

How can i make it? I already made 6 texture and each texture has the entity "func_wall_toggle" but i can only make the button to appear on texture and not random... What can i do?
Posted 8 years ago2016-04-10 09:05:17 UTC Post #329756
func_button
OnPressed -> random -> PickRandom

logic_case - random
OnCaseX -> diceX -> Enable
OnCaseX -> diceY -> Disable

func_wall_toggle - diceX
Posted 8 years ago2016-04-10 09:25:55 UTC Post #329759
func_wall_toggle is obsolete in Source. It can only be toggled and have minimal settings. Instead, you should use func_brush entities wich can be individually enabled and disabled instead of only toggled, and also have more options such as wether or not to cast shadows or be solid.
Dr. Orange Dr. OrangeSource good.
Posted 8 years ago2016-04-10 13:24:02 UTC Post #329764
So i created 6 textures. All has func_wall_toggle, input is "Start invisible". I set logic_case and named it "random". On Input at the logic_case I did logic_case - random. But I cant choose at "Via this Input" Enable or Disable...
Posted 8 years ago2016-04-10 13:51:13 UTC Post #329766
Okey, I got it to work. But now the texture wont dissapear... I press a button, and a random texture appear. But it has to dissapear after like 5 seconds.
Posted 8 years ago2016-04-11 11:44:10 UTC Post #329815
Whatever output you made to toggle the wall, duplicate it and add a 5s delay.

You can choose to ignore below - this is another possible solution.
You can use the func_brush entity. Give them all a "texture" render mode of 0. Then instead of just toggling the faces you can manually hide or show them.

When you want to show the die faces, send the "alpha" command of 255.
When you want to hide the die faces, send the "alpha" command of 0.

Then after each button press, you randomly show one, but then hide all after 5s delay:

On press > func_wall_toggle_1 > alpha > 0 > Delay: 5s
On press > func_wall_toggle_2 > alpha > 0 > Delay: 5s
On press > func_wall_toggle_3 > alpha > 0 > Delay: 5s
On press > func_wall_toggle_4 > alpha > 0 > Delay: 5s
On press > func_wall_toggle_5 > alpha > 0 > Delay: 5s
On press > func_wall_toggle_6 > alpha > 0 > Delay: 5s
Tetsu0 Tetsu0Positive Chaos
Posted 8 years ago2016-04-12 02:34:08 UTC Post #329849
I made it to work. Thanks dudes. I just made logic_case, add output to the case01, case02 etc. from the button and "PickRandom" as input. Works. :) Ofc with func_wall_toggle. Best solution. There are many solutions.
Posted 8 years ago2016-04-12 07:16:51 UTC Post #329856
Sorry buddy, func_wall_toggle is not the best solution, func_brush is :)
PeterBrev PeterBrevLevel Designer
Posted 8 years ago2016-04-12 09:37:48 UTC Post #329858
The best solution is the one that works
Tetsu0 Tetsu0Positive Chaos
Posted 8 years ago2016-04-12 11:54:35 UTC Post #329860
The best solution is the one that works
And optimized ^^
Posted 8 years ago2016-04-13 15:56:28 UTC Post #329885
mh, I think if I use func_brush i cannot make it "Start invisible". With func_wall_toggle i can make it "Start invisible" so they just appear when i press the button with toggle. It works already so I wont change it i think.
You must be logged in to post a response.