One from my best inventions: hundread books in one item and one script.
When you use that item first time, it will be just "some book" then set random content and tile (when you read it) Olways book will have the same content after roll, because use local vars. You can place hundreads the same item on bookshelfs and almost every will have different content- look like other item. So you dont need create many book items. Its only way to made library (i got that location in my mod) every bookshelf will contain some book.
Its dont need write these books, to made content: just copy fragments from real books found on net.
When you use that item first time, it will be just "some book" then set random content and tile (when you read it) Olways book will have the same content after roll, because use local vars. You can place hundreads the same item on bookshelfs and almost every will have different content- look like other item. So you dont need create many book items. Its only way to made library (i got that location in my mod) every bookshelf will contain some book.
Its dont need write these books, to made content: just copy fragments from real books found on net.
Code:
procedure start;
procedure look_at_p_proc;
procedure use_p_proc;
procedure talk_p_proc;
procedure Node999;
procedure Node001;
procedure Node002;
#define LVAR_Q1 (0)
procedure start begin
end
procedure look_at_p_proc begin
variable G;
G := local_var(LVAR_Q1);
script_overrides;
display_mstr(200+G);
end
procedure use_p_proc begin
if ((obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_RIGHT_HAND)) == 602) or
(obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_LEFT_HAND)) == 602)) then begin
call talk_p_proc;
end else begin
display_mstr(600);
end
end
procedure talk_p_proc begin
start_gdialog(NAME,self_obj,4,-1,-1);
gSay_Start;
if (local_var(LVAR_Q1) == 0) then begin
call Node001;
end else
if (local_var(LVAR_Q1) >= 1) then begin
call Node002;
end else begin
call Node002;
end
gSay_End;
end_dialogue;
end
procedure Node001 begin
variable x;
x:=random(1,5);
set_local_var(LVAR_Q1,x);
Reply(100+x);
NOption(300,Node999,002);
end
procedure Node002 begin
variable G;
G := local_var(LVAR_Q1);
Reply(100+G);
NOption(300,Node999,002);
end
procedure Node999 begin
end
Code:
{100}{}{abc}
{101}{}{Content 1}
{102}{}{Content 2}
{103}{}{Content 3}
{104}{}{Content 4}
{105}{}{Content 5}
{200}{}{Some Book.}
{201}{}{Title 1}
{202}{}{Title 2}
{203}{}{Title 3}
{204}{}{Title 4}
{205}{}{Title 5}
{300}{}{Close.}
{600}{}{Before use that item, hold it on hands.}