Garry's Mod
ANPlus [BASE] | Replacer Update
 Acest topic a fost fixat, deci probabil este important
filz0  [dezvoltator] 22 oct. 2022 la 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.
< >
Se afișează 1-15 din 230 comentarii
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
Editat ultima dată de ToastLord; 26 oct. 2022 la 11:38
filz0  [dezvoltator] 26 oct. 2022 la 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  [dezvoltator] 26 oct. 2022 la 13:01 
Template updated.
Editat ultima dată de filz0; 26 oct. 2022 la 13:01
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
Editat ultima dată de ToastLord; 26 oct. 2022 la 13:57
filz0  [dezvoltator] 26 oct. 2022 la 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 )
Think its working so far. Appreciate the help you've given!
filz0  [dezvoltator] 26 oct. 2022 la 16:56 
I'm glad to hear that :D
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.
Editat ultima dată de sperm@zoid; 29 oct. 2022 la 8:28
[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  [dezvoltator] 22 nov. 2022 la 8:32 
Yeah, I forgor to update his Activity tables. Hotfixing rn. Ty.
[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  [dezvoltator] 22 nov. 2022 la 8:41 
Have you restarted your game?
filz0  [dezvoltator] 22 nov. 2022 la 8:42 
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
[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.
< >
Se afișează 1-15 din 230 comentarii
Per pagină: 1530 50