July 19, 2018, 02:15:18 am
Username:

Password:

Topic: Books counters  (Read 404 times)

jankes

  • Posts: 15
    • View Profile
Books counters
« on: January 25, 2018, 06:43:59 pm »
We need books counters which player read. Books counter can be placed in character window in perks section. Each counter for each type of books; small guns, first aid, outdoor...

Why?

Because you no need to remember or write somewhere else how many books you read during gameplay.

So you gonna add it; very helpful (for me will be!).

Thx.

Henry

  • Wiki Administrator
  • Global Moderator
  • Posts: 812
  • Gravity is just a theory. Try Density.
    • View Profile
Re: Books counters
« Reply #1 on: January 25, 2018, 10:33:42 pm »
Good one. I agree. Also, when we read books on a character that already has the maximum skill, the book should not work, and thus not disappear from inventory, regardless of how many we have read. For example, if i never read any Scout books, but got my OD to 175 (max) without ever reading them, it is a waste of Scout books to read them at that point since they don't do anything. As things are now though, the Scout book(s) disappear though they yield no benefit.

Power

  • Posts: 1
    • View Profile
Re: Books counters
« Reply #2 on: April 07, 2018, 01:19:27 pm »
Good one. I agree. Also, when we read books on a character that already has the maximum skill, the book should not work, and thus not disappear from inventory, regardless of how many we have read. For example, if i never read any Scout books, but got my OD to 175 (max) without ever reading them, it is a waste of Scout books to read them at that point since they don't do anything. As things are now though, the Scout book(s) disappear though they yield no benefit.

Second part of your message relates to bug and not suggestion.

As I am new here and not much experience with C++, but just looking over the code, I made few small changes. Should fix problem having max skill and being able to consume the book.

Hopefully Kilgore can drop this in into next patch if its not fixed already.

Code: [Select]
// Author: cvet
// Edited by: Kilgore
#include "_macros.fos"
#include "msgstr.h"
#include "_vars.fos"

bool IsReadableBook(uint16 pid) // Export
{
switch (pid)
{
case PID_BIG_BOOK_OF_SCIENCE: // Science
case PID_DEANS_ELECTRONICS: // Repair
case PID_FIRST_AID_BOOK: // First Aid
case PID_SCOUT_HANDBOOK: // Outdoorsman
case PID_BARTER_BOOK: // Barter
case PID_GUNS_AND_BULLETS: // Small Guns
// case PID_CATS_PAW_ISSUE_5: // Energy Weapons
// case PID_CHEMISTRY_MANUAL:
// case PID_TECHNICAL_MANUAL:
// case PID_ACCOUNT_BOOK:
// case PID_BECKY_BOOK:
return true;
default: break;
}
return false; // Not a book
}

