RPTools.net

Discussion and Support

Skip to content

It is currently Mon Nov 20, 2017 1:44 pm 






Reply to topic  [ 57 posts ]  Go to page Previous  1, 2, 3, 4  Next

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Codeum Arcanum (RPTools Founder)
 
Joined: Mon Jan 09, 2006 4:16 pm
Posts: 11390
Location: Austin, Tx
 Post subject:
PostPosted: Wed Aug 20, 2008 4:08 pm 
Moved to documentation forum and stickied

_________________
Dreaming of a 1.3 release


Top
 Profile  
 
 Offline
Dragon
 
Joined: Sat Dec 22, 2007 5:37 pm
Posts: 358
 Post subject:
PostPosted: Fri Aug 22, 2008 6:13 pm 
Hello,

I am rather new to macro programming. Can I have parts of a macro simply fulfill the function without giving output in the Chat window?

For example:
{token.name} takes {DamageValue} points of damage!
<br>Now {token.name} only has {HP = HP - DamageValue} hit points

If I wanted to place this on NPCs, I would not want the info after the BR to show in the Chat window.

Thanks for the help!
E


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5412
 Post subject:
PostPosted: Fri Aug 22, 2008 6:32 pm 
Elorebaen wrote:
Hello,

I am rather new to macro programming. Can I have parts of a macro simply fulfill the function without giving output in the Chat window?

For example:
{token.name} takes {DamageValue} points of damage!
<br>Now {token.name} only has {HP = HP - DamageValue} hit points

If I wanted to place this on NPCs, I would not want the info after the BR to show in the Chat window.

Thanks for the help!
E



No, you can use /self to only send to yourself or /gm to only send to you and he GM, but it's all or nothing within a macro.

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Sun Aug 03, 2008 6:17 pm
Posts: 85
 Post subject:
PostPosted: Fri Aug 22, 2008 8:32 pm 
Elorebaen wrote:
Hello,

I am rather new to macro programming. Can I have parts of a macro simply fulfill the function without giving output in the Chat window?

For example:
{token.name} takes {DamageValue} points of damage!
<br>Now {token.name} only has {HP = HP - DamageValue} hit points

If I wanted to place this on NPCs, I would not want the info after the BR to show in the Chat window.

Thanks for the help!
E


What I have done (not really macro related, but) is create a separate property set for monsters/NPCs. Then (among other stuff), I set this property in there:

*#HP

Every macro that changes HP works with it, because it's the same property name, but it'll only show the NPC's HP (on the statsheet) to the GM.


Top
 Profile  
 
 Offline
Giant
 
Joined: Wed Jul 30, 2008 2:43 pm
Posts: 199
 Post subject:
PostPosted: Fri Aug 22, 2008 8:35 pm 
Elorebaen wrote:
Hello,

I am rather new to macro programming. Can I have parts of a macro simply fulfill the function without giving output in the Chat window?

For example:
{token.name} takes {DamageValue} points of damage!
<br>Now {token.name} only has {HP = HP - DamageValue} hit points

If I wanted to place this on NPCs, I would not want the info after the BR to show in the Chat window.

Thanks for the help!
E


As jfrazier said, you can't have players and GMs see different parts of the output. However, you can comment out the second line (using <!-- -->)so that the effect takes place but nothing is printed to the chat window.


Top
 Profile  
 
 Offline
Dragon
 
Joined: Sat Dec 22, 2007 5:37 pm
Posts: 358
 Post subject:
PostPosted: Sun Aug 24, 2008 3:10 pm 
Thank you for the responses!

Also, I forgot to mention, thank you for the tutorial!!


Top
 Profile  
 
User avatar  Offline
Giant
 
Joined: Mon Aug 11, 2008 8:24 pm
Posts: 118
 Post subject:
PostPosted: Tue Aug 26, 2008 3:51 am 
jfrazierjr wrote:
No, you can use /self to only send to yourself or /gm to only send to you and he GM, but it's all or nothing within a macro.

This is on my to-do list of things to fix (allowing multiple commands within a macro), but based on the evaluation I did while waiting on roll syntax feedback, it'll take a fair bit of effort to get it working

So, eventually, maybe.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5412
 Post subject:
PostPosted: Tue Aug 26, 2008 7:10 am 
Mr. Pokeylope wrote:
jfrazierjr wrote:
No, you can use /self to only send to yourself or /gm to only send to you and he GM, but it's all or nothing within a macro.

This is on my to-do list of things to fix (allowing multiple commands within a macro), but based on the evaluation I did while waiting on roll syntax feedback, it'll take a fair bit of effort to get it working

So, eventually, maybe.


Hmm... I wonder if you can hook into existing mechanics like what you are doing with tooltips. For example:

/me does super foo [/gm "I actually user super bar instead"]

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
User avatar  Offline
Giant
 
