Storing the PC abilties, Skills, and etc.

Discussion in 'Modding and Scripting Support' started by Arthgon, Aug 30, 2008.

Remove all ads!
Support Terra-Arcanum:

GOG.com

PayPal - The safer, easier way to pay online!
  1. Arthgon

    Arthgon Well-Known Member

    Messages:
    2,733
    Likes Received:
    12
    Joined:
    Dec 30, 2007
    Now you can store the PC's Abilities, Skills and his/her Level:

    1. Using the tile scripts, you can store the PC's Abilities:

    Strength:

    0 Attachee = Triggerer
    1 stat 0 of Attachee: store in Local 0
    2 If Local0 = 2
    THEN PC Flag1 of Attachee = 1
    ELSE goto line 4
    3 Return and SKIP default
    4 If Local0 = 3
    THEN PC Flag2 of Attachee = 1
    ELSE goto line 6
    5 Return and SKIP default
    6 If Local0 = 4
    THEN PC Flag3 of Attachee = 1
    ELSE goto line 8
    7 Return and SKIP default
    8 If Local0 = 5
    THEN PC Flag4 of Attachee = 1
    ELSE goto line 10
    9 Return and SKIP default
    10 If Local0 = 6
    THEN PC Flag5 of Attachee = 1
    ELSE got line 12
    11 Return and SKIP default
    12 If Local0 = 7
    THEN PC Flag6 of Attachee = 1
    ELSE goto line 14
    13 Return of SKIP default
    14 If Local0 = 8
    THEN PC Flag7 of Attachee = 1
    ELSE goto line 16
    15 Return and SKIP default
    16 If Local0 = 9
    THEN PC Flag8 of Attachee = 1
    ELSE goto line 18
    17 Return and SKIP default
    18 If Local0 = 10
    THEN PC Flag9 of Attachee = 1
    ELSE goto line 20
    19 Return and SKIP default
    20 If Local0 = 11
    THEN PC Flag10 of Attachee = 1
    ELSE goto line 22
    21 Return and SKIP default
    22 If Local0 = 12
    THEN PC Flag11 of Attachee = 1
    ELSE goto line 24
    23 Return and SKIP default
    24 If Local0 = 13
    THEN PC Flag12 of Attachee = 1
    ELSE goto line 26
    25 Return and SKIP default
    26 If Local0 = 14
    THEN PC Flag13 of Attachee = 1
    ELSE goto line 28
    27 Return and SKIP default
    28 If Local0 = 15
    THEN PC Flag14 of Attachee = 1
    ELSE goto line 30
    29 Return and SKIP default
    30 If Local0 = 16
    THEN PC Flag15 of Attachee = 1
    ELSE goto line 32
    31 Return and SKIP default
    32 If Local0 = 17
    THEN PC Flag16 of Attachee = 1
    ELSE goto line 34
    33 Return and SKIP default
    34 If Local0 = 18
    THEN PC Flag17 of Attachee = 1
    ELSE goto line 36
    35 Return and SKIP default
    36 If Local0 = 19
    THEN PC Flag18 of Attachee = 1
    ELSE goto line 38
    37 Return and SKIP default
    38 If Local0 = 20
    THEN PC Flag 19 of Attachee = 1
    ELSE goto line 40
    39 Return and SKIP default
    40 If Local0 = 21
    THEN PC Flag 20 of Attachee = 1
    ELSE goto line 42
    41 Return and SKIP default
    42 If Local0 = 22
    THEN PC Flag 21 of Attachee = 1
    ELSE do nothing
    43 Return and RUN default

    Dexterity:

    0 Attachee = Triggerer
    1 stat 1 of Attachee: store in Local 1
    2 If Local1 = 2
    THEN PC Flag22 of Attachee = 1
    ELSE goto line 4
    3 Return and SKIP default
    4 If Local1 = 3
    THEN PC Flag23 of Attachee = 1
    ELSE goto line 6
    5 Return and SKIP default
    6 If Local1 = 4
    THEN PC Flag24 of Attachee = 1
    ELSE goto line 8
    7 Return and SKIP default
    8 If Local1 = 5
    THEN PC Flag25 of Attachee = 1
    ELSE goto line 10
    9 Return and SKIP default
    10 If Local1 = 6
    THEN PC Flag26 of Attachee = 1
    ELSE got line 12
    11 Return and SKIP default
    12 If Local1 = 7
    THEN PC Flag27 of Attachee = 1
    ELSE goto line 14
    13 Return of SKIP default
    14 If Local1 = 8
    THEN PC Flag28 of Attachee = 1
    ELSE goto line 16
    15 Return and SKIP default
    16 If Local1 = 9
    THEN PC Flag29 of Attachee = 1
    ELSE goto line 18
    17 Return and SKIP default
    18 If Local1 = 10
    THEN PC Flag30 of Attachee = 1
    ELSE goto line 20
    19 Return and SKIP default
    20 If Local1 = 11
    THEN PC Flag31 of Attachee = 1
    ELSE goto line 22
    21 Return and SKIP default
    22 If Local1 = 12
    THEN PC Flag32 of Attachee = 1
    ELSE goto line 24
    23 Return and SKIP default
    24 If Local1 = 13
    THEN PC Flag33 of Attachee = 1
    ELSE goto line 26
    25 Return and SKIP default
    26 If Local1 = 14
    THEN PC Flag34 of Attachee = 1
    ELSE goto line 28
    27 Return and SKIP default
    28 If Local1 = 15
    THEN PC Flag35 of Attachee = 1
    ELSE goto line 30
    29 Return and SKIP default
    30 If Local1 = 16
    THEN PC Flag36 of Attachee = 1
    ELSE goto line 32
    31 Return and SKIP default
    32 If Local1 = 17
    THEN PC Flag37 of Attachee = 1
    ELSE goto line 34
    33 Return and SKIP default
    34 If Local1 = 18
    THEN PC Flag38 of Attachee = 1
    ELSE goto line 36
    35 Return and SKIP default
    36 If Local1 = 19
    THEN PC Flag39 of Attachee = 1
    ELSE goto line 38
    37 Return and SKIP default
    38 If Local1 = 20
    THEN PC Flag40 of Attachee = 1
    ELSE goto line 40
    39 Return and SKIP default
    40 If Local1 = 21
    THEN PC Flag41 of Attachee = 1
    ELSE goto line 42
    41 Return and SKIP default
    42 If Local1 = 22
    THEN PC Flag42 of Attachee = 1
    ELSE do nothing
    43 Return and RUN default

    Constitution:

    0 Attachee = Triggerer
    1 stat 2 of Attachee: store in Local 2
    2 If Local2 = 2
    THEN PC Flag43 of Attachee = 1
    ELSE goto line 4
    3 Return and SKIP default
    4 If Local2 = 3
    THEN PC Flag44 of Attachee = 1
    ELSE goto line 6
    5 Return and SKIP default
    6 If Local2 = 4
    THEN PC Flag45 of Attachee = 1
    ELSE goto line 8
    7 Return and SKIP default
    8 If Local2 = 5
    THEN PC Flag46 of Attachee = 1
    ELSE goto line 10
    9 Return and SKIP default
    10 If Local2 = 6
    THEN PC Flag47 of Attachee = 1
    ELSE got line 12
    11 Return and SKIP default
    12 If Local2 = 7
    THEN PC Flag48 of Attachee = 1
    ELSE goto line 14
    13 Return of SKIP default
    14 If Local2 = 8
    THEN PC Flag49 of Attachee = 1
    ELSE goto line 16
    15 Return and SKIP default
    16 If Local2 = 9
    THEN PC Flag50 of Attachee = 1
    ELSE goto line 18
    17 Return and SKIP default
    18 If Local2 = 10
    THEN PC Flag51 of Attachee = 1
    ELSE goto line 20
    19 Return and SKIP default
    20 If Local2 = 11
    THEN PC Flag52 of Attachee = 1
    ELSE goto line 22
    21 Return and SKIP default
    22 If Local2 = 12
    THEN PC Flag53 of Attachee = 1
    ELSE goto line 24
    23 Return and SKIP default
    24 If Local2 = 13
    THEN PC Flag54 of Attachee = 1
    ELSE goto line 26
    25 Return and SKIP default
    26 If Local2 = 14
    THEN PC Flag55 of Attachee = 1
    ELSE goto line 28
    27 Return and SKIP default
    28 If Local2 = 15
    THEN PC Flag56 of Attachee = 1
    ELSE goto line 30
    29 Return and SKIP default
    30 If Local2 = 16
    THEN PC Flag57 of Attachee = 1
    ELSE goto line 32
    31 Return and SKIP default
    32 If Local2 = 17
    THEN PC Flag58 of Attachee = 1
    ELSE goto line 34
    33 Return and SKIP default
    34 If Local2 = 18
    THEN PC Flag59 of Attachee = 1
    ELSE goto line 36
    35 Return and SKIP default
    36 If Local2 = 19
    THEN PC Flag60 of Attachee = 1
    ELSE goto line 38
    37 Return and SKIP default
    38 If Local2 = 20
    THEN PC Flag61 of Attachee = 1
    ELSE goto line 40
    39 Return and SKIP default
    40 If Local2 = 21
    THEN PC Flag 62 of Attachee = 1
    ELSE goto line 42
    41 Return and SKIP default
    42 If Local2 = 22
    THEN PC Flag63 of Attachee = 1
    ELSE do nothing
    43 Return and RUN default

    Beauty:

    0 Attachee = Triggerer
    1 stat 3 of Attachee: store in Local 3
    2 If Local3 = 2
    THEN PC Flag64 of Attachee = 1
    ELSE goto line 4
    3 Return and SKIP default
    4 If Local3 = 3
    THEN PC Flag65 of Attachee = 1
    ELSE goto line 6
    5 Return and SKIP default
    6 If Local3 = 4
    THEN PC Flag66 of Attachee = 1
    ELSE goto line 8
    7 Return and SKIP default
    8 If Local3 = 5
    THEN PC Flag67 of Attachee = 1
    ELSE goto line 10
    9 Return and SKIP default
    10 If Local3 = 6
    THEN PC Flag68 of Attachee = 1
    ELSE got line 12
    11 Return and SKIP default
    12 If Local3 = 7
    THEN PC Flag69 of Attachee = 1
    ELSE goto line 14
    13 Return of SKIP default
    14 If Local3 = 8
    THEN PC Flag70 of Attachee = 1
    ELSE goto line 16
    15 Return and SKIP default
    16 If Local3 = 9
    THEN PC Flag71 of Attachee = 1
    ELSE goto line 18
    17 Return and SKIP default
    18 If Local3 = 10
    THEN PC Flag72 of Attachee = 1
    ELSE goto line 20
    19 Return and SKIP default
    20 If Local3 = 11
    THEN PC Flag73 of Attachee = 1
    ELSE goto line 22
    21 Return and SKIP default
    22 If Local3 = 12
    THEN PC Flag74 of Attachee = 1
    ELSE goto line 24
    23 Return and SKIP default
    24 If Local3 = 13
    THEN PC Flag75 of Attachee = 1
    ELSE goto line 26
    25 Return and SKIP default
    26 If Local3 = 14
    THEN PC Flag76 of Attachee = 1
    ELSE goto line 28
    27 Return and SKIP default
    28 If Local3 = 15
    THEN PC Flag77 of Attachee = 1
    ELSE goto line 30
    29 Return and SKIP default
    30 If Local3 = 16
    THEN PC Flag78 of Attachee = 1
    ELSE goto line 32
    31 Return and SKIP default
    32 If Local3 = 17
    THEN PC Flag79 of Attachee = 1
    ELSE goto line 34
    33 Return and SKIP default
    34 If Local3 = 18
    THEN PC Flag80 of Attachee = 1
    ELSE goto line 36
    35 Return and SKIP default
    36 If Local3 = 19
    THEN PC Flag81 of Attachee = 1
    ELSE goto line 38
    37 Return and SKIP default
    38 If Local3 = 20
    THEN PC Flag82 of Attachee = 1
    ELSE goto line 40
    39 Return and SKIP default
    40 If Local3 = 21
    THEN PC Flag83 of Attachee = 1
    ELSE goto line 42
    41 Return and SKIP default
    42 If Local3 = 22
    THEN PC Flag84 of Attachee = 1
    ELSE do nothing
    43 Return and RUN default

    So, Intelligence will be Local4, and PC Flag85 of Attachee = 1. Perception will be Local5, and PC Flag105 of Attachee = 1 etc.

    2. Now the best way to store the Levels and the Skills:

    {1}{"Now let me store your Level. What is your Level?"}{"Now let me store your Level. What is your Level?"}{}{}{}{}
    {2}{"I have Level 1."}{}{5}{le 1}{82}{pf }
    {3}{"Me Level 1."}{}{-4}{le 1}{82}{pf}
    {4}{"I have Level 2."}{}{5}{le 2}{82}{pf }
    {5}{"Me Level 2."}{}{-4}{le 2}{82}{pf}
    {6}{"I have Level 3."}{}{5}{le 3}{82}{pf }
    {7}{"Me Level 3."}{}{-4}{le 3}{82}{pf}
    {8}{"I have Level 4."}{}{5}{le 4}{82}{pf }
    {9}{"Me Level 4."}{}{-4}{le 4}{82}{pf }
    {10}{"I have Level 5."}{}{5}{le 5}{82}{pf }
    {11}{"Me Level 5."}{}{-4}{le 5}{82}{pf }
    {12}{"I have Level 6."}{}{5}{le 6}{82}{pf }
    {3}{"Me Level 6."}{}{-4}{le 6}{82}{pf}
    {4}{"I have Level 7."}{}{5}{le 7}{82}{pf }
    {5}{"Me Level 7."}{}{-4}{le 7}{82}{pf}
    {6}{"I have Level 8."}{}{5}{le 8}{82}{pf }
    {7}{"Me Level 8."}{}{-4}{le 8}{82}{pf}
    {8}{"I have Level 9."}{}{5}{le 9}{82}{pf }
    {9}{"Me Level 9."}{}{-4}{le 9}{82}{pf }
    {10}{"I have Level 10."}{}{5}{le 10}{82}{pf }
    {11}{"Me Level 10."}{}{-4}{le 10}{82}{pf }
    {2}{"I have Level 11."}{}{5}{le 11}{82}{pf }
    {3}{"Me Level 11."}{}{-4}{le 11}{82}{pf}
    {4}{"I have Level 12."}{}{5}{le 12}{82}{pf }
    {5}{"Me Level 12."}{}{-4}{le 12}{82}{pf}
    {6}{"I have Level 13."}{}{5}{le 13}{82}{pf }
    {7}{"Me Level 13."}{}{-4}{le 13}{82}{pf}
    {8}{"I have Level 14."}{}{5}{le 14}{82}{pf }
    {9}{"Me Level 14."}{}{-4}{le 4}{82}{pf }
    {10}{"I have Level 15."}{}{5}{le 5}{82}{pf }
    {11}{"Me Level 15."}{}{-4}{le 5}{82}{pf }
    {12}{"I have Level 16."}{}{5}{le 16}{82}{pf }
    {13}{"Me Level 16."}{}{-4}{le 16}{82}{pf}
    {14}{"I have Level 17."}{}{5}{le 17}{82}{pf }
    {15}{"Me Level 17."}{}{-4}{le 17}{82}{pf}
    {16}{"I have Level 18."}{}{5}{le 18}{82}{pf }
    {17}{"Me Level 18."}{}{-4}{le 18}{82}{pf}
    {18}{"I have Level 19."}{}{5}{le 19}{82}{pf }
    {19}{"Me Level 19."}{}{-4}{le 19}{82}{pf }
    {20}{"I have Level 20."}{}{5}{le 20}{82}{pf }
    {21}{"Me Level 20."}{}{-4}{le 20}{82}{pf }
    {22}{"I have Level 21."}{}{5}{le 21}{82}{pf }
    {23}{"Me Level 21."}{}{-4}{le 21}{82}{pf}
    {24}{"I have Level 22."}{}{5}{le 22}{82}{pf }
    {25}{"Me Level 22."}{}{-4}{le 22}{82}{pf}
    {26}{"I have Level 23."}{}{5}{le 23}{82}{pf }
    {27}{"Me Level 23."}{}{-4}{le 23}{82}{pf}
    {28}{"I have Level 24."}{}{5}{le 24}{82}{pf }
    {29}{"Me Level 24."}{}{-4}{le 24}{82}{pf }
    {30}{"I have Level 25."}{}{5}{le 25}{82}{pf }
    {31}{"Me Level 25."}{}{-4}{le 25}{82}{pf }
    {32}{"I have Level 26."}{}{5}{le 26}{82}{pf }
    {33}{"Me Level 26."}{}{-4}{le 26}{}{pf}
    {34}{"I have Level 27."}{}{5}{le 27}{82}{pf }
    {35}{"Me Level 27."}{}{-4}{le 27}{82}{pf}
    {36}{"I have Level 28."}{}{5}{le 28}{82}{pf }
    {37}{"Me Level 28."}{}{-4}{le 28}{82}{pf}
    {38}{"I have Level 29."}{}{5}{le 29}{82}{pf }
    {39}{"Me Level 29."}{}{-4}{le 30}{82}{pf }
    {40}{"I have Level 30."}{}{5}{le 30}{82}{pf }
    {41}{"Me Level 30."}{}{-4}{le 30}{82}{pf }
    {42}{"I have Level 31."}{}{5}{le 31}{82}{pf }
    {43}{"Me Level 31."}{}{-4}{le 31}{82}{pf}
    {44}{"I have Level 32."}{}{5}{le 32}{82}{pf }
    {45}{"Me Level 32."}{}{-4}{le 32}{82}{pf}
    {46}{"I have Level 33."}{}{5}{le 33}{82}{pf }
    {47}{"Me Level 33."}{}{-4}{le 33}{82}{pf}
    {48}{"I have Level 34."}{}{5}{le 34}{82}{pf }
    {49}{"Me Level 34."}{}{-4}{le 34}{82}{pf }
    {50}{"I have Level 35."}{}{5}{le 35}{82}{pf }
    {51}{"Me Level 35."}{}{-4}{le 35}{82}{pf }
    {52}{"I have Level 36."}{}{5}{le 36}{82}{pf }
    {53}{"Me Level 36."}{}{-4}{le 36}{82}{pf}
    {54}{"I have Level 37."}{}{5}{le 37}{82}{pf }
    {55}{"Me Level 37."}{}{-4}{le 37}{82}{pf}
    {56}{"I have Level 38."}{}{5}{le 38}{82}{pf }
    {57}{"Me Level 38."}{}{-4}{le 38}{82}{pf}
    {58}{"I have Level 39."}{}{5}{le 39}{82}{pf }
    {59}{"Me Level 39."}{}{-4}{le 39}{82}{pf }
    {60}{"I have Level 40."}{}{5}{le 40}{82}{pf }
    {61}{"Me Level 40."}{}{-4}{le 40}{82}{pf }
    {62}{"I have Level 41."}{}{5}{le 41}{82}{pf }
    {63}{"Me Level 41."}{}{-4}{le 41}{82}{pf}
    {64}{"I have Level 42."}{}{5}{le 42}{82}{pf }
    {65}{"Me Level 42."}{}{-4}{le 42}{82}{pf}
    {66}{"I have Level 43."}{}{5}{le 43}{82}{pf }
    {67}{"Me Level 43."}{}{-4}{le 43}{82}{pf}
    {68}{"I have Level 44."}{}{5}{le 44}{82}{pf }
    {69}{"Me Level 44."}{}{-4}{le 44}{82}{pf }
    {70}{"I have Level 45."}{}{5}{le 45}{82}{pf }
    {71}{"Me Level 45."}{}{-4}{le 45}{82}{pf }
    {72}{"I have Level 46."}{}{5}{le 46}{82}{pf }
    {73}{"Me Level 46."}{}{-4}{le 46}{82}{pf}
    {74}{"I have Level 47."}{}{5}{le 47}{82}{pf }
    {75}{"Me Level 47."}{}{-4}{le 47}{82}{pf}
    {76}{"I have Level 48."}{}{5}{le 48}{82}{pf }
    {77}{"Me Level 48."}{}{-4}{le 48}{82}{pf}
    {78}{"I have Level 49."}{}{5}{le 49}{82}{pf }
    {79}{"Me Level 49."}{}{-4}{le 49}{82}{pf }
    {80}{"I have Level 50."}{}{5}{le 50}{82}{pf }
    {81}{"Me Level 50."}{}{-4}{le 50}{82}{pf }

    {82}{"I want to store your Skills for going further."}{"I want to store your Skills for going further."}{}{}{}{}
    {83}{"Okay."}{}{5}{}{4}{}
    {84}{"Okidoki."}{}{-4}{}{4}{}
    {85}{"Now how is your skill rank in the Bow?"}{"Now how is your skill rank in the Bow?"}{}{}{}{}
    {86}{"My skill in the Bow have 0 rank."}{}{5}{sk0 0}{}{pf }
    {87}{"Me have bow 0 rank."}{}{-4}{sk0 0}{}{pf }
    {88}{"My skill in the Bow have 1 rank."}{}{5}{sk0 1}{}{pf }
    {89}{"Me have Bow 1 rank."}{}{-4}{sk0 1}{}{pf }
    {90}{"My skill in the Bow have 2 ranks."}{}{5}{sk0 2}{}{pf }
    {91}{"Me have Bow 2 ranks."}{}{-4}{sk0 2}{}{pf }
    {92}{"My skill in the Bow have 3 ranks."}{}{5}{sk0 3}{}{pf }
    {93}{"Me have Bow 3 ranks."}{}{-4}{sk0 3}{}{pf }
    {94}{"My skill in the Bow have 4 ranks."}{}{5}{sk0 4}{}{pf }
    {95}{"Me have Bow 4 ranks."}{}{-4}{sk0 4}{}{pf }
    {96}{"My skill in the Bow have 5 ranks."}{}{5}{sk0 5}{}{pf }
    {97}{"Me have Bow 5 ranks."}{}{-4}{sk0 5}{}{pf }
    {98}{"My skill in the Bow have 6 ranks."}{}{5}{sk0 6}{}{pf }
    {99}{"Me have Bow 6 ranks."}{}{-4}{sk0 6}{}{pf }
    {100}{"My skill in the Bow have 7 ranks."}{}{5}{sk0 7}{}{pf }
    {101}{"Me have Bow 6 ranks."}{}{-4}{sk0 7}{}{pf }

    And so on...untill all the Skills are stored.

    PS: I am still working on reseting the Abilities, Skills and Levels.
     
  2. The_Bob

    The_Bob Administrator Staff Member

    Messages:
    891
    Likes Received:
    8
    Joined:
    May 9, 2006
    That's sure a long script. What's the significance of 'Storing the PC abilties, Skills, and etc.' ?

    I hope you've used some extensive copy-paste and regex to create this...
     
  3. Arthgon

    Arthgon Well-Known Member

    Messages:
    2,733
    Likes Received:
    12
    Joined:
    Dec 30, 2007
    Sorry about that.

    Oops, I forgot to tell more about it. The significances of Storing the PC Abilties etc. are:

    1. Original there are some tests missing in the dialog of the PC like: Strength, Dexterity, Constitution, Willpower, Beauty and some of the Skills. Now you can use these tests in the dialogs of the PC.

    2. Suppose you have incorparate another mod in the Main Module(Main Arcanum + Hell Gate), and you don't want to the PC comes back from the another mod with too much power. So before the PC goes to Hell Gate, you store his powers, and when he/ she comes back, you will reset his powers like he never went to Hell Gate.

    No, I did not use copy-paste.
     
  4. The_Bob

    The_Bob Administrator Staff Member

    Messages:
    891
    Likes Received:
    8
    Joined:
    May 9, 2006
    :-o Then it must've taken you a couple of hours to code this.

    You really should look into regular expressions if you're to keep producing and working with lumps of code like that.
     
  5. Arthgon

    Arthgon Well-Known Member

    Messages:
    2,733
    Likes Received:
    12
    Joined:
    Dec 30, 2007

    I did this exactly in 1 hour and 5 minutes.


    Perhaps it's better that I made them all downloadable. So you don't have to write all the scripts and dialogs from scratch. What do you think of this?
     
  6. rroyo

    rroyo Active Member

    Messages:
    3,319
    Likes Received:
    0
    Joined:
    Oct 13, 2006
    Please do!
     
  7. MackaN

    MackaN New Member

    Messages:
    105
    Likes Received:
    0
    Joined:
    Jun 27, 2005
    I agree, Plese do! Nad someone can put this in to download section here :)
     
  8. Arthgon

    Arthgon Well-Known Member

    Messages:
    2,733
    Likes Received:
    12
    Joined:
    Dec 30, 2007
    UPDATE: The scripts and dialog of storing the abilities are ready, and they are even better, then what I have placed here. The storing of the levels, hitpoints, and the skills, and the resetting are not finished...yet. Now I am working on the scripts of storing of the skills, because they are almost ready.
     
Our Host!