I've made this basic (messy) example of what I want to do.
DIM Skill(2,2)
Strength=0 : Smarts=1 : Weapons=2
DIM Name$(2,1)
Last=0 : First=1
`* TEMPLATES *
`Make Scarface Template
Name$(0,Last)="Scarface"
Name$(0,First)=""
Skill(0,Strength)=80
Skill(0,Smarts)=50
Skill(0,Weapons)=70
`Make Fingers Template
Name$(1,Last)="Fingers"
Name$(1,First)=""
Skill(1,Strength)=50
Skill(1,Smarts)=70
Skill(1,Weapons)=80
`* CHARACTERS *
`Make Character
Name$(2,Last)="Sorvito"
Name$(2,First)="Mickey"
Skill(2,Strength)=10
Skill(2,Smarts)=30
Skill(2,Weapons)=10
sync on
DO
oldin = U+D+L+R
U=Upkey() : D=Downkey() : L=Leftkey() : R=Rightkey()
If U+D+L+R > oldin
Inc Hi,D-U
If Hi < 0 then Hi=2
If Hi > 2 then Hi=0
Endif
Skill(2,Hi) = Skill(2,Hi)+R-L
If Skill(2,Hi) < 0 then Skill(2,Hi)=0
If Skill(2,Hi) > 100 then Skill(2,Hi)=100
If ABS(Skill(2,Strength) - Skill(0,Strength)) < 10
If ABS(Skill(2,Smarts) - Skill(0,Smarts)) < 10
If ABS(Skill(2,Weapons) - Skill(0,Weapons)) < 10
Nick$="'Scarface' "
Endif
Endif
Endif
If ABS(Skill(2,Strength) - Skill(1,Strength)) < 10
If ABS(Skill(2,Smarts) - Skill(1,Smarts)) < 10
If ABS(Skill(2,Weapons) - Skill(1,Weapons)) < 10
Nick$="'Fingers' "
Endif
Endif
Endif
Print Name$(2,First) ; " " ; Nick$ ; Name$(2,Last)
Print "Strength: " ; Skill(2,0)
Print "Intelligence: " ; Skill(2,1)
Print "Weapons: " ; Skill(2,2)
Line 0,(Hi+2)*16,100,(Hi+2)*16
sync:cls
LOOP
The problem is that the character will only get the nickname if his skills are near the exact template.
I want the character to get the nickname if his skills are proportioned in the same way as the template.
Quote: "
Scarface: Strength=80, Smarts=50, Weapons=70
Mickey "Scarface" Sorvito: Strength=95, Smarts=62, Weapons=84
"
How can I do that kind of "fuzzy" analysis.