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
Way to store value like TAG.X in 51a
Author Message
Confusioner
Apprentice
*

Posts: 4
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jan 2014
Reputation: 0



Post: #1
Way to store value like TAG.X in 51a
Hi,

I am looking for a way to store information permanently (string, position, number) into an item. MORE, MOREP etc. are not enough for this item. I need to save at least 30~ different key/value pair. In 55i, 56b we can use

Code:
TAG.SOMEKEY = VALUE

Is there a way to implement this in 51a?
01-29-2014 01:27 AM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #2
RE: Way to store value like TAG.X in 51a
VAR

But all VAR are global, so they all need a unique name... Since UID is unique, I would use that. For example,

VAR.Item<UID>.SomeKey=

However, if there ends up being a lot of these, then searching them will be slower and slower... so make sure to delete the VAR when you are done with it.
01-29-2014 05:13 AM
Find all posts by this user Like Post Quote this message in a reply
Confusioner
Apprentice
*

Posts: 4
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jan 2014
Reputation: 0



Post: #3
RE: Way to store value like TAG.X in 51a
Thanks for your answer, I really appreciate it. But there must be something wrong, because I can't get it to work.


Code:
[7b56]
ID=0e3b
NAME=Book of Test
COLOR=070d
TYPE=12
MOREX=0
MOREZ=3
MOREY=1

VAR.TEST<UID>.SomeKey=TestOne
VAR.TST=TestTwo

ONTRIGGER=DCLICK
    src.message Test1: <VAR.TEST<UID>.SomeKey>
    src.message Test2: <VAR.TST>
    return 1

[Image: mXZNm9A.png]

Both returns empty.
01-30-2014 04:10 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #4
RE: Way to store value like TAG.X in 51a
Can VARs be assigned in the itemdef section? I don't think so, try with tags instead in this case.

However, old versions (don't know if 51a had this behaviour too) needed to use try to set value<string>, so the item should be like this:

Code:
[7b56]
ID=0e3b
NAME=Book of Test
COLOR=070d
TYPE=12
MOREX=0
MOREZ=3
MOREY=1

TAG.TST=TestTwo

ONTRIGGER=CREATE
try TAG.TEST<UID>.SomeKey=TestOne //Also this one SHOULD NOT WORK in the item creation, as this section is for static keys, you should use ONTRIGGER=CREATE to set this one because until  CREATE the item does not have uid.

ONTRIGGER=DCLICK
    src.message Test1: <TAG.TEST<UID>.SomeKey>
    src.message Test2: <TAG.TST>
    return 1
(This post was last modified: 01-30-2014 05:58 AM by XuN.)
01-30-2014 05:58 AM
Find all posts by this user Like Post Quote this message in a reply
Confusioner
Apprentice
*

Posts: 4
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jan 2014
Reputation: 0



Post: #5
RE: Way to store value like TAG.X in 51a
Thanks XuN,

But it seems, it does not even recognize the TAG to parse it. Still looking for solution.

[Image: 32efj4D.png]
01-30-2014 07:29 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #6
RE: Way to store value like TAG.X in 51a
Dark told me on IRC that maybe TAG didn't exists on 51a, so the post from Ranxerox makes more sense now ^^. Try changing the TAG to VAR and moving both to ONTRIGGER=CREATE, lets see what happens Smile
01-30-2014 07:40 AM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #7
RE: Way to store value like TAG.X in 51a
oh if only the secrets of 51a wasnt in someones moms attic...



not sure if anything is on here, but this is a site i find myself going back to over and over year after year...


http://www.geocities.co.jp/Playtown-Yoyo/3333/

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 01-30-2014 07:48 AM by x77x.)
01-30-2014 07:44 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #8
RE: Way to store value like TAG.X in 51a
I don't understand a shit ^^, 56c is ways better btw.
01-30-2014 08:08 AM
Find all posts by this user Like Post Quote this message in a reply
Confusioner
Apprentice
*

Posts: 4
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jan 2014
Reputation: 0



Post: #9
RE: Way to store value like TAG.X in 51a
First: yeah you are god damn right, its old as hell. I don't like either. But this is a nostalgia shard. Trying to make small changes.

On the subject:

1) Turns out there is NO ONTRIGGER=CREATE method on 51a. I looked others scripts and they all created first initialization on ONTRIGGER=TIMER, with TIMER set to 0.
2) <VAR.TST> DOES work on session. But when you save the world, it disappears. Useless for permanent value storage.
3) I set TIMER to -1 to avoid looping.

Code:
[7b56]
ID=0e3b
NAME=Book of Test
COLOR=070d
TIMER=0
ATTR=24

ONTRIGGER=TIMER
SAY Item Created
VAR.TST=TestTwo
VAR.TEST<UID>.SomeKey=TestOne
TIMER=-1
return 1

ONTRIGGER=DCLICK
    src.message Test1: <VAR.TEST<UID>.SomeKey>
    src.message Test2: <VAR.TST>
    return 1

[Image: 65WSgdC.png]

There must be some way to store multiple data to single item. Otherwise how come sphere save guild membership info of players?
(This post was last modified: 01-30-2014 08:35 AM by Confusioner.)
01-30-2014 08:29 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #10
RE: Way to store value like TAG.X in 51a
Thats not good, I thought that vars were permanent back in 51a too. However, guild's information is stored in a single item (memory_guild) placed in each member/candidate wich is linked to the guildstone.
01-30-2014 05:31 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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