RPTools.net

Discussion and Support

Skip to content

It is currently Sun May 26, 2013 3:48 am 




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. :)



Reply to topic  [ 5 posts ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 5499
Location: Netherlands
 Post subject: bug in exposePCAreaOnly and nifty trick (for 'workaround')
PostPosted: Wed Apr 25, 2012 9:06 am 
First the bug, which is difficult to explain, but here goes:

Situ:
- gm and player client connected
- Two tokens on a map: A and B.
- Player owns both tokens
- client view of player is centred on A
- A is selected

When Player moves a token an event macro is triggered that
1. moves token B in a relative path (so if A is moved 4 squares to the right, then B is moved 4 squares to the right) with the moveToken command
2. centres view of player client to token B
3. selectTokens(B)
4. runs exposePCAreaOnly()

If the player now moves B the commands 1 to 4 are triggered again but now for token A.

It turns out that exposePCAreaOnly does not (entirely) work in this case. If you cram some pauses in the macro you'll notice that after the exposePCAreaOnly command all the FoW is reset except around the selected PC token, however when the macro is finished the previously exposed area shows up again.

--------------------------------------------------------
The workaround. Might be useful in other circumstances as well:

Trying to fix this issue I tried the following:
- first I tried to defer the command, no result (old area was still exposed).
- Then I tried broadcast a macrolink… no result
- Then I tried broadcasting the macrolink to the gm client...no result
- Then I tried broadcasting the macrolink from the gm client to the pc client: Worked!! (finally)

However the command needs to be initiated after the player moved his token… so… I created a broadcast from the player client to the gm that ran a broacast from the gm client to the pc that ran the exposePCAreaOnly which worked!!

here the code:
last line after the event has been triggered on the Player client:
Code:
[broadcast(macroLink("", 'bounceDefer@lib:EventMacros', 'none', owners), 'gm')] 
owners is the list of owners of the tokens that just gained focus (so B in above example)
macro bounce defer is ran from the gm client:
Code:
[broadcast(macroLink("", 'deferResetFoW@lib:EventMacros', 'none'), arg(0))] 

deferResetFoW is again ran from the player client:
Code:
[h:exposePCOnlyArea()] 


Its quite an overkill on commands and traffic to just get the FoW reset, but I need this to work. This workaround might also work on the copyToken() issue. Didn't try, but who knows.

_________________
My stuff
Excel Tools: Table editor and Illumination Generator
MT Tools: Dungeon Builder Tool, Bag of Tricks: Teleport pads, Pits, Traps and Warded Areas and onMouseOverEvent
Framework: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade and Only War
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow

My dropbox referral. If you use this then both you and me get 500Mb extra space. 2.5Gb total.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 5307
Location: Bay Area
 Post subject: Re: bug in exposePCAreaOnly and nifty trick (for 'workaround
PostPosted: Wed Apr 25, 2012 10:40 am 
I'm familiar with this. Basically it's showing the exposed path of the last token. What I do is use tokens.denyMove = 1. Use moveToken on original to final x,y (or to each point on path) and so it doesn't go back to original spot, end macro with bringToFront or setTokenDrawOrder. exposePCOnlyArea should be run only once, otherwise it may cause an error.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5229
 Post subject: Re: bug in exposePCAreaOnly and nifty trick (for 'workaround
PostPosted: Wed Apr 25, 2012 12:46 pm 
As with the newbies... need more input. What are your start server settings? Are you trying to fire for each of the tokens(should really only be once). In theory, since macro calls are queued up and processed in order, you should be able to make a deferred called on the same machine. Then once the macro finished running on that machine, the deferred called is processed and all it does is the expose.

_________________
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
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 5499
Location: Netherlands
 Post subject: Re: bug in exposePCAreaOnly and nifty trick (for 'workaround
PostPosted: Thu Apr 26, 2012 2:37 am 
jfrazierjr wrote:
As with the newbies... need more input. What are your start server settings? Are you trying to fire for each of the tokens(should really only be once). In theory, since macro calls are queued up and processed in order, you should be able to make a deferred called on the same machine. Then once the macro finished running on that machine, the deferred called is processed and all it does is the expose.


q1:
-strict token ownership
-player can reveal vision
-auto reveal on movement
-use indiv views
-use indiv fow.

q2: no.
step 1:
when a token moves it new coordinates are retrieved and then with movetoken the other is moved accordingly. (all in one macro).
step 2 (another macro):
goto() (centre view) selectTokens() and exposePCAreaOnly()

These are not deferred macros. They're in a link.
I did try to defer them: same result (show the old path of the token).

Update: tried AM's trick, but that REALLY messes things up, besides the fact that its not working, the white line of sight outline becomes distorted. It looks like it takes the overlapping part of the vision cirkel of where the token was and of where it currently is so you dont get a cirkel outline but (I dont know the exact word for this shape, so the closest I can think of:) a straight crescent.

Ok I resolve (my) issue: turn off 'player can reveal vision'. Im using exposePCAreaOnly() anyway so its redundant, and it turns out that its also the cause for my issue.
Note that the bug thus remains!

_________________
My stuff
Excel Tools: Table editor and Illumination Generator
MT Tools: Dungeon Builder Tool, Bag of Tricks: Teleport pads, Pits, Traps and Warded Areas and onMouseOverEvent
Framework: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade and Only War
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow

My dropbox referral. If you use this then both you and me get 500Mb extra space. 2.5Gb total.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5229
 Post subject: Re: bug in exposePCAreaOnly and nifty trick (for 'workaround
PostPosted: Thu Apr 26, 2012 6:03 pm 
My first thing is "don't do that"... Have you tried without the selectTokens? It's really not needed anyway for the exposePCOnlyArea.. that happens automatically for all the tokens the calling player owns(assuming strict token ownership is on)

Its not a bug. As AM says, the issue has to do with a flow like this:

Token A move
token A reveals(via auto-reveal)
eventmacro fires(while this is going on the client is sending updates to the other connected clients ie, RACE CONDITION FORMS from previous step)
pcOnlyFog reveals
client gets manual moved token's reveal
client gets pcOnlyFOG but perhaps not based upon ummm some criteria I can't quite verify

At the end of the day, you are doing something that is not supported. If you want to use the move event to reveal, don't use the server setting.

_________________
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  
 
Display posts from previous:  Sort by  
Reply to topic  [ 5 posts ] 

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 are 2 users online :: 0 registered, 0 hidden and 2 guests (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 2 guests





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

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman