Can token properties be deleted?

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

MandyRae
Cave Troll
Posts: 53
Joined: Sat Mar 12, 2016 11:39 am

Re: Can token properties be deleted?

Post by MandyRae »

And I'll leave the discussion at that (wolph if you wish to reply, feel free to do so in a personal message). Sorry for hijacking the thread.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Can token properties be deleted?

Post by wolph42 »

MandyRae wrote:And I'll leave the discussion at that (wolph if you wish to reply, feel free to do so in a personal message). Sorry for hijacking the thread.
completely missed this post. Good point. Discussion continues here:
http://forums.rptools.net/viewtopic.php ... 10#p262510

User avatar
Irrlicht
Dragon
Posts: 426
Joined: Mon Feb 09, 2009 10:53 am

Re: Can token properties be deleted?

Post by Irrlicht »

It nearly caused me headaches, but I managed to understand almost everything and successfully made my own Show Handout macro (not because I had anything against using the Bag of Tricks, but as said before, I wanted to understand).

Now there are a couple little things in particular I didn't understand, in regard to macroLink().
In the BoT, it was used as:

[h, if(others != ""):broadcast(macroLink("<color='red'>", arg(0), outputList, arg(1), ""), others)]

What I don't get is:

1) "<color='red'>" is where the link text is supposed to be, but what is it for? I don't see anything in red, in the resulting dialog, why isn't it just "";

2) also, there's no link built at all. As an ignorant of these functions, If I didn't see the macro(s) in action and just gave a look at the code, I would have said the macro would send (with the broadcast function) a link to all chosen players, and once they clicked it, they'd get the dialog. Instead, it just makes the dialog appear to them, with no links (which is exactly as i want it, mind you, but)... I don't get what's going on here.

In addition (search didn't return results about this because there are too many results), I wanted to set the default value for the size as the actual width of the chosen image (token, portrait or handout), because an arbitrary value wouldn't let me know the actual size of a handout and thus if it'll show too big and pixellated.
But how can I get the properties of a token image/portrait/handout?
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Can token properties be deleted?

Post by wolph42 »

1 i think its relic code that redundant.
2. That the idea of this construct, broadcasting macrolink results in an auto exec.
3. I have too look that up, but it's possible

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: Can token properties be deleted?

Post by aliasmask »

Irrlicht wrote:2) also, there's no link built at all. As an ignorant of these functions, If I didn't see the macro(s) in action and just gave a look at the code, I would have said the macro would send (with the broadcast function) a link to all chosen players, and once they clicked it, they'd get the dialog. Instead, it just makes the dialog appear to them, with no links (which is exactly as i want it, mind you, but)... I don't get what's going on here.
This is normal behavior. You can broadcast without a link. It does put real tiny dot inline with the text though. To prevent the macro from being auto-executed you have to uncheck autoexecute for that macro. Broadcasting to yourself never autoexecutes, but it does to other clients.

User avatar
Irrlicht
Dragon
Posts: 426
Joined: Mon Feb 09, 2009 10:53 am

Re: Can token properties be deleted?

Post by Irrlicht »

Alright, got it.

Any news about retrieving a picture's original size?
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."

User avatar
Irrlicht
Dragon
Posts: 426
Joined: Mon Feb 09, 2009 10:53 am

Re: Can token properties be deleted?

Post by Irrlicht »

wolph42 wrote:3. I have too look that up, but it's possible
"Wooooolph...!" *Calling for help from afar.*
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Can token properties be deleted?

Post by wolph42 »

Irrlicht wrote:
wolph42 wrote:3. I have too look that up, but it's possible
"Wooooolph...!" *Calling for help from afar.*
ah yes forgot about that, just add -size to the asset id. E.g.:
[id = "asset://62b8f7b9187225c904af6a716a356da3-30"]
<img src='[r:id]'></img>
for a 30px size picture.

User avatar
Irrlicht
Dragon
Posts: 426
Joined: Mon Feb 09, 2009 10:53 am

Re: Can token properties be deleted?

Post by Irrlicht »

Uhm, but isn't that just as "getTokenImage(30)"? How does that give the value of the picture's original size? When you retrieve an asset without specifying size it has no size attribute that could be extrapolated.
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Can token properties be deleted?

Post by wolph42 »

Irrlicht wrote:Uhm, but isn't that just as "getTokenImage(30)"? How does that give the value of the picture's original size? When you retrieve an asset without specifying size it has no size attribute that could be extrapolated.
yes thats the same. To extrapolate its size you use:
Wiki: getTokenHeight()
Wiki: getTokenWidth()

I don't think that you can use this function for e.g. thus a table image, only Tokens, but there's an easy way to get around that should that be an issue.

User avatar
Irrlicht
Dragon
Posts: 426
Joined: Mon Feb 09, 2009 10:53 am

Re: Can token properties be deleted?

Post by Irrlicht »

I'm unable to get the true size of the handout through those.
I tried swapping token's image and handout temporarily to get the size, but it only returns the token's width/height, which is the same no matter what its image is, and it looks like setSize() can't be used to temporarily set to free size to get the true w/h.
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Can token properties be deleted?

Post by wolph42 »

Hmm now I recall. You're right, MT does not support that. It shouldn't be too hard to implement, but you'll have to request it as a feature

User avatar
Irrlicht
Dragon
Posts: 426
Joined: Mon Feb 09, 2009 10:53 am

Re: Can token properties be deleted?

Post by Irrlicht »

On my way, thanks.
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."

User avatar
Irrlicht
Dragon
Posts: 426
Joined: Mon Feb 09, 2009 10:53 am

Re: Can token properties be deleted?

Post by Irrlicht »

I didn't want to open a further thread for such a little thing, when this had already become sort of a multi-topic thread...

Well, I thought the switch roll option was faster than using many ifs, since it had to check for a single match while each if had to be checked separately. To test it (since I don't have valid testing tools), I made a macro with a roll and 400 ifs. It took about half a second to run.
Then I made a switch with 400 cases. After a minute of computing, I had to terminate MapTool and the fan of my pc is still spinning so much it could cool nuclear reactors.

So, does that happen only if the cases are too many, and switch is otherwise faster if there's only a handful of cases, or are ifs always better (and thus, why would I ever want to use switch?)?
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Can token properties be deleted?

Post by wolph42 »

Couple of things
- Read the speed up macros article in my signature
- Note that I have a benchmark macro created exactly for tuner kinds of tests, it's in the BoT. Basically you put two (or more) macros to compare in a special group on lib:eventmacros, hit the 'benchmark' button and read the timing results
- I think you made a mistake somewhere as switch is significantly faster than if irc even with a single case, however having 400 cases that the MT parser has to parse in one go, could be something it doesn't like and choke on it.


_am also wrote something on the next page

Post Reply

Return to “Macros”