Attempt to index local 'weapon_data' (a nil value) - in function 'get_melee_range'

Title:
Error report appeared during battle

Summary:
The following Engine Error report appeared after killing a Giant Wolf, while goblin thieves were running away with loot. I haven’t seen any issues from it, and the game did not crash, so I don’t actually know what problem is being reported.

Of note is that this happened during two simultaneous random encounters. A Giant Wolf invaded at the same time as Goblin Thieves.

develop-2786 (x64)
...tonehearth/services/server/combat/combat_service.lua:220: attempt to index local 'weapon_data' (a nil value)
stack traceback:
	...tonehearth/services/server/combat/combat_service.lua:220: in function 'get_melee_range'
	...ehearth/ai/actions/combat/get_melee_range_action.lua:27: in function <...ehearth/ai/actions/combat/get_melee_range_action.lua:20>
	[C]: in function 'start_thinking'
	stonehearth/services/server/ai/compound_action.lua:265: in function '_start_thinking_on_frame'
	stonehearth/services/server/ai/compound_action.lua:217: in function <stonehearth/services/server/ai/compound_action.lua:184>
	[C]: in function 'start_thinking'
	stonehearth/services/server/ai/compound_action.lua:265: in function '_start_thinking_on_frame'
	stonehearth/services/server/ai/compound_action.lua:243: in function <stonehearth/services/server/ai/compound_action.lua:233>
	[C]: in function 'start_thinking'
	stonehearth/services/server/ai/compound_action.lua:265: in function '_start_thinking_on_frame'
	stonehearth/services/server/ai/compound_action.lua:217: in function <stonehearth/services/server/ai/compound_action.lua:184>
	...
	[C]: ?
	[C]: ?
	[C]: in function 'run'
	stonehearth/components/ai/ai_component.lua:500: in function <stonehearth/components/ai/ai_component.lua:485>
	[C]: in function 'xpcall'
	stonehearth/components/ai/ai_component.lua:485: in function '_thread_main'
	stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
	[C]: in function 'xpcall'
	stonehearth/services/server/threads/thread.lua:209: in function 'f'
	radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14> 

Steps to reproduce:

  1. Have militia and one footman kill giant wolf as the desert folk. Goblin thieves were also running away with loot.
  2. Footman has bronze sword, basic uniform, and wood shield
  3. Giant wolf died, error appeared. Game did not crash.

Expected Results:
No problem

Actual Results:
Error report, no apparent problem.

Notes:
Because this error appeared during two simultaneous random encounter battle, it would be very difficult for me to try and reproduce the situation or a similar one.

Attachments:

Version Number and Mods in use:
develop-2786 (x64)
No mods

System Information:
Operating System: Windows 10 Home 64-bit (10.0, Build 10586) (10586.th2_release.151121-2308)
Language: English (Regional Setting: English)
Processor: Intel® Core™ i7-2600 CPU @ 3.40GHz (8 CPUs), ~3.4GHz
–Note, CPU is overclocked to a max of 4.2 GHz
Memory: 16384MB RAM
DirectX Version: 12

Display
Card name: AMD Radeon R9 200 Series
Display Memory: 12256 MB
Dedicated Memory: 4074 MB
Shared Memory: 8182 MB

Hey there @Phant0m5, welcome to the Discourse! Thanks for the report (and especially for completing the whole form, very helpful!).

Title:
Error Generated When Accessing Party

Summary:

Error generated when accessing party. Game did not crash.

Steps to reproduce:

  1. Could not reproduce

Expected Results:
Click on Party Red Banner and ensure that party contained my two footman

Actual Results:
Error
3 messages …

Being attacked by 3 goblins … also a large goblin with treasure on map … 2 footman running to engage large goblin

I believe I clicked on the party tool because I was going to order my footman back towards camp to engage the 3 goblin invaders.
I think that is when the error popped.

