Accessing token properties question

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
xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Accessing token properties question

Post by xavram »

During a macro, I have to evaluate a given token's property (Feats) many times. I'm just wondering what the most effecient (time wise) method of doing this.

1. switchtoken to that token, then just call "if indexOf(Feats, blah blah)" or however i need to evaluate it.
2. Assign the Feats property to a local variable in the macro, then make all the calls against that local variable.

My gut is leaning towards #2, but I'm just curious if this is correct or not.

Thanks!

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Accessing token properties question

Post by aliasmask »

Feat lists can be pretty big and you wouldn't want to loop through all of them. Saving your feat list to token then referencing a main db of feats is the way to go.

But data structure is a big part of doing something efficiently. I'm not really sure what your structure is or what you want to do with it.

Post Reply

Return to “MapTool”