NEED HELP with - Chance of hit and miss

ForcingForcing Member Posts: 93
edited November -1 in Working with GS (Mac)
Hello community, i need help at
How to make a per centual actor,

example: i want to attack someone, i use a attack called for example kick
i want to make the attack (kick) so, that i have a chance of 83 % to hit him and 17% to miss

i know already one method how to make that, but its to sh*tty and it´s not per centual and very ressource-eater!

i would be very thankfull!

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    on the actor you want to initiate kick

    add an attribute (integer type) called Random (or whatever)

    Rule when
    Actor receives event [ touch ] is [ pressed ]
    --changeAttribute ... self.Random To: [ random(1,100) ]
    ----Rule when
    ----Attribute [ self.Random] > [ 17 ]
    ----do the hit sequence

    as 17% is not a large number of choices...it might help to view random#
    add another actor on scene to Display Text... of the kicker's Random Attribute
    (make an actor...drag on to screen ...click on that instance... unlock ... add Display Text and replace "Hello World!" with the expression >Current scene>layers>whatever layer the kicker is on > kicker>Random)

    MH
  • ForcingForcing Member Posts: 93
    Thanks tshirtbooth hehe it works :D
  • ForcingForcing Member Posts: 93
    Forcing said:
    Thanks tshirtbooth hehe it works :D
    And thanks MotherHoose i made the self already :D

Sign In or Register to comment.