• Crusader Kings III Available Now!

    The realm rejoices as Paradox Interactive announces the launch of Crusader Kings III, the latest entry in the publisher’s grand strategy role-playing game franchise. Advisors may now jockey for positions of influence and adversaries should save their schemes for another day, because on this day Crusader Kings III can be purchased on Steam, the Paradox Store, and other major online retailers.


    Real Strategy Requires Cunning

This thread is more than 5 months old.

It is very likely that it does not need any further discussion and thus bumping it serves no purpose. If you feel it is necessary to make a new reply, you can still do so though.

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.
 

Boolean

Recruit
1 Badges
Sep 11, 2014
2
0
  • Teleglitch: Die More Edition
I'm an idiot.
I wrote "bullettypes" instead of "bullettype". I have no idea how i screwed that up.
Sorry...
 

nafastus

Game Producer
63 Badges
Jul 13, 2011
150
0
  • Sengoku
  • Magicka
  • Victoria 2 Beta
  • BATTLETECH
  • Pillars of Eternity
  • Magicka: Wizard Wars Founder Wizard
  • 500k Club
  • War of the Roses
  • Magicka 2 - Signup Campaign
  • Rome: Vae Victis
  • Supreme Ruler 2020
  • Paradox Order
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Hearts of Iron IV Sign-up
  • Tyranny - Bastards Wound
  • Knights of Honor
  • Tyranny - Tales from the Tiers
  • Shadowrun: Hong Kong
  • BATTLETECH - Digital Deluxe Edition
  • Crusader Kings II: Sunset Invasion
  • Sword of the Stars II
  • Crusader Kings II: Sword of Islam
  • Starvoid
  • Teleglitch: Die More Edition
  • The Showdown Effect
  • Victoria 2
  • Europa Universalis III
  • Warlock: Master of the Arcane
  • Crusader Kings II: Legacy of Rome
  • War of the Vikings
  • Crusader Kings II
  • Cities in Motion
  • Arsenal of Democracy
  • For The Glory
  • Hearts of Iron III
  • Heir to the Throne
  • Impire
  • King Arthur II
  • For the Motherland
  • Lead and Gold
  • Leviathan: Warships
  • The Kings Crusade
  • Dungeonland
  • Majesty 2
  • Majesty 2 Collection
  • March of the Eagles
  • Naval War: Arctic Circle
  • Europa Universalis IV
  • Divine Wind
Great to see that it was solved!