New token´s ID every campaign load

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
Nertht
Kobold
Posts: 23
Joined: Sun Jul 27, 2014 3:46 am

New token´s ID every campaign load

Post by Nertht »

Hi, is it possible to prevent assignig new token´s ID while camaign start up? I´d like this, cause I have got some old tokens with properties sets to specific token ID. I can´t use token name, GM name or label, it have to be ID.
Thanks a lot for any reply
Peter.

User avatar
wolph42
Deity
Posts: 9853
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: New token´s ID every campaign load

Post by wolph42 »

token id's should not change that often. Certainly not when you load a campaign. TBH its not entirely clear to me *when* they change. For sure is when you copy paste them and maybe when you cut and paste (though easily tested). Stuff like importing and exporting a map may also have this effect. but overall when I load a campaign ID's are usually not changed.

That said... unfortunately at the moment its a bad idea to use IDs of tokens due to a truncating bug, it does not happen often, but it *can* happen. Some tokens IDs are (by coincidence) purely numeric and if they also happen to start with 1 or more '0' then these are lost as soon as they're assigned (the '0' that is). Hence the ID wont work anymore.

So *why* can't you use the name?

Nertht
Kobold
Posts: 23
Joined: Sun Jul 27, 2014 3:46 am

Re: New token´s ID every campaign load

Post by Nertht »

1) It happen usually when I start server or load (after turn off) saved campaign. Yes, it could be caused by this zeros. Cause most of my tokens start and ends with large amount of nulls (but there are some characters in the middle as well).

2) I cant use name cause people don´t like see thnigs like (orc 1, orc 2, ... orc 49...) and GM name is reserved for ANSI (not UNICODE) name - at the beginning of my macro writing experience I was using that instead property. Label show how many items represent one token. So, now my tokens look like - Name: Hřebíky(Nails), GMname: Hrebiky, Label: 3x. There is only one way, how to make GM name free for use and it is overwrite whole code and put GM name to property. Its really, really insanely amount of work. But, I´ll do it, if there is no other possibility.

User avatar
wolph42
Deity
Posts: 9853
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: New token´s ID every campaign load

Post by wolph42 »

Nertht wrote:I cant use name cause people don´t like see thnigs like (orc 1, orc 2, ... orc 49...) .


but they do like to see ("00000000DB42375F1F00000000000000,00000000014C375F2C00000000000000,00000000194F375F3A00000000000000,000000001952375F4800000000000000") ????!
Cause that is what you're using INSTEAD of the token.name currently... (at least so you say)

So Im sorry but that makes no sense to me. So again: why can't you use the token.name instead of the ID ?

To clarify other things that you might or might not comprehend already:
for functions you can only use 2 identifiers for a token: token.name and token id. Both have issues. token.name cannot be too funky, e.g. "cal'rha" or "Orc,Black" will break the functions. ID's break cause of issues you already mentioned.

Overall, "we" (coders) are generally forced to use *unique* alphanumerical token names, or stuff will break or not function. This is one of the reasons that I wrote 'diagnose' for the bag of tricks, which checks this stuff.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: New token´s ID every campaign load

Post by Jagged »

wolph42 wrote:
Nertht wrote:I cant use name cause people don´t like see thnigs like (orc 1, orc 2, ... orc 49...) .


but they do like to see ("00000000DB42375F1F00000000000000,00000000014C375F2C00000000000000,00000000194F375F3A00000000000000,000000001952375F4800000000000000") ????!
Cause that is what you're using INSTEAD of the token.name currently... (at least so you say)


I think what he means is that he cannot use the label because it is not unique and that they are not unique because he calls all the orcs "Orc" rather than "Orc 1", "Orc 2" etc.

Have to say I would also like to be able to store and use token ids in a campaign, but unfortunately they change when you start a server. Not sure why.

User avatar
wolph42
Deity
Posts: 9853
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: New token´s ID every campaign load

Post by wolph42 »

Jagged wrote:
I think what he means is that he cannot use the label because it is not unique and that they are not unique because he calls all the orcs "Orc" rather than "Orc 1", "Orc 2" etc.

Have to say I would also like to be able to store and use token ids in a campaign, but unfortunately they change when you start a server. Not sure why.


ah yes, that makes sense and indeed true, it would be nicer to have the token name free for something else. But alas, it isn't. The only thing i can think of is that you restore the token ids oncampaignload. IRC when you start a server it runs again (not sure though). Another thing that might help is to start the server first and then load the campaign...but if a connection breaks, you'll have to redo that. Again not ideal, but it is as it is.

Nertht
Kobold
Posts: 23
Joined: Sun Jul 27, 2014 3:46 am

Re: New token´s ID every campaign load

Post by Nertht »

Ok, I´ll mind it. With names is it exactly how Jagged said.
Thx Peter.

Post Reply

Return to “MapTool”