Fantasy Grounds Fridays Pre
Page 1 of 2 12 Last
  1. #1

    NPC attacks all in a row or they don't work

    I'm new to FG and LUA is new to me but I am a C# coder and while I have seen a number of threads on this subject I seem to be missing something?

    I have GCA and export an NPC using the correct xport to FG II txt as .xml and then use /importnpc within FG (I have also created an NPC in FG just to make sure) but for whatever reason I have issues with the Attacks. I spent a while messing with it and was able to fix it by removing all the carriage returns and just left everything one after another. It's pretty ugly trying to click an attack however since it's one giant string.

    This is what I have done and it basically works but I would prefer to have each attack on it's own line:
    Bite (12):[bite 1d-2 cr; C]Kick (10):[kick 1d-1 cr; C,1]Club (12):[swing 1d+2 cr; 1]Club (12):[thrust 1d cr; 1]Punch (12):[punch 1d-2 cr; C]

    I've tried to use , and ; but no dice. I'm pretty sure I have the correct GURPS ruleset loaded and I did check the npcattackfield.lua at line 101 which is:
    starts, ends, all, skill, meth, dam = string.find(str, "\r?(([%u%w+%s]*%u%w+%s[%w%w+]*[%(%w+%)]*%(%d%d?%):%s*)\r*(%[%w%w+)%s(%d[%d+d]*[%-%+%d%d+]*%s[%w%w+;]*)[%s%w;]*[,%w%d;]*%])", nextindex);

    (The red is just marking what was mentioned in another thread on this subject a year ago or so and I'm guessing that's the latest on this.)

    If I have everything as good as it gets right now please let me know because otherwise I'm going to keep chewing at this issue.

    Thanks in advance and sorry if I missed an explanation somewhere. I have gone through a lot of threads looking.

  2. #2
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    23,235
    Blog Entries
    1
    saithan is I think the current GURPs maintainer. his last post on that suggests that the /r? allows you to enter each weapon/attack on a separate line. have you tried that?

    MoreCore - Generic Ruleset
    --- Projects ---
    Extensions | Tutorials | MoreCore | MoreCore Themes | Call of Cthulhu | Maelstrom | FG Con

  3. #3
    Yeah, that's what I don't understand, even using the /importnpc it doesn't want to work. I did try putting an attack on it's own line (which is what I want) but then everything fails except the first one. I'm fairly certain it's the \cr that's the issue but how else can you split the attacks to their own line unless you hit the return key?

    Knowing me the issue is right in front of my face. Hmmm...

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    28,632
    Discussed here: https://www.fantasygrounds.com/forum...-GURPS-ruleset Start at post #6...

    FG Con 16 FG Online RPG Convention - Friday April 16th Sunday 18th, 2021.
    FG Con 17: October 15th 17th, 2021.

    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  5. #5
    If you want more then one attack you separate with either ',' or ';' no space. So it would be
    Brawling (13):[punch 1d-2 cr;C],Brawling (13):[bite 1d-2 cr;C],Brawling (11):[kick 1d-1 cr;C],SmallKnife (12):[swing 1d-3 cut;C],SmallKnife (12):[thrust 1d-3 imp;C]
    I'll give it a shot tonight when I'm home in a few hours. The only difference is the , he put between each one. I'm thinking I tried this because I had in fact read that very thread but I'll be back.

    In case I hadn't mentioned it, thanks for the responses.

  6. #6
    This thread also has some fixes/diagnoses in it
    It's hard to be religious when certain people are never incinerated by bolts of lightning.

  7. #7
    @Gigermann that's the one I was quoting from at the start but thanks.

    This is so strange, half the time these work and then on another they don't. I tried to type them exactly the same. I wound up just cutting and pasting what worked on one to the others and modified that to reflect the correct skill values. Something is not right but I'll have to play around with it more before I can be more definitive.

  8. #8
    I have not seen this problem as I usually just place corsur at the point I want to separate and hit enter no"," or ";"
    some times they will not work till you separate them all.

    I just tested your line from the first post worked fine.

    another thing to remember that highlighting will not happen if the field has focus!
    Last edited by saithan; January 7th, 2016 at 02:35.

  9. #9
    Hmm, ok, well here's a screenshot of one of my NPC races and when I attempt to drag anything other than the first item it pops up that Console message as shown. I hope someone can see where I'm going off the rails.

    And sorry for not being super prompt at the moment, I'm in a software roll out at work and cranking on an art commission for a map at the same time. Unfortunately, FG is on my back burner right now....yay, me!

    The chat window shows a swing knife but that was when I had things separated by a , and while I can live with it I'd prefer everything on it's own line since it's visually easier to look at.

    So, to reiterate, you see the highlighted item, as soon as I start to drag it, BANG! console window.

    I show a second screen with side by side NPCs as well because in the 2nd screen the one on the right works fine like that. The one on the left has issues, although, if I separate the lines by adding back the , (comma) it's all good.
    Attached Images Attached Images
    Last edited by Jaxilon; January 11th, 2016 at 05:25.

  10. #10
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    28,632
    Where did you get your ruleset from? Looking at my GURPS ruleset (downloaded from the link here: http://www.fantasygrounds.com/wiki/i...Ruleset:_GURPS Line 255 in the npcattackfield.lua script is a blank line and wouldn't raise that error. So it looks like it is a different ruleset to this one. Or are you running any extensions? Or have you modified the ruleset?

    And those attacks you have listed work fine for me using the ruleset linked above.

    FG Con 16 FG Online RPG Convention - Friday April 16th Sunday 18th, 2021.
    FG Con 17: October 15th 17th, 2021.

    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in