develop-2786 (x64)
...tonehearth/services/server/combat/combat_service.lua:220: attempt to index local 'weapon_data' (a nil value)
stack traceback:
	...tonehearth/services/server/combat/combat_service.lua:220: in function 'get_melee_range'
	...ehearth/ai/actions/combat/get_melee_range_action.lua:27: in function <...ehearth/ai/actions/combat/get_melee_range_action.lua:20>
	[C]: in function 'start_thinking'
	stonehearth/services/server/ai/compound_action.lua:265: in function '_start_thinking_on_frame'
	stonehearth/services/server/ai/compound_action.lua:217: in function <stonehearth/services/server/ai/compound_action.lua:184>
	[C]: in function 'start_thinking'
	stonehearth/services/server/ai/compound_action.lua:265: in function '_start_thinking_on_frame'
	stonehearth/services/server/ai/compound_action.lua:243: in function <stonehearth/services/server/ai/compound_action.lua:233>
	[C]: in function 'start_thinking'
	stonehearth/services/server/ai/compound_action.lua:265: in function '_start_thinking_on_frame'
	stonehearth/services/server/ai/compound_action.lua:217: in function <stonehearth/services/server/ai/compound_action.lua:184>
	...
	stonehearth/services/server/ai/compound_action.lua:217: in function <stonehearth/services/server/ai/compound_action.lua:184>
	[C]: ?
	[C]: in function 'run'
	stonehearth/components/ai/ai_component.lua:500: in function <stonehearth/components/ai/ai_component.lua:485>
	[C]: in function 'xpcall'
	stonehearth/components/ai/ai_component.lua:485: in function '_thread_main'
	stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
	[C]: in function 'xpcall'
	stonehearth/services/server/threads/thread.lua:209: in function 'f'
	radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>
develop-2786 (x64)
bad frame trasition from "stop" from "starting_thinking"
stack traceback:
	[C]: ?
	[C]: in function 'stop'
	stonehearth/components/ai/ai_component.lua:515: in function <stonehearth/components/ai/ai_component.lua:485>
	[C]: in function 'xpcall'
	stonehearth/components/ai/ai_component.lua:485: in function '_thread_main'
	stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
	[C]: in function 'xpcall'
	stonehearth/services/server/threads/thread.lua:209: in function 'f'
	radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>
develop-2786 (x64)
invalid initial state "starting_thinking" in run
stack traceback:
	[C]: ?
	[C]: in function 'run'
	stonehearth/components/ai/ai_component.lua:500: in function <stonehearth/components/ai/ai_component.lua:485>
	[C]: in function 'xpcall'
	stonehearth/components/ai/ai_component.lua:485: in function '_thread_main'
	stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
	[C]: in function 'xpcall'
	stonehearth/services/server/threads/thread.lua:209: in function 'f'
	radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>

Notes:

Attachments:

Version Number and Mods in use: Alpha 14 no mods

System Information:

Clean Win7 64 install
GTX 980 Graphics

Hey there @Cosian, welcome to the Discourse! Thanks for the report, I merged it with this one as the first error you posted is the same as this topic.

Paging @albert for all the AI errors here…

Summary:
Was getting attack buy some wolves so I hit the “Fight & Defend” button then got four Engine Error messages. Nothing out of the ordinary seamed to happen in game but thought I would post the error messages.
Steps to reproduce:

  • Day 13
  • 11 Hearthlings
  • 1 hearthing on attack order in party 2
  • No other hearthling in any party

Version Number and Mods in use:
Develop -2786 (x64)
System Information:
AMD FX-8350 8-core 4 GHz | 16 Gb RAM | Geforce GTX 770

develop-2786 (x64)
...tonehearth/services/server/combat/combat_service.lua:220: attempt to index local 'weapon_data' (a nil value)
stack traceback:
	...tonehearth/services/server/combat/combat_service.lua:220: in function 'get_melee_range'
	...ehearth/ai/actions/combat/get_melee_range_action.lua:27: in function <...ehearth/ai/actions/combat/get_melee_range_action.lua:20>
	[C]: in function 'start_thinking'
	stonehearth/services/server/ai/compound_action.lua:265: in function '_start_thinking_on_frame'
	stonehearth/services/server/ai/compound_action.lua:217: in function <stonehearth/services/server/ai/compound_action.lua:184>
	[C]: in function 'start_thinking'
	stonehearth/services/server/ai/compound_action.lua:265: in function '_start_thinking_on_frame'
	stonehearth/services/server/ai/compound_action.lua:243: in function <stonehearth/services/server/ai/compound_action.lua:233>
	[C]: in function 'start_thinking'
	stonehearth/services/server/ai/compound_action.lua:265: in function '_start_thinking_on_frame'
	stonehearth/services/server/ai/compound_action.lua:217: in function <stonehearth/services/server/ai/compound_action.lua:184>
	...
	[C]: ?
	[C]: ?
	[C]: in function 'run'
	stonehearth/components/ai/ai_component.lua:500: in function <stonehearth/components/ai/ai_component.lua:485>
	[C]: in function 'xpcall'
	stonehearth/components/ai/ai_component.lua:485: in function '_thread_main'
	stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
	[C]: in function 'xpcall'
	stonehearth/services/server/threads/thread.lua:209: in function 'f'
	radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>
