Quick question: separate weapon Lua file not working - Page 2

Quick question: separate weapon Lua file not working

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

User avatar
PTSnoop
Posts: 97
Joined: 09 Sep 2009, 19:05

Re: Quick question: separate weapon Lua file not working

Post by PTSnoop »

Code: Select all

def = cubescoutlightning,
The unit loads, but can't attack.

Same with

Code: Select all

weapons = {
    {
      def = "cubescoutlightning",
    },
},

--

weapons = {
      def = cubescoutlightning,
},

--

weapons = {
      def = "cubescoutlightning",
},

But I've found out that

Code: Select all

weapons = {
      "cubescoutlightning",
},
works fine. The only snag is I'm not sure how to add OnlyTargetCategories to weapons this way.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Quick question: separate weapon Lua file not working

Post by Argh »

Hmm. Try onlytargetcategory outside the weapon brackets.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Quick question: separate weapon Lua file not working

Post by lurker »

When I said argh was wrong about what he had posted at the time, I meant it. WeaponDefNames is a NOTHING inside of defs. And yes, since cubescoutlightning is not a variable but a string, it needs quotes. Argh is also entirely wrong about needing to use false/true instead of 0/1.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Quick question: separate weapon Lua file not working

Post by Argh »

If you'd like to show a complete, how-do-you-do-this solution, be my guest :mrgreen:
Post Reply

Return to “Game Development”