Garry's Mod

Garry's Mod

ANPlus [BASE] | Replacer Update
 此主题已被置顶,因此可能具有重要性
filz0  [开发者] 2022 年 10 月 22 日 下午 6:11
[ERRORS/BUGS]
Copy and paste your console output here. Tell me what you did. Comments like "it doesn't work, help" will be ignored. I can't read your mind, you have to be more specific.
< >
正在显示第 1 - 15 条,共 230 条留言
ToastLord 2022 年 10 月 26 日 上午 11:32 
Hiya. I decided to make a basic edit of one of the existing ANP NPCs, the phoenix marines: Instead of the model being the Phoenix marine, it uses an old HEV model off the workshop.

But unfortunately I've run into an error where Garry'smod attempts to call a global that is Nil

[newnpcs] addons/newnpcs/lua/autorun/hev_npc.lua:172: attempt to call global 'AddNPCPLUS' (a nil value) 1. unknown - addons/newnpcs/lua/autorun/hev_npc.lua:172

This prevents me from spawning the npc (A popup appears with the header 'Sorry!' and message 'You can't spawn this NPC", as if I was missing episodic content. I have all Episodes installed)

But the strange fix is to make a quick edit, save it, and then I can spawn the NPC. The change doesn't have to be anything huge, for example, turning the HP from 100 to 101. Once the game reloads I get the popup again stating I can't spawn the NPC.

There is a very good chance I've made just a simple error in lua. The most I've done, was:
  • Remove the precache for the female model
  • Only use one model
  • Reduce Increase hp to 100
  • Reduce the reload time for ACT_RELOAD
  • renamed Local from PhoenixNPCs to HEVNPCs (In both the local header and hook.Run)


Here's the pastebin of my lua file. Its stored in the same Hierarchy as it would be for the phoenix marine addon, but with a different lua name (HEV_npc.lua in autorun)

https://pastebin.com/APV9dgbm

Appreciate any help given

EDIT: Local in the pastebin code is still set to PhoenixNPCs, but still has the same issue if changed to something else in both local and hook.run
最后由 ToastLord 编辑于; 2022 年 10 月 26 日 上午 11:38
filz0  [开发者] 2022 年 10 月 26 日 下午 12:49 
I've heard about this issue, it's like your file loads before the base. I'm looking into it as of now.
filz0  [开发者] 2022 年 10 月 26 日 下午 1:01 
Template updated.
最后由 filz0 编辑于; 2022 年 10 月 26 日 下午 1:01
ToastLord 2022 年 10 月 26 日 下午 1:55 
Well, While the global error is fixed, I can't spawn any NPC's using the template (Same popup, can't spawn this NPC) when all I've done is change the name in the template to test cubbage. Same local, same stats, just a different name.

Once a value for health, look distance, etc is changed I can spawn the NPC
最后由 ToastLord 编辑于; 2022 年 10 月 26 日 下午 1:57
filz0  [开发者] 2022 年 10 月 26 日 下午 3:17 
Okay, forget about that. I have rewritten the function.
Now instead of:
hook.Run( "Initialize", AddNPCPLUS( tab ) )
It goes as:
ANPlus.AddNPC( tab )
ToastLord 2022 年 10 月 26 日 下午 4:08 
Think its working so far. Appreciate the help you've given!
filz0  [开发者] 2022 年 10 月 26 日 下午 4:56 
I'm glad to hear that :D
sperm@zoid 2022 年 10 月 29 日 上午 8:09 
Posting this but after testing the Oct 27 update, the Phoenix is receiving the same errors as last time:
[ANPlus [BASE]] lua/autorun/addnpcplus_base.lua:388: Tried to use a NULL entity!
1. SetIK - [C]:-1
2. func - lua/autorun/addnpcplus_base.lua:388
3. unknown - lua/includes/extensions/net.lua:33

UPDATE: Disabling all addons has resulted in the Phoenix spawning. Will be updating soon for other findings.
最后由 sperm@zoid 编辑于; 2022 年 10 月 29 日 上午 8:28
sperm@zoid 2022 年 11 月 22 日 上午 8:23 
[ANPlus [BASE]] lua/autorun/addnpcplus_base.lua:1190: bad argument #2 to '__mul' (number expected, got table)
1. __mul - [C]:-1
2. ANPlusNPCAnimSpeed - lua/autorun/addnpcplus_base.lua:1190
3. unknown - lua/autorun/addnpcplus_base.lua:1211

Timer Failed! [ANPlusThinkMega Angry Odessa Cubbage114][@lua/autorun/addnpcplus_base.lua (line 1201)]

Mega Angry Odessa NPC
filz0  [开发者] 2022 年 11 月 22 日 上午 8:32 
Yeah, I forgor to update his Activity tables. Hotfixing rn. Ty.
sperm@zoid 2022 年 11 月 22 日 上午 8:33 
[ANPlus [BASE]] lua/autorun/addnpcplus_base.lua:1190: bad argument #2 to '__mul' (number expected, got table)
1. __mul - [C]:-1
2. ANPlusNPCAnimSpeed - lua/autorun/addnpcplus_base.lua:1190
3. unknown - lua/autorun/addnpcplus_base.lua:1211

[ANPlus [BASE]] lua/autorun/addnpcplus_base.lua:1076: bad argument #1 to 'GetSquadMembers' (string expected, got no value)
1. GetSquadMembers - [C]:-1
2. ANPlusGrenadeThrow - lua/autorun/addnpcplus_base.lua:1076
3. OnNPCThink - lua/autorun/gdf_anp.lua:238
4. unknown - lua/autorun/addnpcplus_base.lua:1219
filz0  [开发者] 2022 年 11 月 22 日 上午 8:41 
Have you restarted your game?
filz0  [开发者] 2022 年 11 月 22 日 上午 8:42 
There is no code at these lines, just empty space.
UnknownFella 2022 年 12 月 6 日 上午 7:28 
[ERROR] lua/autorun/addnpcplus_base.lua:310: attempt to index global 'ANPlus' (a nil value)
1. unknown - lua/autorun/addnpcplus_base.lua:310


uh... im not sure what i done wrong
sperm@zoid 2022 年 12 月 11 日 上午 12:54 
[ANPlus [BASE]] lua/autorun/addnpcplus_base.lua:913: attempt to index global 'thenv' (a nil value)
1. ANPlusIgnoreTillSet - lua/autorun/addnpcplus_base.lua:913
2. unknown - lua/autorun/addnpcplus_base.lua:565

Timer Failed! [Simple][@lua/autorun/addnpcplus_base.lua (line 547)]

This occured when an NPC died to the Mega Angry Odessa, probably by fire.
< >
正在显示第 1 - 15 条,共 230 条留言
每页显示数: 1530 50