Garry's Mod

Garry's Mod

ANPlus [BASE] | Replacer Update
 Denne tråd er blevet fastgjort, så den er sikkert vigtig
filz0  [udvikler] 22. okt. 2022 kl. 18: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.
< >
Viser 1-15 af 229 kommentarer
ToastLord 26. okt. 2022 kl. 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
Sidst redigeret af ToastLord; 26. okt. 2022 kl. 11:38
filz0  [udvikler] 26. okt. 2022 kl. 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  [udvikler] 26. okt. 2022 kl. 13:01 
Template updated.
Sidst redigeret af filz0; 26. okt. 2022 kl. 13:01
ToastLord 26. okt. 2022 kl. 13: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
Sidst redigeret af ToastLord; 26. okt. 2022 kl. 13:57
filz0  [udvikler] 26. okt. 2022 kl. 15: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 26. okt. 2022 kl. 16:08 
Think its working so far. Appreciate the help you've given!
filz0  [udvikler] 26. okt. 2022 kl. 16:56 
I'm glad to hear that :D
sperm@zoid 29. okt. 2022 kl. 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.
Sidst redigeret af sperm@zoid; 29. okt. 2022 kl. 8:28
sperm@zoid 22. nov. 2022 kl. 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  [udvikler] 22. nov. 2022 kl. 8:32 
Yeah, I forgor to update his Activity tables. Hotfixing rn. Ty.
sperm@zoid 22. nov. 2022 kl. 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  [udvikler] 22. nov. 2022 kl. 8:41 
Have you restarted your game?
filz0  [udvikler] 22. nov. 2022 kl. 8:42 
There is no code at these lines, just empty space.
UnknownFella 6. dec. 2022 kl. 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 11. dec. 2022 kl. 0: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.
< >
Viser 1-15 af 229 kommentarer
Per side: 1530 50