develop-2786 (x64)
bad frame trasition from "stop" from "starting_thinking"
stack traceback:
	[C]: ?
	[C]: in function 'stop'
	stonehearth/components/ai/ai_component.lua:515: in function <stonehearth/components/ai/ai_component.lua:485>
	[C]: in function 'xpcall'
	stonehearth/components/ai/ai_component.lua:485: in function '_thread_main'
	stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
	[C]: in function 'xpcall'
	stonehearth/services/server/threads/thread.lua:209: in function 'f'
	radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>
develop-2786 (x64)
invalid initial state "starting_thinking" in run
stack traceback:
	[C]: ?
	[C]: in function 'run'
	stonehearth/components/ai/ai_component.lua:500: in function <stonehearth/components/ai/ai_component.lua:485>
	[C]: in function 'xpcall'
	stonehearth/components/ai/ai_component.lua:485: in function '_thread_main'
	stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
	[C]: in function 'xpcall'
	stonehearth/services/server/threads/thread.lua:209: in function 'f'
	radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>
develop-2786 (x64)
bad frame trasition from "remove_action" from "starting_thinking"
stack traceback:
	radiant/modules/common.lua:165: in function <radiant/modules/common.lua:164>
	[C]: in function 'fn'
	stonehearth/services/server/threads/thread.lua:278: in function 'private_msg'
	stonehearth/services/server/threads/thread.lua:455: in function '_dispatch_messages'
	stonehearth/services/server/threads/thread.lua:335: in function 'suspend'
	stonehearth/services/server/threads/thread.lua:377: in function 'sleep_realtime'
	stonehearth/components/ai/ai_component.lua:509: in function <stonehearth/components/ai/ai_component.lua:485>
	[C]: in function 'xpcall'
	stonehearth/components/ai/ai_component.lua:485: in function '_thread_main'
	stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
	[C]: in function 'xpcall'
	stonehearth/services/server/threads/thread.lua:209: in function 'f'
	radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>

Update 1: Turns out something did happen. One hearthling is frozen and says he is in combat.
Saved Game Folder

1 Like

Summary:
Six engine errors popped up while ordering town alert mode in a “safe room”
Steps to reproduce:

  1. Build this “safe room” :
  2. Put the blue Flag in the center of the “safe room” (i’m sorry, i moved a the flag a little too the right, he was in the center when these bug popped up but didn’t get a screen from the center when all the citizen was on the flags :confused: ) :
  3. Order “Town Alert Mode”
  4. Fight back invaders with footmen at this location : :
  5. Unorder “Town Alert Mode”
  6. 6 engines Errors pop up at this moment

Expected Results:
Every citizen get out of the location at the unorders.
Actual Results:
One of my weaver get stuck (At this moment, the flag was on him, on the center !)


Notes:
It was random :smiley: stupid weather stucked in a flag or something !

Attachments:
Here is the 6 screen of the errors
1:
2 :


3 :
4 :
5 :
6 :
Version Number and Mods in use:
develop-2786 (x64)
System Information:
dxdiag : DxDiag.txt (28.7 KB)

Hey there @OlderThanBefore, do you have the save where this error occurs? Can you upload it to the Discourse please?

1 Like

Complements : I saved from this bug and reloaded and the weather unstucked himself so it was ok after all !
Not gamebreaker but really random :

I’m sorry, i havent got a save game by the moment this bug happends, i panicked lol !

2 Likes

Hi all,
Thanks for reporting this. There is a bug with the weaver weapon right now. If you remove the weaver from your militia, this error should go away.
We are working on a fix.
Thanks
-Yang

3 Likes

this popped up when I turned town alert on