Joined: Mon Aug 11, 2008 8:24 pm
Posts: 118
 Post subject:
PostPosted: Tue Aug 26, 2008 12:58 pm 
jfrazierjr wrote:
Hmm... I wonder if you can hook into existing mechanics like what you are doing with tooltips. For example:

/me does super foo [/gm "I actually user super bar instead"]

Nah, it'd just be done using the multi-line macro editor, and each line would be a separate command. In theory you're supposed to be able to use newlines to automatically insert <br> tags, but since there's a bug that prevents that from working at the moment, I don't feel too bad about changing the (intended) behavior.


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Mon Jan 07, 2008 10:44 pm
Posts: 438
 Post subject:
PostPosted: Wed Aug 27, 2008 5:15 pm 
Hi, I'm trying to make it so that when a monster reaches its bloodied value, the bloodied state will show up. I tried this and variants of this but wouldn't work.

{ if (HP==30, [state.Bloodied = 1], [state.Bloodied = 0] ) }

What is the correct way to do this?


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5412
 Post subject:
PostPosted: Wed Aug 27, 2008 5:28 pm 
Mr. Pokeylope wrote:
jfrazierjr wrote:
Hmm... I wonder if you can hook into existing mechanics like what you are doing with tooltips. For example:

/me does super foo [/gm "I actually user super bar instead"]

Nah, it'd just be done using the multi-line macro editor, and each line would be a separate command. In theory you're supposed to be able to use newlines to automatically insert <br> tags, but since there's a bug that prevents that from working at the moment, I don't feel too bad about changing the (intended) behavior.



Ummm what? What bug are you talking about, cause it may not be a bug....

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
User avatar  Offline
Giant
 
Joined: Mon Aug 11, 2008 8:24 pm
Posts: 118
 Post subject:
PostPosted: Wed Aug 27, 2008 5:31 pm 
Plissken wrote:
Hi, I'm trying to make it so that when a monster reaches its bloodied value, the bloodied state will show up. I tried this and variants of this but wouldn't work.

{ if (HP==30, [state.Bloodied = 1], [state.Bloodied = 0] ) }

What is the correct way to do this?

{state.Bloodied = if (HP==30, 1, 0) }

Although {state.Bloodied = if (HP <= MaxHP / 2, 1, 0) } would probably be a better way to do it? (Assuming you've got a MaxHP property set.) Using <= so that the monster doesn't have to be exactly at the bloodied value for it to be set.


Top
 Profile  
 
User avatar  Offline
Giant
 
Joined: Mon Aug 11, 2008 8:24 pm
Posts: 118
 Post subject:
PostPosted: Wed Aug 27, 2008 5:41 pm 
jfrazierjr wrote:
Ummm what? What bug are you talking about, cause it may not be a bug....

If you have the following macro:
Code:
foo
bar
the documented behavior is that it will replace the newline with a <br> tag. The code to do this exists, but there's a bug in it and the replacement doesn't actually happen. So instead of "foo<br>bar" you get "foo\nbar" (where "\n" represents a newline), which when rendered as HTML is printed as "foo bar".


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5412
 Post subject:
PostPosted: Wed Aug 27, 2008 6:41 pm 
Mr. Pokeylope wrote:
jfrazierjr wrote:
Ummm what? What bug are you talking about, cause it may not be a bug....

If you have the following macro:
Code:
foo
bar
the documented behavior is that it will replace the newline with a <br> tag. The code to do this exists, but there's a bug in it and the replacement doesn't actually happen. So instead of "foo<br>bar" you get "foo\nbar" (where "\n" represents a newline), which when rendered as HTML is printed as "foo bar".


Pretty sure it's NOT a bug. Basically, if I remember corretly, this was changed to NOT insert a br automatically because that messes upformatting of tables when someone tries to "prettify" their HTML code. everywhere there is a br tag, the table gets another empty cell that's about 3 px wide...

Talk to Orchard who originally reported the problem (though I had noted it before and had just not tracked down the cause) to make sure what you are doing won't cause his tables to go haywire...

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
 Offline
Dragon
 
Joined: Sat Apr 21, 2007 3:51 pm
Posts: 674
 Post subject:
PostPosted: Wed Aug 27, 2008 7:04 pm 
I have to say that I really prefer newlines in the macro code to NOT cause automatic <br> tags. That will just make macros so much harder to read, if the macro commands have to be on one long line or have random <br> tags in them.

But I admit I'm biased because I don't do much typing in the chat window directly. It's all in the macro editor, and losing line breaks there will make that little text area that much harder to work with.

If people want that functionality back, at least consider some way to turn it off, maybe with some option/code at the start of the macro or something.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 57 posts ]  Go to page Previous  1, 2, 3, 4  Next

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





cron

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman