well, i think i have cracked it. but theres one slight problem i cant seem to get my head wrapped around. i have an IF-statement in my script. well, i have a rediculous ammount actually. but my script skips one of them, and its really irritating because in my eyes, it will fix my problems.
Expand|Select|Wrap|Line Numbers
- name=raw_input('What do you want to call your character? ')
- Strength1 = '' #just defining these so my script doesnt get mad at me and give me an error later
- Strength2 = ''
- for x in range(1,100): #runs the thing a few times, since the potensial for error is relatively big, as you can see in the way too long *if value = value or value2 = value2 thing a bit further down
- import random
- S1 = random.randint(1, 6)
- S2 = random.randint(1, 6)
- S3 = random.randint(1, 6)
- S4 = random.randint(1, 6)
- if S1 < S2 and S1 < S3 and S1 < S4: #rolls a 6 sided dice and removes the one with lowest score, then adds the 3 that rolled highest into a new value called S5.
- S5 = S2 + S3 + S4
- elif S2 < S1 and S2 < S3 and S2 < S4:
- S5 = S1 + S3 + S4
- elif S3 < S1 and S3 < S2 and S3 < S4:
- S5 = S1 + S2 + S4
- elif S4 < S1 and S4 < S3 and S4 < S2:
- S5 = S1 + S3 + S2
- if S1==S2 or S1==S3 or S1==S4 or S2==S1 or S2==S3 or S2==S4 or S3==S1 or S3==S2 or S3==S4 or S4==S1 or S4==S2 or S4==S3
- print ''
- print '....... Ability Values .......'
- print 'Value 1 = %s ' % S5
- print 'Value 2 = %s ' % D5
- print 'Value 3 = %s ' % C5
- print 'Value 4 = %s ' % I5
- print 'Value 5 = %s ' % W5
- print 'Value 6 = %s ' % CH5
- print '..............................'
- print 'You must now choose which of your ability values will be your traits.'
- print '..............................'
- Strength1=raw_input("Strength affects the ability of characters to lift and carry weights and make effective melee attacks. Please decide which of your ability scores will be your strength score, and type in the corresponding number. ")
- if Strength1==1:
- print '........................'
- print 'your strength is now %s.' % S5
- Strength2=S5
- elif Strength1==2:
- print '........................'
- print 'your strength is now %s.' % D5
- Strength2=D5
- elif Strength1==3:
- print '........................'
- print 'your strength is now %s.' % C5
- Strength2=C5
- elif Strength1==4:
- print '........................'
- print 'your strength is now %s.' % I5
- Strength2=I5
- elif Strength1==5:
- print '........................'
- print 'your strength is now %s.' % W5
- Strength2=W5
- elif Strength1==6:
- print '........................'
- print 'your strength is now %s.' % CH5
- Strength2=CH5
- #this is where the problem lies. i dont know why, but my computer doesnt seem to wanna do this if statement. it simply skips it, and its really irritating, because i have a feeling it will all work out if my computer stops thinking "oh, whats this? and if statement? well, that cant be important, lets skip it."
- print '.............................'
- print 'Your strength is now %s' % Strength2
by typing in the correct number in the console, you assign that number to Strength1. then, the if-statement checks Strength1's value, and makes Strength2 the correct size of the character's strength. then it prints the strength. however when i run this script, it simply tells me that my strength is *empty space* :(