develop-2795 (x64)
…tonehearth/services/server/combat/combat_service.lua:223: attempt to index local ‘weapon_data’ (a nil value)
stack traceback:
…tonehearth/services/server/combat/combat_service.lua:223: in function ‘get_melee_range’
…ehearth/ai/actions/combat/get_melee_range_action.lua:27: in function <…ehearth/ai/actions/combat/get_melee_range_action.lua:20>
[C]: in function 'start_thinking’
stonehearth/services/server/ai/compound_action.lua:267: in function '_start_thinking_on_frame’
stonehearth/services/server/ai/compound_action.lua:219: in function <stonehearth/services/server/ai/compound_action.lua:186>
[C]: in function 'start_thinking’
stonehearth/services/server/ai/compound_action.lua:267: in function '_start_thinking_on_frame’
stonehearth/services/server/ai/compound_action.lua:245: in function <stonehearth/services/server/ai/compound_action.lua:235>
[C]: in function 'start_thinking’
stonehearth/services/server/ai/compound_action.lua:267: in function '_start_thinking_on_frame’
stonehearth/services/server/ai/compound_action.lua:219: in function <stonehearth/services/server/ai/compound_action.lua:186>

[C]: ?
[C]: ?
[C]: in function 'run’
stonehearth/components/ai/ai_component.lua:500: in function <stonehearth/components/ai/ai_component.lua:485>
[C]: in function 'xpcall’
stonehearth/components/ai/ai_component.lua:485: in function '_thread_main’
stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
[C]: in function 'xpcall’
stonehearth/services/server/threads/thread.lua:209: in function 'f’
radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>


develop-2795 (x64)
bad frame trasition from “stop” from "starting_thinking"
stack traceback:
[C]: ?
[C]: in function 'stop’
stonehearth/components/ai/ai_component.lua:515: in function <stonehearth/components/ai/ai_component.lua:485>
[C]: in function 'xpcall’
stonehearth/components/ai/ai_component.lua:485: in function '_thread_main’
stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
[C]: in function 'xpcall’
stonehearth/services/server/threads/thread.lua:209: in function 'f’
radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>


develop-2795 (x64)
invalid initial state “starting_thinking” in run
stack traceback:
[C]: ?
[C]: in function 'run’
stonehearth/components/ai/ai_component.lua:500: in function <stonehearth/components/ai/ai_component.lua:485>
[C]: in function 'xpcall’
stonehearth/components/ai/ai_component.lua:485: in function '_thread_main’
stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
[C]: in function 'xpcall’
stonehearth/services/server/threads/thread.lua:209: in function 'f’
radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>

I also got 6 more errors when refreshing the ui:

develop-2795 (x64)
…tonehearth/services/server/combat/combat_service.lua:223: attempt to index local ‘weapon_data’ (a nil value)
stack traceback:
…tonehearth/services/server/combat/combat_service.lua:223: in function ‘get_melee_range’
…ehearth/ai/actions/combat/get_melee_range_action.lua:27: in function <…ehearth/ai/actions/combat/get_melee_range_action.lua:20>
[C]: in function 'start_thinking’
stonehearth/services/server/ai/compound_action.lua:267: in function '_start_thinking_on_frame’
stonehearth/services/server/ai/compound_action.lua:219: in function <stonehearth/services/server/ai/compound_action.lua:186>
[C]: in function 'start_thinking’
stonehearth/services/server/ai/compound_action.lua:267: in function '_start_thinking_on_frame’
stonehearth/services/server/ai/compound_action.lua:245: in function <stonehearth/services/server/ai/compound_action.lua:235>
[C]: in function 'start_thinking’
stonehearth/services/server/ai/compound_action.lua:267: in function '_start_thinking_on_frame’
stonehearth/services/server/ai/compound_action.lua:219: in function <stonehearth/services/server/ai/compound_action.lua:186>

[C]: ?
[C]: ?
[C]: in function 'run’
stonehearth/components/ai/ai_component.lua:500: in function <stonehearth/components/ai/ai_component.lua:485>
[C]: in function 'xpcall’
stonehearth/components/ai/ai_component.lua:485: in function '_thread_main’
stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
[C]: in function 'xpcall’
stonehearth/services/server/threads/thread.lua:209: in function 'f’
radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>

