-
February 9th, 2015, 12:56 #31
so - ive been barking up the wrong tree a little...
many apologies Lundgren for appropriating your thread for my own use!
- I dont think I can use the dynamic list and scroll bar on a partial frame - its all or nothing
- I was trying to dynamically link NPC stats between NPC record and the CT entry - not the way its done in FG3 rulesets - once you drag an NPC to the CT it is its own entity - this allows you to drag multiple instances of the one NPC
So I still have a few things I need help with
- I am now using the following method of adding attacks/weapons to my NPCs - similar to other CoreRPG rulesets.
I need to parse the text and break it down - eg Spear [45] [43] (2d6) Translates to
Weapon: Spear
Attack Roll (under): 45
Defense Roll (under): 43
Damage (2d6)
I have it rolling d100,d10 (%) on clicking the string but I really need help with:
- Splitting string into Weapon / Attack / Defense / Damage
- Comparing the Attack Roll with the Attack value
- Comparing the Defense Roll with the Defense Value
- Executing the Damage Roll
- Initiative - I need to either make the CT INIT field clickable to roll Initiative or I need Initiative to roll automatically on Round Start.
I know C&C does this - the code looks quite complex and my first effort at stealing code from this wasnt successful.
Pointers welcome - should I go back to C&C and retry or should I make the CT clickable
- My Wounds were locked but once I changed the DB name they are now editable in the CT directly so that is ok now.
So if any of you kind gurus have some bandwidth available to point me in the right direction on these... Id be much obliged
-
February 9th, 2015, 15:49 #32
- Join Date
- Feb 2014
- Posts
- 26
Just nice it being used. It also makes it easier to find, when I'm trying to figure out the same things
I need to parse the text and break it down - eg Spear [45] [43] (2d6) Translates to
Weapon: Spear
Attack Roll (under): 45
Defense Roll (under): 43
Damage (2d6)
I have it rolling d100,d10 (%) on clicking the string but I really need help with:
- Splitting string into Weapon / Attack / Defense / Damage
- Comparing the Attack Roll with the Attack value
- Comparing the Defense Roll with the Defense Value
- Executing the Damage Roll
I'm still not familiar enough with LUA to whip up some code for it. But for the parsing part, you basically could:
- Look for the first left bracket, then store everything before it as the weapon name (dropping any trailing spaces)
- From the position of the former left bracket, look for the next right bracket. Store anything between them as the attack value
- From the position of the former right bracket, look for the next left bracket (so it doesn't matter if there was a space in between them or not). From there, look for the next right bracket and store anything in between as the defense value.
- From the position of the former right bracket, look for the next left parenthesis. From there, look for the next right parenthesis and store anything in between as the damage.
string.find and string.sub should work to find the positions and extract the information, if they are available in FG scripts.
So, from a "basically" point of view, it should be quite straight forward. The tricky part is to handle the input errors. Someone might add brackets in the weapon name, or using the wrong type, etc. It can easily become 10% code to handle a correctly typed string, and 90% of the code to handle all of the other odd cases that could creep up.
-
February 9th, 2015, 19:11 #33
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks