Ads keep us online. Without them, we wouldn't exist. We don't have
paywalls or sell mods - we never will. But every month we have large bills
and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3
Weighted random logic help?
- A Forum Thread for Counter-Strike: Global Offensive
I'm trying to essentially have 1 of 2 outputs chosen randomly to fire (but it's weighted in favor of one output i.e. 80% to 20%).
Here's my logic entities:
![http://i.imgur.com/WFme8F5.jpg](http://i.imgur.com/WFme8F5.jpg "http://i.imgur.com/WFme8F5.jpg")
Now, with that set up, the logic_branch will work, but the relay doesn't seem to (it seems the toggle works as the relay is fired but no doors open).
Anyone know what I'm doing wrong?
EDIT:
I tried replacing the logic_relay with another logic_case to no avail and various tests. Seems like it's the random output entity that's the issue. I still have no idea what it is.
I'm considering just nesting a bunch of logic_case's (i.e. 1 case -> 2 cases -> 4 cases -> 8 cases (so I have 16 total outcomes and I can just make 15 fire to the original logic_case and 1 outcome fire to the relay).
Obviously this is an inefficient and time consuming alternative though :(
Can you tell us the entity names you've set up? It's not 100% clear what's going on from that image. (Though it has been several years since I touched logic entities!).
the names for logic_spawn_door and logic_branchj are on the top of the dialog box. I don't think it's a naming issue since there's no red text (I dont have much experience with logic_random _outputs and logic_branch and I suspect it's something to do with that)
Logic_relay name: **relay_door**
Output for it is OnTrigger DoorB Open
logic_case name: **case_door**
Output for it is OnTrigger DoorB Open
"I'm considering just nesting a bunch of logic_case's (i.e. 1 case -> 2 cases -> 4 cases -> 8 cases (so I have 16 total outcomes and I can just make 15 fire to the original logic_case and 1 outcome fire to the relay)."
I'd do this, it's not that time consuming and who really cares if it's a bit inefficient?
A `logic_case` would work, you'll only need one and you're only going to need 5 cases, because 20% is 1/5.
As for the use of `logic_random_outputs`, don't use a probability of 1, that's automatically 100%.
> **Posted by Devieus**
>
> A `logic_case` would work, you'll only need one and you're only going to need 5 cases, because 20% is 1/5.
>
> As for the use of `logic_random_outputs`, don't use a probability of 1, that's automatically 100%.
Yup, that's a nice workaround! I'm constrained to 16 cases and I have to calculate out the fractions, but it did the trick.
My assumption was that on trigger, the random outputs entity fires both Trigger1 (i.e. .2 for 20%) and Trigger2 (i.e. 1 for 100%); Trigger1 would set the branch true/false while Trigger2 would test the logic_branch to actually fire the output for it.
I did some more testing and while I havent figured it out completely, it's definitely the logic_random_outputs that had some issue triggering its outputs.