How to make a drafting mechanism?

hman360hman360 Member Posts: 590
edited November -1 in Working with GS (Mac)
How can I make the computer generated teams choose a player that it needs (field position) and get the best player that it needs?

So lets say in needs a 1st basemen and 3rd Basemen,
So the list says:
1st basemen - Albert Pujols 99 overall
2nd basemen - Dan Uggla 92 overall
3rd basemen - Edwin Encarnation 86 overall
1st basemen - Ryan Howard 95 overall

(The above are real mlb examples) How will I get it to automatically choose the best overall player that it needs? So in this case that would be Albert Pujols. And then for its next pick, choose only the position it needs (3rd base) so Edwin? How can I do this?

Also, is there a way to remove the names of the players taken and move all of the rest of the players below it up a space? - If not, I will change the alpha and make it inselectable (if thats a word)

Thanks

Comments

  • zombieaddictzombieaddict Member Posts: 213
    not sure on this without testing. but try having global integer attributes for

    1stbasemen
    2ndbasemen
    3rdbasemen

    have 0 for its off state and 1 for its on state

    also have a global attribute for the players

    Albert Pujols
    Ryan Howard

    same as above have 0 for its offstate and 1 for its on state

    have another 2 global integer attributes for

    AlbertpujolsOverall
    RyanhowardOverall

    in both of those players put self attributes for *overall*

    rule if 1basemen = 0 (this will tell gs to see if a 1st basemen has been chosen or not)

    and

    Albert Pujols = 0
    Ryan Howard = 0
    (this will tell gs to check who is available for selecting)

    have another rule inside that saying

    AlbertpujolsOverall > RyanhowardOverall

    then change attribute Albert Pujols to 1

    and change attribute 1stbasemen to 1

    have another rule saying the opposite

    RyanhowardOverall > AlbertpujolsOverall

    then change attribute Ryan Howard to 1

    and change attribute 1stbasemen to 1

    also make sure that the AlbertpujolsOverall and RyanhowardOverall attributes are either costrained to the internal *overall* attributes of the corresponding players or make sure to have it update regularly

    so inside the ryanhoward actor you could have

    constrain attribute game.ryanhowardoverall to self.overall

    think that should work.
  • zombieaddictzombieaddict Member Posts: 213
    for the 3rd basemen you could just do

    if 3rdbasemen = 0

    and Edwin Encarnation = 0

    change attribute Edwin Encarnation to 1

    change attribute 3rdbasemen to 1
  • zombieaddictzombieaddict Member Posts: 213
    and for the last part you could have collision rules on all the names of the players. have it so they're all constantly trying to move up but will stop when colliding with the actor above it. when that actor is no longer available either move the name offscreen or destroy the actor so the names below it move up.

    also make sure to have another actor (maybe invisible) that blocks the names from actually fully flying off the screen
  • hman360hman360 Member Posts: 590
    Thanks!
Sign In or Register to comment.