SilentRuin
June 6th, 2020, 21:16
I'm new to FG(unity) and have already heavily modified an extension for my personal use. However, this was based on an existing extension so it was fairly easy to figure it out. But now I want to add the action to all my PC's called "grapple" (and also add "shove").
I've seen plenty of comments about "just make it a spell" or "just do this" as if I know how to do more than a one line simple thing like in the examples here ( https://www.fantasygrounds.com/wiki/index.php/5E_Effects ) . But I'm looking how to do a multiple conditional action here. The following is just made up data in "". Though I know I've seen .lua use of all of this type data - not sure how to trigger it as extension action for character sheet - or just a spell that has all I need in it with no .lua modifications required.
For grapple (based on PHB p. 195 - also this is not a real language just a way to describe what I want):
if "source size" +1 > "target size" then
FAILED TO GRAPPLE
return;
end
if "target effects" has "unconcious/incapacitated" then
APPLY GRAPPLE EFFECT TO TARGET
return;
end
if "target dex check" > "target str check" then
"target check" = "target dex check"
else
"target check" = "target str check"
end
"source check value" = roll ("source str check");
"target check value" = roll ("target check");
if "source check value" > "target check value" then
APPLY GRAPPLE EFFECT TO TARGET
else
FAILED TO GRAPPLE
end
return;
So.... My question is - how do I do this in an extension. Or even better, how do I make a "grapple" spell that does the above logic ending up in a state of "grappled" being applied to target - or not after the "cast" or whatever.
I've seen plenty of comments about "just make it a spell" or "just do this" as if I know how to do more than a one line simple thing like in the examples here ( https://www.fantasygrounds.com/wiki/index.php/5E_Effects ) . But I'm looking how to do a multiple conditional action here. The following is just made up data in "". Though I know I've seen .lua use of all of this type data - not sure how to trigger it as extension action for character sheet - or just a spell that has all I need in it with no .lua modifications required.
For grapple (based on PHB p. 195 - also this is not a real language just a way to describe what I want):
if "source size" +1 > "target size" then
FAILED TO GRAPPLE
return;
end
if "target effects" has "unconcious/incapacitated" then
APPLY GRAPPLE EFFECT TO TARGET
return;
end
if "target dex check" > "target str check" then
"target check" = "target dex check"
else
"target check" = "target str check"
end
"source check value" = roll ("source str check");
"target check value" = roll ("target check");
if "source check value" > "target check value" then
APPLY GRAPPLE EFFECT TO TARGET
else
FAILED TO GRAPPLE
end
return;
So.... My question is - how do I do this in an extension. Or even better, how do I make a "grapple" spell that does the above logic ending up in a state of "grappled" being applied to target - or not after the "cast" or whatever.