ETMods.net

N!tmod, a Wolfenstein: Enemy Territory Modification!

You are not logged in.

Announcement

You can donate to help us keeping services online.

#1 14-Sep-10 23:25:37

soak
BETA Tester
Registered: 03-Sep-10
Posts: 23

Re: Nitmod and Lua??

I have recently started programming some lua scripts for my nitmod server. This very basic code is intended to control ammo at spawntime:

        et.gentity_set(clientNum,"ps.ammoclip",weapons[i].weapon_id, weapons[i].ammoclip)
        et.gentity_set(clientNum,"ps.ammo",weapons[i].weapon_id, weapons[i].ammo)

However, nitmod seems to use entirely different fieldnames than ETpro or ETpub. This isn't really a problem, except that I don't actually know what they are. Would you mind supplying a partial list? Specifically, this script is unable to modify the akimbo ammo.

-Soak

P.S. I have a list of weapon ids already, don't need those

Offline

#2 14-Sep-10 23:55:01

N!trox*
Administrator
Registered: 30-Mar-10
Posts: 1,098

Re: Nitmod and Lua??

Mind posting your lua script in here ?

Maybe it will help us figuring out the problem smile

P.S.: Are you sure your Weapon ID's list is correct ? I don't remember publishing them anywhere for the moment, so where did you get them ?


iluvnitmod.png

Offline

#3 15-Sep-10 04:38:59

soak
BETA Tester
Registered: 03-Sep-10
Posts: 23

Re: Nitmod and Lua??

I absolutely don't mind publishing it - it is currently a very simple script but I am hoping to expand it to cover most weapons:

et.NUM_WEAPONS = 2

COLT = {
    weapon_id = 7,
    ammoclip = 10,
    ammo = 30
}

AKIMBO_LUGER = {
    weapon_id = 35,
    ammoclip = 2,
    ammo = 2
}

weapons = {
    COLT,
    AKIMBO_LUGER
}


function et_InitGame(levelTime,randomSeed,restart)
        et.G_Print("Custom weapon script loaded.\n")
end

function et_ClientSpawn(clientNum,revived)
    for i=1,(et.NUM_WEAPONS),1 do
        et.gentity_set(clientNum,"ps.ammoclip",weapons[i].weapon_id, weapons[i].ammoclip)
        et.gentity_set(clientNum,"ps.ammo",weapons[i].weapon_id, weapons[i].ammo)
    end
end

I have tested this on single luger and adrenaline as well, it works perfectly. As for the weapon id's - you never published it, I got em straight from the dll. Figured I'd save the trouble of asking you.

Currently when loading the script for double lugers, I get this ammo as default:

8|2|48

Only the right pistol ammo is actually being modified correctly.

Soak

Offline

Board footer

Powered by FluxBB