develop-2795 (x64)
bad frame trasition from “stop” from "starting_thinking"
stack traceback:
[C]: ?
[C]: in function 'stop’
stonehearth/components/ai/ai_component.lua:515: in function <stonehearth/components/ai/ai_component.lua:485>
[C]: in function 'xpcall’
stonehearth/components/ai/ai_component.lua:485: in function '_thread_main’
stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
[C]: in function 'xpcall’
stonehearth/services/server/threads/thread.lua:209: in function 'f’
radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>

develop-2795 (x64)
invalid initial state “starting_thinking” in run
stack traceback:
[C]: ?
[C]: in function 'run’
stonehearth/components/ai/ai_component.lua:500: in function <stonehearth/components/ai/ai_component.lua:485>
[C]: in function 'xpcall’
stonehearth/components/ai/ai_component.lua:485: in function '_thread_main’
stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
[C]: in function 'xpcall’
stonehearth/services/server/threads/thread.lua:209: in function 'f’
radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>

develop-2795 (x64)
bad frame trasition from “remove_action” from "starting_thinking"
stack traceback:
radiant/modules/common.lua:171: in function <radiant/modules/common.lua:170>
[C]: in function 'fn’
stonehearth/services/server/threads/thread.lua:278: in function 'private_msg’
stonehearth/services/server/threads/thread.lua:455: in function '_dispatch_messages’
stonehearth/services/server/threads/thread.lua:335: in function 'suspend’
stonehearth/services/server/threads/thread.lua:377: in function 'sleep_realtime’
stonehearth/components/ai/ai_component.lua:509: in function <stonehearth/components/ai/ai_component.lua:485>
[C]: in function 'xpcall’
stonehearth/components/ai/ai_component.lua:485: in function '_thread_main’
stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
[C]: in function 'xpcall’
stonehearth/services/server/threads/thread.lua:209: in function 'f’
radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>

develop-2795 (x64)
bad frame trasition from “unit_not_ready” from "starting_thinking"
stack traceback:
radiant/modules/common.lua:171: in function <radiant/modules/common.lua:170>
[C]: in function 'clear_think_output’
stonehearth/services/server/ai/compound_action.lua:256: in function <stonehearth/services/server/ai/compound_action.lua:235>
[C]: in function 'clear_think_output’
stonehearth/services/server/ai/compound_action.lua:256: in function <stonehearth/services/server/ai/compound_action.lua:235>
[C]: in function 'fn’
stonehearth/services/server/threads/thread.lua:278: in function 'private_msg’
stonehearth/services/server/threads/thread.lua:455: in function '_dispatch_messages’
stonehearth/services/server/threads/thread.lua:335: in function 'suspend’
stonehearth/services/server/threads/thread.lua:377: in function 'sleep_realtime’
stonehearth/components/ai/ai_component.lua:509: in function <stonehearth/components/ai/ai_component.lua:485>
[C]: in function 'xpcall’
stonehearth/components/ai/ai_component.lua:485: in function '_thread_main’
stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
[C]: in function 'xpcall’
stonehearth/services/server/threads/thread.lua:209: in function 'f’
radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>

develop-2795 (x64)
:aborted_frame:radiant_policy_rethrow
stack traceback:
radiant/modules/common.lua:171: in function <radiant/modules/common.lua:170>
[C]: in function 'fn’
stonehearth/services/server/threads/thread.lua:242: in function <stonehearth/services/server/threads/thread.lua:232>
[C]: in function 'fn’
stonehearth/services/server/threads/thread.lua:278: in function 'private_msg’
stonehearth/services/server/threads/thread.lua:455: in function '_dispatch_messages’
stonehearth/services/server/threads/thread.lua:335: in function 'suspend’
stonehearth/services/server/threads/thread.lua:377: in function 'sleep_realtime’
stonehearth/components/ai/ai_component.lua:509: in function <stonehearth/components/ai/ai_component.lua:485>
[C]: in function 'xpcall’
stonehearth/components/ai/ai_component.lua:485: in function '_thread_main’
stonehearth/services/server/threads/thread.lua:212: in function <stonehearth/services/server/threads/thread.lua:209>
[C]: in function 'xpcall’
stonehearth/services/server/threads/thread.lua:209: in function 'f’
radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>

2 Likes

This should be fixed in the latest unstable build (Develop-2797). Try it out and let me know if it shows up again in the new build!

2 Likes