void TryReadBook(Critter& cr, Item& book) // Export
{
int skillNum;
uint strNum;
uint readAlready;
int skillMax;

switch (book.GetProtoId())
{
case PID_BIG_BOOK_OF_SCIENCE: // Science
skillNum = SK_SCIENCE;
strNum = STR_BOOK_READ_SCIENCE;
readAlready = LVAR_Book_Science;
skillMax = 125;
break;
case PID_DEANS_ELECTRONICS: // Repair
skillNum = SK_REPAIR;
strNum = STR_BOOK_READ_REPAIR;
readAlready = LVAR_Book_Repair;
skillMax = 125;
break;
case PID_FIRST_AID_BOOK: // First Aid
skillNum = SK_FIRST_AID;
strNum = STR_BOOK_READ_FISRT_AID;
readAlready = LVAR_Book_FirstAid;
skillMax = 200;
break;
case PID_SCOUT_HANDBOOK: // Outdoorsman
skillNum = SK_OUTDOORSMAN;
strNum = STR_BOOK_READ_OUTDOORSMAN;
readAlready = LVAR_Book_Outdoorsman;
skillMax = 175;
break;
case PID_BARTER_BOOK: // Barter
skillNum = SK_BARTER;
strNum = 10458;
readAlready = LVAR_Book_Barter;
skillMax = 150;
break;
case PID_GUNS_AND_BULLETS: // Small Guns
skillNum = SK_SMALL_GUNS;
strNum = STR_BOOK_READ_SMALL_GUNS;
readAlready = LVAR_Book_SmallGuns;
skillMax = 300;
break;
//case PID_CATS_PAW_ISSUE_5: skillNum=SK_ENERGY_WEAPONS; strNum=STR_BOOK_READ_ENERGY_WEAPONS; readAlready=LVAR_FO2077_Book_EnergyWeapons; break; // Energy Weapons
//case PID_CHEMISTRY_MANUAL: cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,STR_BOOK_READ_FAIL);return;
//case PID_TECHNICAL_MANUAL: cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,STR_BOOK_READ_FAIL);return;
//case PID_ACCOUNT_BOOK: cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,STR_BOOK_READ_FAIL);return;
//case PID_BECKY_BOOK: cr.SayMsg(SAY_NETMSG,TEXTMSG_GAME,STR_BOOK_READ_FAIL);return;
default: return;
}

GameVar@ readAlreadyVar = GetLocalVar(readAlready, cr.Id);
if (valid(readAlreadyVar) && readAlreadyVar.GetValue() < 10 && cr.Skill[skillNum] < skillMax)
{

//int sp=6;

//if(cr.Stat[ST_INTELLECT]<=4) sp=8;
//else if(cr.Stat[ST_INTELLECT]==5 || cr.Stat[ST_INTELLECT]==6) sp=Random(9,10);
//else if(cr.Stat[ST_INTELLECT]==7 || cr.Stat[ST_INTELLECT]==8) sp=Random(10,11);
//else if(cr.Stat[ST_INTELLECT]==9 || cr.Stat[ST_INTELLECT]==10) sp=Random(11,12);

for (int sp = 6; sp > 0;)
{
if (cr.Skill[skillNum] > 150 && sp > 3)
if (_CritIsTagSkill(cr, skillNum)) { cr.SkillBase[skillNum] += 2; sp = 0; }
else { cr.SkillBase[skillNum] += 1; sp = 0; }
else if (cr.Skill[skillNum] > 125 && sp > 2)
if (_CritIsTagSkill(cr, skillNum)) { cr.SkillBase[skillNum] += 2; sp -= 3; }
else { cr.SkillBase[skillNum] += 1; sp -= 3; }
else if (cr.Skill[skillNum] > 100 && sp > 1)
if (_CritIsTagSkill(cr, skillNum)) { cr.SkillBase[skillNum] += 2; sp -= 2; }
else { cr.SkillBase[skillNum] += 1; sp -= 2; }
else if (cr.Skill[skillNum] <= 100 && sp > 0)
if (_CritIsTagSkill(cr, skillNum)) { cr.SkillBase[skillNum] += 2; sp -= 1; }
else { cr.SkillBase[skillNum] += 1; sp -= 1; }
else sp = 0;
}

cr.SayMsg(SAY_NETMSG, TEXTMSG_GAME, strNum);
readAlreadyVar += 1;
_SubItem(book, 1);

// validate skill
if (cr.Skill[skillNum] > skillMax)
{
cr.SkillBase[skillNum] = skillMax;
}
}
else cr.SayMsg(SAY_NETMSG, TEXTMSG_GAME, STR_BOOK_READ_FAIL);
}

Slowhand

  • Posts: 249
  • Go for the eye, Boo! Go for the eyes!
    • View Profile
Re: Books counters
« Reply #3 on: April 09, 2018, 08:01:50 pm »
to Corosive, take this further and add libraries to events that you can read to increase the last few points, instead of normal book.

c_hieter

  • Supporter
  • Posts: 231
    • View Profile
Re: Books counters
« Reply #4 on: April 30, 2018, 02:19:53 pm »
i havent been around that much lately, but my experience during this session is that books only go away if you get a benefit. if books no longer can up your stats up you get the messiage that "that does nothing". am i wrong?

Seki

  • Posts: 234
    • View Profile
Re: Books counters
« Reply #5 on: April 30, 2018, 07:47:28 pm »
books only go away if you get a benefit. if books no longer can up your stats up you get the messiage that "that does nothing"
this is right
fuggen ded gaem