6 registered members (TipmyPip, Niels, dBc, Ed_Love, 3run, 1 invisible),
17,577
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: storing multiple values 1 skill
[Re: Reconnoiter]
#455433
10/19/15 19:59
10/19/15 19:59
|
Joined: Mar 2012
Posts: 927 cyberspace
Wjbender
User
|
User
Joined: Mar 2012
Posts: 927
cyberspace
|
you could fit them into a string like "23,24,66,22,55,67" then typecast into the skill something like skill1=(char*)this_string or skill1=(string*)this string ..
or put them in an array and cast it into the skill.
or put them in a struct - pointer and cast them in to the skill.
Last edited by Wjbender; 10/19/15 20:00.
Compulsive compiler
|
|
|
Re: storing multiple values 1 skill
[Re: Wjbender]
#455450
10/20/15 10:43
10/20/15 10:43
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
Thanks for your replies: you could fit them into a string like "23,24,66,22,55,67" then typecast into the skill something like skill1=(char*)this_string or skill1=(string*)this string ..
or put them in an array and cast it into the skill.
or put them in a struct - pointer and cast them in to the skill. , I forgot to mention it needs to be able to saved in a wmb file too. Anyway I think I have a reliable system up running now. I dropped the fraction so it now looks like this: 112233. And to keep precision: before saving values into the skill, I do ...skill = 0.05. This seems to negate precision loss. Also I reduced the range from 1-99 to 1-89 cause otherwise when a number reached 99 the previous number jumped up by 1 point (and for me 1-89 is still far enough options).
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|