View topic - Modoptions



All times are UTC + 1 hour


Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Modoptions
PostPosted: 20 Jan 2013, 18:26 
User avatar

Joined: 18 Dec 2012, 04:39
Hi guys,
I've been looking at adding a couple of modoptions to a game, but I can't get my options to show up in the lobby.
For example:
Say I wanted an option to vary the commander's sight range.
This is what I'd put in the mod options.
Code:
{
      key    = "los",
      name   = "Line of Sight",
      desc   = "varies the line of sight of commander",
      type   = "number",
      section= "StartingResourses",
      def    = "4000",
      min    = "2000",
      max    = "10000",
      step   =    100,
   },

Then, to implement this, I'd have to go and edit commoption.lua
and add something like:
Code:
if (los and tonumber(los) ~= 0) then
         Spring.SetUnitSensorRadius(commanderID, "los", los)
      end

inside of the function spawnStartUnit(teamID) block

my problem is nothing is showing up in the lobby. Is there another file I need to edit?


Top
 Offline Profile  
 
 Post subject: Re: Modoptions
PostPosted: 20 Jan 2013, 18:46 
User avatar

Joined: 23 Feb 2009, 16:29
Location: Finland
Does nothing show up in lobby? Does it show mod options (0) ?

In that case, that's because there was a problem with modoptions.lua. It's very sensitive, check that you have commas after each parameter and that the brackets match.


Top
 Offline Profile  
 
 Post subject: Re: Modoptions
PostPosted: 20 Jan 2013, 18:52 
User avatar

Joined: 18 Dec 2012, 04:39
what I wrote above is exactly what I pasted into the modops file. It's really just a copy of the metal energy stuff just with different names

and yes, nothing shows up :?


Top
 Offline Profile  
 
 Post subject: Re: Modoptions
PostPosted: 20 Jan 2013, 18:59 
User avatar

Joined: 23 Feb 2009, 16:29
Location: Finland
Well, if it shows "modoptions (0)" then the reason is a problem with modoptions.lua. Try disabling (commenting) parts of it until you find the flaw.


Top
 Offline Profile  
 
 Post subject: Re: Modoptions
PostPosted: 20 Jan 2013, 19:17 
User avatar

Joined: 18 Dec 2012, 04:39
Jools wrote:
Well, if it shows "modoptions (0)" then the reason is a problem with modoptions.lua. Try disabling (commenting) parts of it until you find the flaw.

do you mean if it shows "modoptions (0)" in the lobby?

I guess I didn't explain the output I was getting too well.
The normal mod options show and work. It's just the one I'm trying to add that won't show.


Top
 Offline Profile  
 
 Post subject: Re: Modoptions
PostPosted: 20 Jan 2013, 19:36 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
StartingResourses
StartingResourses


Does this section exist?


Top
 Offline Profile  
 
 Post subject: Re: Modoptions
PostPosted: 20 Jan 2013, 19:38 
User avatar

Joined: 23 Feb 2009, 16:29
Location: Finland
The only requirement for it to show up is presence of that stuff in modoptions.lua. Did you check key is unique? Did you check it won't who up somewhere else within that section?

The for functionality you need more. It really depends on the mod you are using.


Top
 Offline Profile  
 
 Post subject: Re: Modoptions
PostPosted: 20 Jan 2013, 21:01 
User avatar

Joined: 18 Dec 2012, 04:39
Beherith wrote:
StartingResourses
StartingResourses


Does this section exist?

awesome that fixes the lobby issue lol I'm blind
Thanks guys


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.