emtneutrino / races

BSD 3-Clause "New" or "Revised" License
13 stars 12 forks source link

Random cars in random races repeating. #9

Closed raix28 closed 7 months ago

raix28 commented 1 year ago

Is it possible to make random races that if you get a Asterope for exmaple, you cant get it again in the same race? Thanks!

raix28 commented 1 year ago

Basically you shouldnt get the same car in one race twice

emtneutrino commented 1 year ago

I didn't make the restriction that you would have a different vehicle every lap. If that was the case, for example in an 8 lap race, you would need at least 8 different vehicles in the vehicle list. I made it so each vehicle in the list had an equal chance of being selected each lap. If you had an 8 lap race and only 3 vehicles in the list, you would be in the same vehicle on some of the laps. I'm not inclined to add that restriction. It makes things a bit more complicated.

raix28 commented 1 year ago

h

ah man, the script is so great though, using it alot. Its the only request/wish i have basically. There is basically no other random racing script. I also added alot of addon cars and i have like over 700 vehicles in the last and in 20 laps still sometimes me or my friends get the same vehicle 2 or even 3 times. I wish you did that but if it makes stuff complicated then i guess i have to live with that! Thanks for the response!

emtneutrino commented 1 year ago

I'll think about / experiment making it an option for random races depending on the complexity.

raix28 commented 1 year ago

i greatly appreciate that you will at least think about that !

raix28 commented 1 year ago

You can also update me on this here about progress, forgot to mention!

raix28 commented 10 months ago

@emtneutrino are you completly done with this script or plan to add new features?

emtneutrino commented 10 months ago

I am planning to add the option for vehicles not to repeat appearing in later laps for random vehicle races. I will also try to add an option where everyone uses the same random vehicle for each lap in random vehicle races (e.g. 1st lap everyone uses adder, 2nd lap everyone uses elegy, etc.) I just haven't gotten around to finding the time to do this. I've already done some unrelated clean up to the code. I can't guarantee when I'll be able to get around to doing all of this though, but I am planning to work on it.

raix28 commented 10 months ago

okay nice thanks for the update

raix28 commented 9 months ago

Like cant you make a database that tracks what cars a player has gotten so that player doesnt get that car again ? Or is that too complicated?

raix28 commented 9 months ago

Or make that every player has a predetermined pool of cars before race starts. Like creates random cars for every racer so they are predetermined. Every player has their own list basically that they get during the race

emtneutrino commented 7 months ago

The "recur" parameter value may be 'yes' or 'no'. If it is 'yes', then vehicles that appeared in previous laps may be used in later laps. If it is 'no', then vehicles that appeared in previous laps will not be used in later laps. If you specify 'no', then the number of vehicles in the vehicle list must be at least one less than the number of laps in the race. If there are multiple vehicles of the same model in the vehicle list, it may be used as many times as it appears in the vehicle list. If you don't want the same model to appear multiple times, then make sure only one vehicle of that model is in the vehicle list. The default behavior is that vehicles that appeared in previous laps may be used in later laps.