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 :(
  • Jonny-higgins avatar
    Jonny-higgins username pic Joined 15y ago
    Former Admin Ripe Supporter
    DRUNK...
    204,609 points Ranked 15th
    43 medals 5 legendary 10 rare
    • Achieved Admin clearance Medal icon
    • Submitted 200 Threads Medal icon
    • Reached 100 subscribers Medal icon
    • 10 years a member Medal icon
    • Became a Ripe Supporter Medal icon
    • Reached 75,000 Points Medal icon
    Jonny-higgins avatar
    Jonny-higgins
    Former Admin
    7y
    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!).
    URL to post:
  • kinggambit avatar
    kinggambit Joined 9y ago
    Offline
    7y
    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
    Ph.D. in Bananaolgy
    URL to post:
  • Emnu avatar
    Emnu Joined 13y ago
    Offline
    13,625 points Ranked 564th
    31 medals 2 legendary 6 rare
    • Returned 5000 times Medal icon
    • 10 years a member Medal icon
    • 6 years a member Medal icon
    • Returned 1000 times Medal icon
    • Submitted 20 Maps Medal icon
    • Submitted 15 Mods Medal icon
    7y
    "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?
     avatar
    URL to post:
  • Devieus avatar
    Devieus username pic Joined 11y ago
    Moderator
    111,061 points Ranked 27th
    79 medals 8 legendary 17 rare
    • 1st Place - Tutorial Contest Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2015 Medal icon
    • Returned 5000 times Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
    • 2017 Top Contributor Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2017 Medal icon
    7y
    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%.
    • Helpful x 1
    • Thanks x 1
    Sentinel of the TV remote avatar
    Mantra
    Sentinel of the TV remote
    URL to post:
  • kinggambit avatar
    kinggambit Joined 9y ago
    Offline
    7y
    > **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.
    Ph.D. in Bananaolgy
    URL to post: