• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Boolean

Recruit
1 Badges
Sep 11, 2014
2
0
  • Teleglitch: Die More Edition
Hello! I hope somebody can help me with this... I'm learning to mod the game and i'm making a sniper rifle.
It shows up in the crafting menu and everything, but when i craft it the game crashes.

This is the code:

itemtable.sniper = {
clipsize = 12,
spread = 0,
reloadtime = 10,
clipreloadtime = 15,
bulletspeed = 18,
damage = 100,
range = 55,
pierce = 2,
shake = 5,
walldamage = 100,

frame = 0,
holdframe = 5,
shootframe = 6,
reloadframe = 7,
ammotype = 2,
shootsound = "rifle_lask",
reloadsound = "pystol_laadimine",
invtext = "sniper rifle",
longtext = "Very powerful and accurate sniper rifle.\nComes with a scope for long distances.",

bullettypes = bullettypes.explode,
shortcutkey = "sc_1"
}

setmetatable(itemtable.sniper,relvtemplate)
--table.insert(crafttable[7],{"sniper","rifle","fattube","smtimebomb","smtimebomb"})
table.insert(crafttable[7],{"sniper","smtimebomb","emptycan"})

the stderr file says:

ALERROR:alSourcef(alsrcnr,AL_GAIN,gain), at line 487!
lua/relvad.lua:1501: bad argument #-1 to '_CreateWeapon' (number expected, got nil), called at file ..\..\src\game\luainterface.cpp, line
801

I seriously have no idea what's going on. I just copied and pasted my other weapon mod (which works perfectly) and changed some numbers.