It is currently 23 May 2024, 10:06
   
Text Size

Token Registration

Moderator: CCGHQ Admins

Token Registration

Postby Xander9009 » 28 Oct 2014, 10:06

(For 2014) Is a token registration tag always required for any card put onto the battlefield via token producing functions, or is this only necessary if the object produced is actually a token? I'm asking because I've noticed many missing token registrations in the CW, and they're (almost) all for cards that produce "tokens" which aren't actually tokens (they produced like tokens but not marked with <TOKEN />). If it's not required, does anyone know of any downsides to having the token registration tag anyway?

I just added token registration checks for RSN's Characteristics manager creating functions (so if the function calls for a token to be produced, it makes sure the tokens are registered). It also caught quite a few with a basic PutTokenOntoBattlefield function call. It would be easiest to simply add the missing registrations, even if they aren't needed, than to code it so it checks the "token" for the <TOKEN /> tag. just don't want to cause any problems. Advice?
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Token Registration

Postby RiiakShiNal » 28 Oct 2014, 10:53

As far as my tests have gone, it is always required to have TOKEN_REGISTRATION tags if a token is produced (even if it doesn't have <TOKEN/> in the produced token). Side effects for not having the registrations would be crashing either during or after a match. Typically crashes happen when the tokens cease to exist and the game tries to clear the memory used by them, so for persistent tokens it will typically happen at the end of a match, while for frequent tokens that are generated and go away a lot it tends to happen during a match. Occasionally, the crash will not happen even if the registration is missing, but that seems to happen randomly depending on what garbage gets referenced instead of the registration.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Token Registration

Postby Xander9009 » 28 Oct 2014, 10:57

RiiakShiNal wrote:As far as my tests have gone, it is always required to have TOKEN_REGISTRATION tags if a token is produced (even if it doesn't have <TOKEN/> in the produced token). Side effects for not having the registrations would be crashing either during or after a match. Typically crashes happen when the tokens cease to exist and the game tries to clear the memory used by them, so for persistent tokens it will typically happen at the end of a match, while for frequent tokens that are generated and go away a lot it tends to happen during a match. Occasionally, the crash will not happen even if the registration is missing, but that seems to happen randomly depending on what garbage gets referenced instead of the registration.
Alright. That's a good thing for me (it means my card validity checker happens to be working the way it should), but unfortunately, it means quite a few cards need fixed. Thanks. I remembered you mentioning this when first explaining your characteristics functions to me, but I didn't know if the missing <TOKEN /> tag had any effect. Since it doesn't, I'll go fix those :)
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Token Registration

Postby NeoAnderson » 28 Oct 2014, 12:29

As i see thereis another thing to consider, if experienced:
When you call PutTokenOntoBattlefield() and uses a card that is into deck(not token) the registration will causes the crash of the game. So for cards that are inside the deck should not be called.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Token Registration

Postby Xander9009 » 28 Oct 2014, 12:30

NeoAnderson wrote:As i see thereis another thing to consider, if experienced:
When you call PutTokenOntoBattlefield() and uses a card that is into deck(not token) the registration will causes the crash of the game. So for cards that are inside the deck should not be called.
Noted. Thank you.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Token Registration

Postby NeoAnderson » 28 Oct 2014, 13:45

Xander9009 wrote:
NeoAnderson wrote:As i see thereis another thing to consider, if experienced:
When you call PutTokenOntoBattlefield() and uses a card that is into deck(not token) the registration will causes the crash of the game. So for cards that are inside the deck should not be called.
Noted. Thank you.
Now i did remember that sometimes i had to remove the token registration due of some game crash, i was going crazy on some cards ( i don't remember exactly which cards) but sometime if we use token registration the game crashes.
The weird thing is that i remember that were some cards of a set like flip cards, all cards are coded with the same structure, so there was no reason that only some of them crashed when the token was registered!
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 12 guests


Who is online

In total there are 12 users online :: 0 registered, 0 hidden and 12 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 12 guests

Login Form