#"I Am The Firewall" Macro
1 messages ยท Page 1 of 1 (latest)
For the name, are you talking for file name or a different location?
Will look into the error when I get home
You leave out the word "the" pretty much everywhere - in the filename and in the labels for the Active Effect.
naming is fixed
did you do this as a normal macro?
Yes.
I am unable to reproduce that error, can you send me what you have in the macro itself? I want to confirm that there isn't an error somewhere on what github is showing
do you have a token on the scene selected when you execute the macro?
I also pushed a fix for a different error that I was getting
Yes.
What version of foundry are you running? I built them in version 11, so something may have changed
v10. They're off for testing purposes, but I have too many modules I use that didn't make the transition to v11. I won't be moving to v11 until SR5 forces me to.
Ah... fixed it.
I wonder if v11 defines "actor" in a global scope that v10 doesn't allow.
I changed all references to actor as the variable to hacker and it gets a bit further.
Fixed canvas.tokens.objects.childern; to .children
Now dies a few lines later with:
well I define actor in the script which I wonder if v10 did something with that or maybe one of your macros
I was gonna just change everywhere I use the variable actor to something else so that it doesn't happen to anyone else
I just pushed the change. did it on rally and calibrate as well
I'll poke at it some more later, but for now, I need to get back to work.
I feel that one
So... I'm back poking at this. Why are you looking at prototypeToken.disposition instead of the token directly? A token's disposition can be changed once it's on the canvas and what's on the prototype may not match it's use in a given scene.
because I already have an array of all of the token actors. The actors do not have the token on them. they have a prototype token on their object
Okay... but that's not going to give you the disposition as set on the scene. The on-scene disposition is part of the Token, not the Actor or the Actor's PrototypeToken.
I've tweaked it in my version to check element.document.disposition, which I think captures the correct value on the token.
actually, that is whole line is a hold over from a set of data that I was getting on an older version of either SR5 or foundry. I missed the fix on that macro although rally/calibrate have it updated
Yeah... element.document.disposition is the right thing to reference. If I take a PC token and set it to Hostile, it isn't included even though the PC's prototype is Friendly.
Also, why are you using mode: 2 on the AE? Generally speaking, you want to use mode: 0 which is the system's custom handler. I'm not sure precisely what it does behind the scenes, but as I understand conversations with @rigid sandal it has some smarter logic behind it.
2 is just add
I will see if I can find clear documentation from foundry on what the different values are
Also on the AEs, you appear to be using .name... Do they properly show up with a name in v11? Because in v10, it's .label.
they replaced label with name in v11
PITA...
I wondered when that replacement took place exactly. So what I will do is just put both in, as an extra field does not hurt anything
function findObject() is declared, but never used.
That was used for looking up different item names where there were multiple possibilities. May do a rev 2 where it can find every ar based item to see if you could theoretically be running in ar
I will pull it out for merge but will keep it around to play with on my local
So, this is the version I'll be using (before some house-rule specific adjustments).
I removed the device check, because one issue the system itself has is that you can't disable a Character's matrix Device without deleting it. You can toggle between multiple devices, but one of them is always active. It's checking if one exists but not if one is in-use (and there's no UI method I'm aware of to disable the one an Actor has).
I also deleted the VR check because there is currently no UI I'm aware of to set that particular value.
I like how you pay attention to i18n strings for the skill names instead of hardcoding them.
i18n?
A short hand for "Internationalization" (because it's a long friggin' word - an "i", 18 letters, and an "n"), aka the translation strings.
It's something that will go away in my final version, because I'm using custom skills that aren't set up for translation. ๐
ah, haven't come across that short hand yet
It's an industry term: https://en.wikipedia.org/wiki/Internationalization_and_localization
In any case, a more advanced/elaborate version of this would include putting a slightly different version on the originating character. I think Effect Macro can be set up to trigger on the Actor's turn. If so, I could embed a macro to go through and remove the AEs from friendlies.
In fact, you might want to include a macro to cycle through and remove them. Right now, it has to be deleted manually which isn't terribly onerous.
I wonder if a macro can detect a keyboard state when it's activated, like... could you set it up so if you CTRL-Clicked, it would run a removal operation intead of the roll-and-create operation.
maybe, I am thinking about ways to remove all of the effects from characters. with the unlinked tokens it won't stay past the life of the token on the field. but for the linked tokens that could be an issue
Sure, but IATF isn't a long-term bonus. It expires on the hacker's next turn.
That is something you can set on AEs, of how long they last in rounds and turns
and is it next turn or next pass?
Kinda... there are duration settings, but they don't actually do anything unless you've got some other module managing time. The system doesn't do it inhernently.
In SR5 alone, the only thing having a duration does is determine whether or not the AE is categorized as "Temporary". All that does is determine whether or not an icon shows up on the token.
really? well damn
Yeah, the AE system was ripped out of D&D5E, which doesn't automate much as a opinionated design choice. D&D5E has lots of things to be hooked into, but leaves them to modules to automate.
does the effect macro "on combat turn starting" work for each round or no?
I'm not sure. I haven't looked into it yet.
also, I believe the hot-sim button sets VR to true
I read some of the documentation, and I think it has one for top-of-turn and one for combatant's-turn.
If it does, its wrong. Cold-sim VR is a thing that exists. It should be toggleable without being in Hot Sim.
oh I know, there is no button for cold-sim sadly (as that also changes the init dice pool
Actually, does toggling to Matrix Initiative set the VR flag?
If it does, that'd be a valid reason to use it as a key.
it might, hotsim has its own flag
Yeah, which adds an extra die to Matrix Initiative. I'm not in a position I can test much right now.
I am looking at it now. matrix init doesn't seem to change any flags outside of what init is used
Yeah... I suspect that VR flag is for not-yet-implemented-feature.
yea, I think you may be correct. I will leave the check in as it is not hurting anything as it is looking for vr to be false
It checks if an IATF effect already exists, if it does, it deletes it, then makes a new one. Why not just update the existing one if it's already there?
the issue comes when there is not an effect already existing
if-exist, update, else create. I have it working fine.
I also have it rigged to do a pass and delete them all if you invoke the macro while holding down CTRL.
This has my house rule adjustments in place (different skill, half-hits for the bonus), and I renamed the variables so they're different from elements of the object paths, but you should be able to figure out the rest.
effect.update won't work as that is something from Effect Macro and not foundry
nvm, that might work. missed the find call
It's not, it works just fine.
Yeah, effect is a variable defined by your code. EM does handle it as a special keyword when invoked inside/by EM, but we're not doing that here. .update is standard Foundry.
surprised .update worked there given it doesn't always work on embedded objects
why did you have those do an await as well? since they are the end of the script?
No clue, I'm just playing copy-paste monkey. I don't really know the API or JS at all.
It would make sense to await the return if you have more to do after, but since it just ends there you could just do without it
The basic logic I get, but I don't know the language. ๐
ah. await is for an async call you need the response from before continuing on
I am going to look into if it is possible to add a special effect to the decker to used the skill to remove the effect on the start of their next turn. As it turns out the Effect Macro "On combat turn start" does trigger for SR passes
That would be even better that the CTRL function I built into it.
The unneeded awaits are the two inside the if (effect) block, yeah?
yea
My current issue is figuring out how to add that functionality in the script as I do not see the effect macro script under the effects on the character. So not sure how they are stored yet
They're stored in flags:
would not have thought to look under flags. was looking at several other possibles
Almost anything that a module creates is going to be stored as a flag. It's pretty much the only place they're meant to put arbitrary data.
good to know
I noticed a bug with unlinked tokens. the effect is put on both the token actor and the actor in actors side bar. I will try to pull the token actors only and edit their effects
So a rework is in order
You will need to do the changes you need for your custom skills. but this now adds an effect macro to the decker that when it is their turn in combat again it removes the macro from everyone including themselves
Having a look at this now...
displayMod and displayPool are declared, assigned values, then unused.
findObject() is still declared but unused.
You're still getting the decker's disposition from the prototype token, not the canvas token.
You may want to have it check for a selected token before doing anything, something like...
if (canvas.tokens.controlled.length != 1) {
ui.notifications.warn("Please select a single hacker's token.");
return;
}
...as the very first thing. Otherwise, it'll fail silently from the user perspective.
Um... well... it doesn't appear to work at all. It never gets to the console.log(target.name); after element.actors.forEach(target => { in v11 and silently fails to do anything. In v10 it throws an error at that forEach loop:
can you confirm if v10 has canvas.tokens.documentCollection?
Nope... and I'm not saying it doesn't, I'm saying I don't know how I'd go about confirming it either way.
in console type it in and see what it returns
if it doesn't exist it will return undefined
It exists.
can you send a screen shot of what it returns?
turns out so do any skill macros that you drag from skill list down to macro bar. So that is a bigger bug than just the my macro. I will put that in so my stuff has error handling at least
interesting, I am not getting this with only having effect macro installed
What makes you think Effect Macro is involved at that stage?
I don't, I am saying it is the only module I have installed and it is working. So I am wondering if one of the modules you have running is messing with it some how
I don't have a v10 to test on
I have no modules active on my v11 test world, it still does nothing. Something around that point is failing silently in v11 and failing loudly in v10. It's still failing in the same place.
does v11 show target.name at all in the logs?
No. I said that "It never gets to the console.log(target.name);"
add a console.log just before the changes.push line and see if that is ever displayed
I wonder why it works for me and not for you. what browser are you using?
Chrome.
now I am really confused
That is the same script I shared to you, just have added the ui warn piece
The console before changes.push fires.
move it to inside the first forEach but before the second
damn version changes. v10 has it as _actor while v11 has it as actors
Here is one that should work on v10, I went and downloaded a windows exe for v10
It's a while back in your conversation, but, here I go:
The modify mode (mode: 0) understands values with .base, .value and .mod and allows for easy modification of them. Attributes, limits, skills, and so forth fall under that category.
While add (mode: 2) only adds the value on top of the given key (.base or .value), the modify-mode will add the value always into .mod, no matter where the key actually points (system.attribute.body.value, system.attribute.body.base or just system.attribute.body). This allows for ActiveEffect changes to show up in the little value pop ups (see attributes) and be more transparent.
The modify mode also uses add as a fallback, should the given key not point to something with a .mod (for example modifiers).
So basically: Always use modify or overwrite (which also has system specific handling btw, but does the same in practise)
ah, good to know. will make sure I use either mode: 0 or mode: 5 on things
while you are here taM, any idea why the script would work for one of us and not the other when we both only have effect macro module and are both on chrome with v11 of foundry?
Any errors in console?
not on v11, T.J. is saying it is failing silently
Nothing that is obvious. If it's related to T.J.s world, I'd expect some error... so maybe the script isn't actually executing somehow
Maybe paste it into the F12 console directly and this would give an error, if there is one to be had
corrected v10 variant of the script
That seems to work... though there is a new issue! (New issues are progress!)
The var decktoken bit is relying on the token and the actor having the same name. This is not guaranteed to be true.
yea I noticed
the other option is to check by id. when I wrote that section I was still hopeful of only one script for both versions and since fields like that may have changed I didn't touch it since I new name didn't
now that I have two different ones, I will adjust to look for id
I wouldn't have even noticed at all if well... I wasn't doing it. I've got a character that the players don't know the name of. They call him "The Kid" because that's what he is, so that's what his Token is called.
Looks good!
for v11
BTW... I figured out why you may not have realized that Temporary Effects generated an icon on the token: the AE needs to have an icon set. If there's nothing to display, there's nothing to display.
That would do it, and I have not figured out or created an icon for it yet (I want to have one for each of the macros that are character actions)
This is the one I use for IATF, though the colors are specific to my style guide - I use those green and grey shades for all matrix-related things.
I use this for rally:
I have one I use for Calibrate, but I'm not happy with it, so I'm not going to share it.
guessing you made those?
They're modified from https://thenounproject.com/, and I have royalty-free rights to use them as I please.
Hrmm... nope, still has an issue. The disposition checking isn't working.
on which one?
v10.
paste this into console and then tell me what it returns
let decker = canvas.tokens.controlled[0].actor;
let deckid = decker._id;
var decktoken = canvas.tokens.documentCollection.filter(element => {
return element.actorId === deckid
});
let deckalliance = decktoken[0].disposition;
deckalliance
is this on the v10 you shared with me?
Yeah. Feel free to hop in and have a look. The tokens inside the hexes are all friendly. The Kid, who is the responsible adult actor is in the middle of the second row. The three above the hexes are Hostile, the "Mr. Crate Actor" in between them is neutral.
The only change I made to the macro is adding the icons so they show up on the tokens (makes it easy to see which ones get it).
I kinda like seeing the scrolling text rain down across the screen with that many tokens. ๐
I think I got it that time
I'm gonna check something, gimme a second...
I saw it, fixed
You need to add the target check on the removal, too. The Friendly was removing from the... he he he. Okay. ๐
forgot to update the removal script part
If I haven't said it before, I really appreciate all the effort you're putting in to this. I am so happy to see all the recent interest in the SR5 implementation.
I moved from theater of the mind to foundry because of too many times where a map was needed. And it is cheaper for me to run with the same or better functionality as roll20
Yeah, I've got one player that's about 3000 mi from the rest of us. We'd be playing in person if he weren't. It was never my preferred system, but I did D&D5E via FGC/FGU for a long while... until I just couldn't stomach running D&D anymore. I came to Foundry because FG's SR support was somewhere between non-functional and non-existent (but still published) depending on version. I found Foundry and never looked back (R20 was never on the table).
I have one player who loves roll20 and likes to complain about foundry not doing something correctly. So I just find a module to make it do the thing
Here is a v11 that has to be different from v10 because of field changes
Can't speak to the v11 version, but the v10 version seems to work great. I'll let you know on Friday morning if my group manages to screw it up. ๐
ok, hopefully someone will be able to test th v11 outside of myself
once I get this svg edited to all white I will be pushing a new commit up
Which one? I can do it pretty quick. ๐
the firewall one, I have it white. trying to figure out how this extension in vscode can save it
Oh. Can't help ya' there. ๐
I am about to just edit the text manually. would probably have been done by now
I like the colors... I've got a whole scheme setup, certain colors for certain things: http://wiki.s3.privateworks.com/index.php/SVG_Style_Guide
But that's getting off-topic for this thread....
feel free to approve the PR if rally and calibration both work as well
If I need to do a v10 version let me know
I haven't checked them yet. Maybe tonight (it's noon local). I do have to spend some time doing my actual job today. (I joke, I've been doing it between other things... some of my work is firing shit off and waiting for it to finish.)
If I find issues with them, I'll make a separate thread. I think we can close this one out now.
lol, it is the same for me. I am noon local now and the work I have atm is documentation for soon to be development work
So... I just discovered a fundamental flaw.
Users cannot add or remove Active Effects to actors they do not own.
This works fine if the GM rolls it. It doesn't work if a player does.
oh.... well that makes things more difficult
There are ways to do it, something about socket commands and bouncing things off the GM user, but I wouldn't even know where to begin.
can the observer level work for them?
Nope. Has to be owner.
Me doing the roll instead of them was far better than me having to do all the adjustments manually, though.
So... big step in the right direction.
It appears it may need a new module to work. There is one called Warp Gate that might be able to do what we need
Yeah... Warp Gate does have a bunch of functionality for things like that.
It may help with other ideas well. I will look into using it for an update change on the script
@errant shuttle, I got it working from the players end. does need a new macro though
I figured. I saw you going back and forth with Warp Gate stuff.
The only downside is I think I still have to have a v10 and v11 version. although we are now down to just the name/label issue
if you want to see if the v11 just happens to work for you I can send it over and you can give it a try
Shouldn't you just be able to do both and let it complain?
Besides... @rigid sandal and I were talking earlier, and I may be forced into v11 soonish anyway. 
no because this time warp gate is having an issue in referencing (it uses the old v10 method still, so v11 has to force a call)
I am not surprised. which modules are you concerned about again?
Perfect Vision, Multilevel Tokens, and the suite of DF modules.
I think the colored global lighting thing I use PV for is going to be core in v12.
Sadly, there is no replacement for MLT's cloning function, which is the best way I've found to do multi-level scenes.
once I figured out how to use rippers levels module it is not bad. There are still some things I need to figure out with it though.
like how to make actors only appear on certain levels
I got the background to work though
What are the DF modules?
DFreds?
Nooo... FlameWave's stuff... https://github.com/flamewave000/dragonflagon-fvtt
He's pretty much dropped off the face of the earth, near as I can tell.
oh, and the last release was a while ago
Yeah...
The curvy walls looks really handy. Wish I had that for some of my google maps I have made
We should take this to main channel
@raw kernel I had a few minutes to test the latest version of the macro. The apply works, the remove does not. It fires and Warp Gate prompts for approval, but nothing happens. There are no errors or warnings in the console.
let me make sure I pushed the change to make that work
I see the issue, I missed the change on it for v10
Another label vs name thing?
yep
check line 107 on your macro and you should see it say name instead of label
I will put that edit in my next pr into main
this line
warpgate.mutate(element,{embedded: {ActiveEffect: {"I Am The Firewall": warpgate.CONST.DELETE}}}, {}, {permanent: true,comparisonKeys: {ActiveEffect: 'name'}});
Yeah, I found it... it didn't help.
Also, I noticed that AE doesn't have a name. Should description on 119, 142, 150, and 166 also be label?
No, I had an impromptu mini-session with a player tonight so I was trying it live.
I wonder if it is something with warp gate
the macro works on v11
let me stand up my v10 server and see what it is doing
I'm on my test server now.