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?
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.
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.
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