Thread: Problem with NPC attacks.
-
March 2nd, 2014, 22:04 #1
- Join Date
- May 2007
- Posts
- 85
Problem with NPC attacks.
When trying to drag and drop an NPC attack other than the top one, I was getting the following error:
Script Error: [string "scripts/npcattackfield.lua"]:255: attempt to concatenate local 'name' (a nil value)
Investigating the problem, the culprit appears to be the parseComponents() function on the npcattackfield.lua script. When trying to drag any attack but the top option, the parseComponents() function includes the carriage return at the start of the line when populating the "all" and "skill" variables.
-
March 2nd, 2014, 23:38 #2
- Join Date
- Jul 2010
- Location
- orlando
- Posts
- 270
you have to properly write them in.
https://enhanced.vlexofree.com/index...urps-4enhanced
Shortsword (14):[swing 1d+2 cut; C,1]
ranged:
Large Knife (thrown) (13): 1d-2 imp, Acc 0, Range 8/15, RoF 1Last edited by saithan; March 2nd, 2014 at 23:40.
-
March 3rd, 2014, 14:55 #3
You got farther than I did trying to diagnose the problem—didn't see that. Did you fix and test it locally?
It's (technically) not the syntax on the attack line—that hasn't changed in my test campaign since before the latest updates, when it was working. I wonder if it would work with all the attacks on one line? :PIt's hard to be religious when certain people are never incinerated by bolts of lightning.
-
March 3rd, 2014, 19:00 #4
- Join Date
- May 2007
- Posts
- 85
There's probably a more elegant way to fix it, but my quick and dirty fix was to add the following two lines after line 101 in npcattackfield.lua:
Code:all = string.gsub(all, "\n", ""); skill = string.gsub(skill, "\n", "");
-
March 3rd, 2014, 23:35 #5
Last edited by Gigermann; March 3rd, 2014 at 23:43.
It's hard to be religious when certain people are never incinerated by bolts of lightning.
-
March 15th, 2014, 18:03 #6
- Join Date
- May 2013
- Location
- East Coast USA.
- Posts
- 979
Forgive me for my ignorance guys, but which files are you modifying here, and what program/editor do you use to do the modification ? I've looked in both my program file directory and my FG apps directories and cant find a .lua file that might be associated with gurps.
-
March 16th, 2014, 18:26 #7
While not specific to GURPS, this thread gives a lot of info regarding modifying rulesets: https://www.fantasygrounds.com/forum...oreRPG-ruleset. The GURPS ruleset will be in the GURPS_4e.pak file in the \rulesets directory I believe.
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!
-
March 16th, 2014, 22:47 #8
-
April 26th, 2014, 15:11 #9
- Join Date
- Feb 2011
- Posts
- 25
I'm having the same problem, but I'm not familiar enough with code editing to know exactly how to do this. Is there any chance you one of you guys could post the edited npcattackfield.lua here? Would I just create a new .zip file and rename it .pak after I added the edited file back in? Thanks for your help and time.
-
April 26th, 2014, 15:32 #10
- Join Date
- Jul 2010
- Location
- orlando
- Posts
- 270
it is better to add "\r?" (without the quotes) to the beginning of the regex. this will not only fix the prob, but make it more forgivin. for instance you can separate entries by a line.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks