Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Script] HERO System scripts to automate the combat (where possible) and more...

Dodging and targeting from what I have seen so far have worked wonderfully. I have tried different ways to break it. Blocking however, perhaps I am doing something wrong is doing nothing. I mean literally nothing, the character isn't mark as acted or aborted or anything after blocking (and selecting itself as the target) Another minor thing, if someone is taken out of the fight is there an easy way to remove them from the list of characters in the turn sequence so I could remove them from the board if needed or at least so their turn doesn't come up?
It works for me... it puts the bolt-shield marker on the target token (with the number of phases of duration shown on it) and a black-flag if the token's acting phase isn't the current one, or the archery-target if it is. It puts the sum of the OCV bonuses in the tempOCV attribute (and the dcv bonus in tempDCV, if any), and every attack the token receives while the block lasts is checked (at a progressive -2) before the hit roll. As soon as a block is failed, the effect ends. Did you copy/paste the macro and the string I put few posts above? Is any error thrown? About removing a token from combat: No, I didn't write a function for it, nor I did write one to insert a token later when the combat has already started. I thought about doing it a few times but then there was always something else more urgent to do... I will look into it as soon as I have some more spare time. Unfortunately there is no "quick and dirty" way to do it as you have to consider effects and maneuvers that change the attributes of a character. When someone enters combat you have to load those effects, and the same goes for when someone gets out of combat, you have to check if any effect/maneuver is still affecting him and change the attributes accordingly (to their usual values).
Yeah, I copy/pasted the macro above. No, it does not throw an error. After selecting the target it just does nothing, as if the script ended without doing anything. I will take some time to troubleshoot it and let you know what I find.
Oh wait, I lied somewhat. What you posted above was: "!herohit block;@{selected|token_ide};@{target|token_id};abort" which drops an error, so I figured you fumble fingered and changed it to this: "!herohit block;@{selected| token_id };@{target|token_id};abort" I put in bold what I changed. Is this correct?
Looking in the script I don't see yet what may be causing it to bomb out (oh and it sends a blank message to chat). However, I do see it is using your new mainhand and offhand system which I do not have set up on my tokens. Did I miss that you have that implemented and I shoudl set up tokens with main and offhand?
Sorry about the mistyping! No, in my successful tests none of my tokens had their mainhand or offhand strings set. The script will ignore them if they're not present.
It is a problem with the macro. Please copy/paste your macro in here. I put in some debug messages, and when I send the block string !herohit block;@{selected| token_id };@{target|token_id};abort it does not even get to the line " isHit = hitRoll(stringa);" I put a debug message just before that line (around 1488) and the debug message does not fire when I send that block. It works when I do an attack or dodge etc. So I changed the string sent in chat to !heroHit block;@{selected|token_id};;abort and this worked. So there is something with the @{target|token_id}. I couldn't tell you what, maybe you would know.
Son of a..... up top in your macro, please capitalize Hit in heroHit... smh. How did I not see that to begin with?
Sorry about that, some time ago I had changed it to be case-insensitive, but evidently along the way that change was somehow reverted without me noticing it. To answer your question, I didn't see it either, since I was looking everywhere but there... I made a little change in autocombat to cover the situation where someone blocks for another character. It didn't consider the blocking character "acted" since the bolt-shield was only on the target token. Now the shield is on both tokens, but of course the "attacker" is not blocking for himself nor he has any bonus on his temp attributes.
1388814771

Edited 1388814883
No worries. *edited* answered the question myself by looking in the comments
1388822518

Edited 1388825505
Fabio M.
KS Backer
Glad you found it. This is a an example for a 3d6 Healing (simplified rules): In journal's abilities: name of the ability: [healing] content of the ability: {effect}aid:3d|normal|hasdef:no|freq:o|duration:0s|counter:0|on|desc:Healing Hands|nostatus|heal{/effect} String in token's gmnotes: {healing}0|spellroll-3|end3{/healing} Edit: For completeness, the macro to launch it would be (as usual): !heroHit healing;@{selected|token_id};@{target|token_id}
Now you can add tokens into combat with the !combatadd command, and remove them with !combatremove. Re-download heroturntracker2.0
Is there an effect for resistent defenses to simulate things like a forcefield belt or shield spell etc? I found the healing but could not find this after quickly looking. It probably is staring me in the face
Yes, there is an example: look for energyarmor .
Oh so you just make it an aid? Clever, since that really is what it is doing. I gotcha. Awesome.
1388870759

