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

How do i make NPC rolls invisible to players in a roll template?

1512154420
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
How do i make NPC rolls invisible to players in a roll template? Below is the button. <button type="roll" name="attr_attackroll" value="&{template:GURPS} {{roll= @{core_roll} }} @{vs} {{target= [[@{skill} + @{modifier}]] }} {{attack_type=@{name}}} {{rollname=ATTACK}} {{damagetype=@{type} }} {{woundmod=@{wound_modifier} }} {{damageroll=[[@{damage}]]}} {{crit_hit= [[ @{critical_hit_roll} ]] }} {{crit-head= [[@{critical_head_roll} ]] }} {{crit_miss= [[ @{critical_miss_roll} ]] }} {{charactername=@{character_name}}}" />
Put /w gm at the beginning of the roll.
1512155280
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
<button type="roll" name="attr_attackroll" value="&{template:GURPS} /w gm {{roll= @{core_roll} }} @{vs} {{target= [[@{skill} + @{modifier}]] }} {{attack_type=@{name}}} {{rollname=ATTACK}} {{damagetype=@{type} }} {{woundmod=@{wound_modifier} }} {{damageroll=[[@{damage}]]}} {{crit_hit= [[ @{critical_hit_roll} ]] }} {{crit-head= [[@{critical_head_roll} ]] }} {{crit_miss= [[ @{critical_miss_roll} ]] }} {{charactername=@{character_name}}}" />
1512155357
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
Or here <button type="roll" /w gm name="attr_attackroll" value="&{template:GURPS} {{roll= @{core_roll} }} @{vs} {{target= [[@{skill} + @{modifier}]] }} {{attack_type=@{name}}} {{rollname=ATTACK}} {{damagetype=@{type} }} {{woundmod=@{wound_modifier} }} {{damageroll=[[@{damage}]]}} {{crit_hit= [[ @{critical_hit_roll} ]] }} {{crit-head= [[@{critical_head_roll} ]] }} {{crit_miss= [[ @{critical_miss_roll} ]] }} {{charactername=@{character_name}}}" />
Here <button type="roll" name="attr_attackroll" value=" /w gm &{template:GURPS} {{roll= @{core_roll} }} @{vs} {{target= [[@{skill} + @{modifier}]] }} {{attack_type=@{name}}} {{rollname=ATTACK}} {{damagetype=@{type} }} {{woundmod=@{wound_modifier} }} {{damageroll=[[@{damage}]]}} {{crit_hit= [[ @{critical_hit_roll} ]] }} {{crit-head= [[@{critical_head_roll} ]] }} {{crit_miss= [[ @{critical_miss_roll} ]] }} {{charactername=@{character_name}}}" />
1512157009
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
How can I link that to these radio buttons to turn it on/off? <input type="radio" name="attr_charactertype" value="NPC" checked="true" /> <span class="sheet-popup">NPC</span> <span class="sheet-tooltip"> Non-Player Character </span> <br /> <input type="radio" name="attr_charactertype" value="PC" /> <span class="sheet-popup">PC</span> <span class="sheet-tooltip"> Player Character </span>
My advice would be to create another attribute, wtype , and allow the user to set this to whisper (/w gm ) or public (no value). This is how most sheets handle this scenario. Then your button would become: <button type="roll" name="attr_attackroll" value="@{wtype}&{template:GURPS} {{roll= @{core_roll} }} @{vs} {{target= [[@{skill} + @{modifier}]] }} {{attack_type=@{name}}} {{rollname=ATTACK}} {{damagetype=@{type} }} {{woundmod=@{wound_modifier} }} {{damageroll=[[@{damage}]]}} {{crit_hit= [[ @{critical_hit_roll} ]] }} {{crit-head= [[@{critical_head_roll} ]] }} {{crit_miss= [[ @{critical_miss_roll} ]] }} {{charactername=@{character_name}}}" />
1512158614
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
So does this do it? <div class="sheet-box"> <input type="radio" name="attr_charactertype" value="/w gm" checked="true" /> <span class="sheet-popup">NPC</span> <span class="sheet-tooltip"> Non-Player Character </span> <br /> <input type="radio" name="attr_charactertype" value="" /> <span class="sheet-popup">PC</span> <span class="sheet-tooltip"> Player Character </span>     </div>
You could do that, but you lose other potential uses for charactertype.
1512158916
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
I screwed that up.... I meant for charactertype to be wtype
1512159032
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
Getting this from chat There was an error with your formula. Please try again.
1512159075
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
<div class="sheet-box"> <input type="radio" name="attr_wtype" value="/w gm" checked="true" /> <span class="sheet-popup">NPC</span> <span class="sheet-tooltip"> Non-Player Character </span> <br /> <input type="radio" name="attr_wtype" value="" /> <span class="sheet-popup">PC</span> <span class="sheet-tooltip"> Player Character </span>     </div>
1512159651
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
So it is probably in the button.