JetBoom / noxiousrpg

Antique, abandoned rpg gamemode. Had a working robust item system, spells, and a few other things.
5 stars 0 forks source link

Running gamemode #1

Open Vac95 opened 4 years ago

Vac95 commented 4 years ago

I recently found this gamemode and would like to pick it up and work on it. However I saw that it was in the process of a massive rewrite regarding items. Was there a working copy before this rewrite was started?

JetBoom commented 4 years ago

I'm pretty sure the item rewrite was done already with maybe small, insignificant bugs.

On Fri, Feb 7, 2020, 1:30 AM Metal-Fish notifications@github.com wrote:

I recently found this gamemode and would like to pick it up and work on it. However I saw that it was in the process of a massive rewrite regarding items. Was there a working copy before this rewrite was started?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JetBoom/noxiousrpg/issues/1?email_source=notifications&email_token=AA4T5FNDPZQSQTJZKWWJWXTRBT5W5A5CNFSM4KRJIAUKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4ILXAKUA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4T5FOFGPKBTFCETX6NRTDRBT5W5ANCNFSM4KRJIAUA .

Vac95 commented 4 years ago

I tried launched the gamemode and encountered some small bugs that I could fix, however I ran into problems with both the meta:index(key) and meta:newindex(key, value) functions as when it attempts to use rawget(self, "__nwvars")[key] it errors out and I have been unable to fix it.

Here's the relevant file and lines https://github.com/JetBoom/noxiousrpg/blob/master/gamemode/obj_item.lua#L54

JetBoom commented 4 years ago

What's the exact error?

Vac95 commented 4 years ago

So currently you get the following error for items that have ITEM_NW_VAR_NAME defined in them

[ERROR] gamemodes/noxiousrpg/gamemode/obj_item.lua:16: attempt to get length of field '__nwvars' (a nil value)
  1. ITEM_NW_VAR - gamemodes/noxiousrpg/gamemode/obj_item.lua:16
   2. ITEM_NW_VAR_NAME - gamemodes/noxiousrpg/gamemode/obj_item.lua:23
    3. unknown - gamemodes/noxiousrpg/gamemode/items/giblet.lua:18
     4. include - [C]:-1
      5. unknown - gamemodes/noxiousrpg/gamemode/sh_items.lua:249
       6. include - [C]:-1
        7. unknown - gamemodes/noxiousrpg/gamemode/shared.lua:30
         8. include - [C]:-1
          9. unknown - gamemodes/noxiousrpg/gamemode/init.lua:58

If you comment it out the error goes away and the gamemode is able to be started without any errors. However then once you join you receive the following error which is where I'm stuck.

[ERROR] gamemodes/noxiousrpg/gamemode/obj_item.lua:77: attempt to index local 'nwvars' (a nil value)
  1. __newindex - gamemodes/noxiousrpg/gamemode/obj_item.lua:77
   2. Item - gamemodes/noxiousrpg/gamemode/obj_item.lua:1041
    3. SetupPlayerInventory - gamemodes/noxiousrpg/gamemode/obj_player_extend_sv.lua:230
     4. SetupPlayerDefaults - gamemodes/noxiousrpg/gamemode/init.lua:869
      5. unknown - gamemodes/noxiousrpg/gamemode/init.lua:878
JetBoom commented 4 years ago

Commenting it isn't really a fix since that's an integral part of the system. I committed a change.

Vac95 commented 4 years ago

Yea, that's true. However I just downloaded the update and still am running into the same problem

[ERROR] gamemodes/noxiousrpg/gamemode/obj_item.lua:15: attempt to get length of field '__nwvars' (a nil value)
  1. ITEM_NW_VAR - gamemodes/noxiousrpg/gamemode/obj_item.lua:15
   2. ITEM_NW_VAR_NAME - gamemodes/noxiousrpg/gamemode/obj_item.lua:22
    3. unknown - gamemodes/noxiousrpg/gamemode/items/torso.lua:9
     4. include - [C]:-1
      5. unknown - gamemodes/noxiousrpg/gamemode/sh_items.lua:249
       6. include - [C]:-1
        7. unknown - gamemodes/noxiousrpg/gamemode/shared.lua:30
         8. include - [C]:-1
          9. unknown - gamemodes/noxiousrpg/gamemode/init.lua:58

The following files are causing it and all have ITEM_NW_VAR_NAME

brain.lua foot.lua hand.lua head.lua heart.lua jaw.lua junk.lua rib.lua scapula.lua skull.lua spine.lua torso.lua

JetBoom commented 4 years ago

Ok, this one should fix it.

Vac95 commented 4 years ago

Still getting the following error

[ERROR] gamemodes/noxiousrpg/gamemode/obj_item.lua:79: attempt to index local 'nwvars' (a nil value)
  1. __newindex - gamemodes/noxiousrpg/gamemode/obj_item.lua:79
   2. Item - gamemodes/noxiousrpg/gamemode/obj_item.lua:1043
    3. SetupPlayerInventory - gamemodes/noxiousrpg/gamemode/obj_player_extend_sv.lua:230
     4. SetupPlayerDefaults - gamemodes/noxiousrpg/gamemode/init.lua:869
      5. unknown - gamemodes/noxiousrpg/gamemode/init.lua:878
JetBoom commented 4 years ago

Try now. Anything more and you'll have to fix it yourself.

Vac95 commented 4 years ago

Thanks for taking the time to help, I really do appreciate it. There is a new error so I'll try to debug it.

Vac95 commented 4 years ago

Figured I'd just add on to this in case anyone checks out the gamemode later. The following error is in relation to here which is caused by some item attempting to look up it's parent value when it doesn't exist as the table looks like below. You can see that the key value is parent however it isn't actually mapped to an object.

bits    =       32
default =       0
index   =       0
key     =       Parent
onreceived      =       function: 0x27bbe460
read    =       function: 0x266cbe38
write   =       function: 0x266cb6a8
[ERROR] gamemodes/noxiousrpg/gamemode/obj_item.lua:68: attempt to index a nil value
  1. __index - gamemodes/noxiousrpg/gamemode/obj_item.lua:68
   2. GetParent - gamemodes/noxiousrpg/gamemode/obj_item.lua:855
    3. GetRoot - gamemodes/noxiousrpg/gamemode/obj_item.lua:687
     4. GetRootOrSelf - gamemodes/noxiousrpg/gamemode/obj_item.lua:702
      5. GetRootEntity - gamemodes/noxiousrpg/gamemode/obj_item.lua:457
       6. RadiusSync - gamemodes/noxiousrpg/gamemode/obj_item.lua:726
        7. SetAmount - gamemodes/noxiousrpg/gamemode/obj_item.lua:373
         8. Item - gamemodes/noxiousrpg/gamemode/obj_item.lua:1056
          9. SetupPlayerInventory - gamemodes/noxiousrpg/gamemode/obj_player_extend_sv.lua:230
           10. SetupPlayerDefaults - gamemodes/noxiousrpg/gamemode/init.lua:869
            11. unknown - gamemodes/noxiousrpg/gamemode/init.lua:878