Edited 1388870850
Fabio M.
KS Backer
Yep, the only difference is the heal argument to tell the script that the aid must not go over the max for those attributes. Edit: oh, sorry, you were talking about the armour...
Another little change: Now weapons can apply an Effect on hit or on damage. This Effect is like any other Effect (so it can be any power emulated by the script), and can be applied to the target of the attack or to the attacker. Now is possible to have magic weapons that do something more than just gifting the wielder with a bonus to hit! effects and autocombat have been updated. Please read the comments in autocombat for the instructions on how to use this feature. Also made some other adjustments and fixes on calculations done during combat (yesterday we had a game session and we could test some other aspects of the combat).
Updated again to allow more than one Effect for each weapon. Changed autocombat and effects scripts.
I should get some testing this upcoming weekend. Work got a little crazy.
These scripts will play a major part in whether I subscribe to Roll20 - our group plays a lot of HERO and this really would make it easier to run campaigns on here. Just had a quick look, but I like what I see so far.
Thanks, I can say It changed the way we play, and for the better. Even with the current bugs these scripts really help us to go through battles quickly (but still enjoying the action). It leaves us more time for the actual role-playing. I think the subscription is worth every cent since the API scripts (not necessarily mine) can radically change your experience. By the way, we play once a week (or a fortnight, depending on people availability), so after each session I usually fix a bug or two. Always check on Gists to see whether there is a newer version of the scripts, if you're going to use them. And sorry for the complexity of the setup and the usage, but I couldn't find a more user-friendly way to implement all that stuff...
I have only had brief usage so far. This weekend is my face to face Champions game (I drive about 400 miles round trip for it) so I won't be in Roll20 and my work has consumed a large amount of time the last 2 weeks, but probably after this weekend I will delve more in to it. With the lighting and API scripts I am very happy with my subscription so far. And Fabio, these scripts are great. They cover a LOT of things that happen in a Hero game. I am thinking of trying to get a wed night star hero game going and then I will be able to help/suggest more with the scripts. BTW I have only used this with square grids so far. The little I played with hex it was hard to get tiles to align properly. Do you guys use hexes in your games? (I prefer Hex to square most of the time)
We do not use a grid. I used a hex grid when playing our tabletop sessions, but with the tools at our disposal on Roll20 (and now the scripts too), we feel there is no need for a grid most of the time. Some of our maps have a square or a hex grid on them, but we use it just to have and idea of distances at a glance without having to resort to the ruler. And since we do not not enable it in Roll20, there is no snap anyway. I know that in some circumstances (flying, vehicular movement, AoE cones, etc.) a hex grid would be needed, but I prefer to just draw a shape or a line in Roll20 to trace the path or the AoE to keep things smooth. In the rare occasions in which it is really important, hex is the way to go for HERO (but I used it maybe once or twice so far).
Bloody simple. You know, in maptool I used no snap a lot for things and preferred it that way. I am not sure why I did not think of that for roll20. I prefer no grid at all as well.
1390076305

Edited 1390076873
Ah... ♥ I just started a Heroes campaign and i am looking to upgrade myself with API scripts. Can someone create an svn server with the stuff so we can check in bug fixes? Is going open source with that stuff ok for the original creator?
It is already "open source" since all the code is public and you can do whatever you want with it. But you're right, a svn server is better if more than one people fiddle with the code. I created an account on RiouxSVN (free) where I put all the scripts. In order to use it, though, you need to create an account yourself (free) and then I can grant you the rights to access (and modify) the code.
Updated the autocombat script to allow specifying a percent chance to apply an effect (with an item/weapon) on top of on hit or on damage. Details in the notes at the beginning of the script, the parameter is "effchance".
Thank you for posting these macros. Now for a total noob, can anyone help me get started using the character creation macro; createjournal? I have tried several times to get these macros to work using Firefox browser (not sure if that info is helpful). I copy/pasted the createjournal into a macro and saved it. When I press the test or linked button to the createjournal macro, it spits out the macro line by line into the chat with a blue background. Nothing appears in the journal. If I type !newsheet 'name' into the chat, nothing happens. I have tried capitalizing, used ""s and no quotes, I added spaces. I have selected a token and not had a token selected. I cant think of many other ways to get the macro to work. I need help just getting the basics to work. Other macro work that I have made/copy from the forums. Love to get help getting these macro to work too.
I think I found the problem, I need to be a mentor for API to work.
Yep, they are not macros but scripts, if you are not a mentor you cannot use them. Sorry I didn't notice you had no mentor badge.
Updated the scripts, fixed a lot of bugs. Now the spells can apply other spells, while previously only weapons could apply an effect. With this system it is now possible to emulate a tranfer (drain on the target that applies an aid on the caster). Also added some other switches for the weapons: nostun - Weapon causes no stun; nocrits - Weapon cannot cause critical hits; Now also weapons can require a spell roll to apply an effect. It is also possible to specify a different name for the skill required, in case the roll is not on the spell casting ability (default = "spellroll"). For example, a runic weapon that applies a specific effect, could require the wielder to roll a "runic" skill to succeed. The syntax is: spellroll-2/runic (in this case meaning a malus of 2 on the roll that is checked against a skill named "runic" in character's journal). Re-download all scripts following the links provided.