Garry's Mod

Garry's Mod

ANPlus [BASE] | Replacer Update
 Topik ini telah disematkan, kemungkinan topiknya penting
filz0  [pengembang] 22 Okt 2022 @ 6:11pm
[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.
< >
Menampilkan 1-15 dari 230 komentar
ToastLord 26 Okt 2022 @ 11:32am 
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
Terakhir diedit oleh ToastLord; 26 Okt 2022 @ 11:38am
filz0  [pengembang] 26 Okt 2022 @ 12:49pm 
I've heard about this issue, it's like your file loads before the base. I'm looking into it as of now.
filz0  [pengembang] 26 Okt 2022 @ 1:01pm 
Template updated.
Terakhir diedit oleh filz0; 26 Okt 2022 @ 1:01pm
ToastLord 26 Okt 2022 @ 1:55pm 
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
Terakhir diedit oleh ToastLord; 26 Okt 2022 @ 1:57pm
filz0  [pengembang] 26 Okt 2022 @ 3:17pm 
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 @ 4:08pm 
Think its working so far. Appreciate the help you've given!
filz0  [pengembang] 26 Okt 2022 @ 4:56pm 
I'm glad to hear that :D
sperm@zoid 29 Okt 2022 @ 8:09am 
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.
Terakhir diedit oleh sperm@zoid; 29 Okt 2022 @ 8:28am
sperm@zoid 22 Nov 2022 @ 8:23am 
[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  [pengembang] 22 Nov 2022 @ 8:32am 
Yeah, I forgor to update his Activity tables. Hotfixing rn. Ty.
sperm@zoid 22 Nov 2022 @ 8:33am 
[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  [pengembang] 22 Nov 2022 @ 8:41am 
Have you restarted your game?
filz0  [pengembang] 22 Nov 2022 @ 8:42am 
There is no code at these lines, just empty space.
[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 Des 2022 @ 12:54am 
[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.
< >
Menampilkan 1-15 dari 230 komentar
Per halaman: 1530 50