Page 1 of 1

Can't pickup item

Posted: 2020-02-06, 17:14
by arfur9
I thought I'd replace the ammo items I've noticed missing, I started off with some shotgun shells but I can't pick them up.
I looked at other ammo, Ammo_DesertEagle is still there and I can pick that up and the weapon, I can pick up a shotgun ok

Its going to be something simple but I'm not seeing it!

edit:
Nevermind sorted it, I didn't realise I needed to add the inventory item to the HumanPlayer.lua

the script for Bazooka seems to be wrong?
Line 179

Code: Select all

            local c1 = world:new("ComponentModelT")
            c1:set("Name", "Games/DeathMatch/Models/Weapons/Grenade/Grenade_w.cmdl")
it draws grenades at the crosshair
in console:

Code: Select all

Player picked up item:	Bazooka
Warning: Lua error in call to method Think():
Games/DeathMatch/Scripts/Rocket.lua:22: attempt to call global 'Vector3T' (a nil value)

Re: Can't pickup item

Posted: 2020-02-07, 10:24
by Carsten
Well, grenades are used here because we don't have any better models, i.e. no model for the bazooka projectile. ;-)

Re: Can't pickup item

Posted: 2020-02-08, 18:09
by arfur9
if you try the bazooka with the map AEonsCanyonTower you will see what I mean about "method Think():" problem

Its around level D

Re: Can't pickup item

Posted: 2020-02-11, 09:50
by Carsten
You are right. I don't know why I haven't seen this sooner.
You can fix this by placing

Code: Select all

dofile("Games/DeathMatch/Scripts/Vector3.lua")
as the first line in Games/DeathMatch/Scripts/Rocket.lua.
I've also just pushed the fix to the repository.
Thanks for reporting this! :up:

Re: Can't pickup item

Posted: 2020-02-11, 11:24
by arfur9
thanks, yes that works :)