The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A Question on File-Options
Author Message
Shidhun
Journeyman
*

Posts: 59
Likes Given: 5
Likes Received: 3 in 3 posts
Joined: Jul 2012
Reputation: 1



Post: #3
RE: A Question on File-Options
Ok lets say i'll try to store many items in a cabinet.

[DIALOG d_cabinet]
50,71
//nodispose
//noclose
File.mode.readflag=1
page 0
resizepic 0 0 2620 300 503
checkertrans 5 5 290 493
resizepic 350 0 2620 300 503
checkertrans 355 5 290 493


dtext 10 25 180 Items :
if (<file.fileexist cabinet/cabinet.txt>)
<file.open cabinet/cabinet.txt>
local.ox=20
local.oy=65
for <file.filelines cabinet/cabinet.txt>
call f_cabinet_resolve <FILE.Readline <local._for>>
//Buttons
button <local.ox> <eval <local.oy> +5> 1209 1210 1 0 <eval <local._for> +1000>
//Text-Entries
dtext <eval <local.ox> +20> <local.oy> 180 <local.name>
local.oy +=20
if <local._for> > 20
local.ox +=100
endif

endfor
endif
FILE.CLOSE


[DIALOG d_cabinet BUTTON]
On=1001 1050
IF (<FILE.FILEEXIST cabinet/cabinet.txt>)
<file.open cabinet/cabinet.txt>
call f_cabinet_resolve <FILE.Readline <eval (<ARGN1>-1000)>> //reads lines 1-50
serv.newitem <local.id>
new.name=<local.name>
new.color=<local.color>
new.attr=<local.flags>
new.more1=<local.more1>
new.bounce <src>
ENDIF
FILE.CLOSE

[Function f_cabinet_resolve]
local.name=<argv[0]>
local.id=<argv[1]>
local.color=<argv[2]>
local.flags=<argv[3]>
local.more1=<argv[4]>

The File cabinet.txt contains informations like :

name1,id1,color1,flags1,more1,.....
name2,id2,color2,flags2,more2,.....
name3,id3,color3,flags3,more3,.....
.....
name50,id50,color50,flags50,more50,.....

So. i can display every line of the File in my Gump. And i can extract/create each item, if wanted.
But the Cabinet is just for storing Items. When you take one out, obviousely it shouldn't "stay" in the Cabinet, so the entry has to be deleted.

You may ask, why does he want to use File-Options, when it is much simpler to just use tags on the Cabinet.
Well.. it is a RP-Server without a Maximum of items per character. So many characters have thousands of Items (in this case sets of clothing). It is definitely not good to store up to hundreds of tags on a item.
The Script is for Item-Reduction without forcing the players to "lose" items.
(This post was last modified: 02-12-2013 01:59 AM by Shidhun.)
02-12-2013 01:57 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
A Question on File-Options - Shidhun - 02-12-2013, 01:16 AM
RE: A Question on File-Options - Mordaunt - 02-12-2013, 01:34 AM
RE: A Question on File-Options - Shidhun - 02-12-2013 01:57 AM
RE: A Question on File-Options - Mordaunt - 02-12-2013, 02:04 AM
RE: A Question on File-Options - Shidhun - 02-12-2013, 08:20 PM
RE: A Question on File-Options - RanXerox - 02-15-2013, 05:00 AM
RE: A Question on File-Options - Mordaunt - 02-15-2013, 11:47 PM
RE: A Question on File-Options - darksun84 - 02-15-2013, 11:51 PM
RE: A Question on File-Options - Shidhun - 03-04-2013, 06:12 PM
RE: A Question on File-Options - Ben - 03-05-2013, 08:55 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)