FOnline: Reloaded

Development => Suggestions => Closed suggestions => Topic started by: jankes on January 25, 2018, 06:43:59 pm

Title: Books counters
Post by: jankes 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.
Title: Re: Books counters
Post by: Henry 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.
Title: Re: Books counters
Post by: Power 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);
}
Title: Re: Books counters
Post by: Slowhand 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.
Title: Re: Books counters
Post by: c_hieter 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?
Title: Re: Books counters
Post by: Seki 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
Title: Re: Books counters
Post by: jankes on August 13, 2018, 10:06:30 am
Bump suggestion because it is highly needed! :D
Title: Re: Books counters
Post by: POWERPUFF on August 13, 2018, 12:45:28 pm
Bump suggestion because it is highly needed! :D

No, it is not.
Title: Re: Books counters
Post by: Joe Lavender on August 14, 2018, 12:26:38 pm
Bump suggestion because it is highly needed! :D

Like C_Heiter said, you can only use books until the message "This does nothing" appears. Its not needed.
Title: Re: Books counters
Post by: Chosen One on August 14, 2018, 04:12:29 pm
Not needed, not useful, and takes up developer's time trying.
Sorry, no support here.
Title: Re: Books counters
Post by: Programmer on August 14, 2018, 06:34:32 pm
I think it is one of those small suggestions which basically is the most useful when it comes to user's experience. I can't see anything wrong that suggestion and it could help some people, especially those who play from time to time and can't remember everything. This isn't hard to implement because it works similar way as implants' counters.

+1 for that suggestion.

No, it is not.
Like C_Heiter said, you can only use books until the message "This does nothing" appears. Its not needed.
Not needed, not useful, and takes up developer's time trying.
Sorry, no support here.

What isn't useful in having books counters which show books which you have read? So, why do we have selected perks in character's screen? It seems to be useless too in your logic. Also developers don't do anything since few months because old bugs aren't still fixed when they could be fixed in one day. There're many bugs which can be fixed in few hours.
Title: Re: Books counters
Post by: Parabellum on August 14, 2018, 11:25:09 pm
Well you have a point Programmer.
Title: Re: Books counters
Post by: Chosen One on August 14, 2018, 11:52:00 pm
Well you have a point Programmer.
More importantly;
This isn't hard to implement because it works similar way as implants' counters.
Title: Re: Books counters
Post by: Engardo on December 20, 2018, 10:49:09 pm
Good suggestion almost forgotten. I built it into my mod as a dialogue.

Code: [Select]
void r_QuestionsBooksRead(Critter& cr, Critter@ npc)
{
array<int> bookRead = {GetLocalVar(LVAR_Book_Science, cr.Id).GetValue(),GetLocalVar(LVAR_Book_Repair, cr.Id).GetValue(),GetLocalVar(LVAR_Book_FirstAid, cr.Id).GetValue(),GetLocalVar(LVAR_Book_Outdoorsman, cr.Id).GetValue(),GetLocalVar(LVAR_Book_Barter, cr.Id).GetValue(),GetLocalVar(LVAR_Book_SmallGuns, cr.Id).GetValue()};
array<string> info = {"Science","Repair","FirstAid","Outdoorsman","Barter","SmallGuns"};
for(uint i=0;i<bookRead.length();i++)
{
if(bookRead[i] > 0)
{
cr.Say(SAY_NETMSG, info[i]+" : "+bookRead[i]);
}
}
}


When I was testing, I wondered why I didn't get a message. Then I remembered that I haven't read any books yet.  :facepalm
Maybe it would be better to show the unread ones as well. Or ~rb command. What would be better?