documentation on modrules.lua?
Moderator: Moderators
documentation on modrules.lua?
In every mod I've seen so far this file seems to have been copied from another mod. But where is the documentation on what everything means?
My mod never had this file and it used to work, now I get errors.
Checked the wiki and searched the forums. Searched Google too. Nada.
The only place I haven't checked yet is the source code but I know from experience it isn't always easy to work things out just by reading it.
Is there something I missed?
My mod never had this file and it used to work, now I get errors.
Checked the wiki and searched the forums. Searched Google too. Nada.
The only place I haven't checked yet is the source code but I know from experience it isn't always easy to work things out just by reading it.
Is there something I missed?
Re: documentation on modrules.lua?
Here's ours from IW. I documented it as best I could from reading the source. However, it looks like I last messed with this file in late 2008 so the information might be outdated and there is likely new stuff by now.
I'd also look at CA's modrules file since they're probably more up to date.
Code: Select all
local modrules = {
reclaim = {
multiReclaim = false, -- boolean - allow only 1 or >1 unit to simultaneously reclaim a feature/corpse
unitMethod = 1, -- int, 1
unitEnergyCostFactor = 0, -- float, 0
unitEfficiency = 1, -- float, 1
featureEnergyCostFactor = 0, -- float, 0
allowEnemies = true, -- bool, true
allowAllies = true, -- bool, true
reclaimMethod = 0, -- 0 is gradual reclaim (ie a small % is reclaimed every tick)
-- 1 is current behaviour - ie one large hit of resources at the end of the reclim period
-- >1 is chunky behaviour - reclaim happens in n equal sized chunks
},
repair = {
energyCostFactor = 0.75, -- how much of the original cost it requires to repair something.
},
resurrect = {
energyCostFactor = 0.5, -- default: 0.5
},
capture = {
energyCostFactor = 0, -- default: 0
},
transportability = {
transportGround = true, -- defaults to true --Can [x] units be transported?
transportHover = true, -- defaults to false
transportShip = false, -- defaults to false
transportAir = true, -- defaults to false
},
flankingbonus = {
defaultMode=0, -- defaults to 1
}, -- 0: no flanking bonus
-- 1: global coords, mobile
-- 2: unit coords, mobile
-- 3: unit coords, locked
experience = {
experienceMult = 1.0, -- defaults to 1.0
-- these are all used in the following form:
-- value = defValue * (1 + (scale * (exp / (exp + 1))))
powerScale = 1.0, -- float, 1.0
healthScale = 0.7, -- float, 0.7
reloadScale = 0.4, -- float, 0.4
},
fireatdead = {
fireAtKilled = false,
fireAtCrashing = false,
},
construction = {
constructionDecay = true, -- bool, true
constructionDecayTime = 8, -- float, 6.66
constructionDecaySpeed = 1, -- float, 0.03
},
sensors = {
los = {
losMipLevel = 4, -- int, 1, must be -1 < n < 7
losMul = 1, -- float, 1
airMipLevel = 2, -- int, 2, must be -1 < n < 31
airLosMul = 1, -- float, 1
},
requireSonarUnderWater = true, -- bool, true
},
nanospray = {
allow_team_colours = false,
},
}
return modrules
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: documentation on modrules.lua?
Any specific questions?SpliFF wrote:In every mod I've seen so far this file seems to have been copied from another mod. But where is the documentation on what everything means?
Last time I checked it was complete, I even added stuff set to default values (because people look at CA first).I'd also look at CA's modrules file since they're probably more up to date.
I used rts/Sim/Misc/ModInfo.* as reference, it doesn't really have much more comments.
Edit: typo
Last edited by SirMaverick on 11 Sep 2010, 16:09, edited 1 time in total.
Re: documentation on modrules.lua?
The comments in the the above mentioned examples tell you what values are allowed. They don't tell you what the values do.
Some may be obvious, others not. For example flankingBonus requires an understanding of how the engine handles flanking (and knowing what flanking even means in a global context). You need to know how mip levels relate to line of sight. Understanding reclaim and nanospray requires a knowledge of Total Annihilation.
Are both files even complete lists?
Anyway I don't have any specific question except where is the documentation? Is there a specific file in the source code where these things have further explanation or has it been assumed everybody knows what they mean?
If I have any specific question it's whether or not this file is required. I didn't have it and spring crashed expecting a table to be returned. Can I return an empty table? Many of these values are meaningless to my game. I'd rather leave out what I don't need to keep the mod 'clean'.
I don't mean to come off as whiney, I expect there actually isn't any documentation, I'm just urging Spring devs to document these changes as they move things out of the engine or we'll end up with thousands of meaningless configuration options that get set through trial and error. That's no way to make a game.
Some may be obvious, others not. For example flankingBonus requires an understanding of how the engine handles flanking (and knowing what flanking even means in a global context). You need to know how mip levels relate to line of sight. Understanding reclaim and nanospray requires a knowledge of Total Annihilation.
Are both files even complete lists?
Anyway I don't have any specific question except where is the documentation? Is there a specific file in the source code where these things have further explanation or has it been assumed everybody knows what they mean?
If I have any specific question it's whether or not this file is required. I didn't have it and spring crashed expecting a table to be returned. Can I return an empty table? Many of these values are meaningless to my game. I'd rather leave out what I don't need to keep the mod 'clean'.
I don't mean to come off as whiney, I expect there actually isn't any documentation, I'm just urging Spring devs to document these changes as they move things out of the engine or we'll end up with thousands of meaningless configuration options that get set through trial and error. That's no way to make a game.
Re: documentation on modrules.lua?
Shouldn't do that in 0.82+. This works fine for me:SpliFF wrote: If I have any specific question it's whether or not this file is required. I didn't have it and spring crashed expecting a table to be returned. Can I return an empty table? Many of these values are meaningless to my game. I'd rather leave out what I don't need to keep the mod 'clean'.
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: documentation on modrules.lua?
As I wrote CA's list seems complete. Source code hasn't changed after last time I checked.SpliFF wrote:Are both files even complete lists?
Afaik no further documentation.Anyway I don't have any specific question except where is the documentation?
Returning empty table sets default values.If I have any specific question it's whether or not this file is required. I didn't have it and spring crashed expecting a table to be returned. Can I return an empty table? Many of these values are meaningless to my game. I'd rather leave out what I don't need to keep the mod 'clean'.
Re: documentation on modrules.lua?
the
could use a
allowEnemies = true, -- bool, true
so people could disable transports kidnapping enemy units.
Code: Select all
transportability = {
transportGround = true, -- defaults to true --Can [x] units be transported?
transportHover = true, -- defaults to false
transportShip = false, -- defaults to false
transportAir = true, -- defaults to false
}
allowEnemies = true, -- bool, true
so people could disable transports kidnapping enemy units.
Re: documentation on modrules.lua?
See the transportByEnemy unitDef tag.
Re: documentation on modrules.lua?
[opens the wiki]trepan wrote:See the transportByEnemy unitDef tag.
http://springrts.com/wiki/Units:FBI
...
http://springrts.com/wiki/All_FBI-varia ... lt%2C_type
...
it isn't there ._.
But it shows up on some posts.
There's a post by smoth from 2007:
transportByEnemy=0;
Fixes all unit naping.
Re: documentation on modrules.lua?
allow_team_colors just got removed:
https://github.com/spring/spring/commit ... 06e0d99158
https://github.com/spring/spring/commit ... 06e0d99158
- The Nixtux
- Posts: 11
- Joined: 13 Dec 2010, 10:26
Re: documentation on modrules.lua?
We use nano spray tag in tech annihilation . As nano spray is colored per faction not per team. Removal of tag was unwelcome imho
Re: documentation on modrules.lua?
Is there a way for gamedevs to replace this? If it exists, please post it for the xta guy and drama avoided.
Re: documentation on modrules.lua?
i guess the nanoColor tag in unitdefs still workss nano spray is colored per faction not per team.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: documentation on modrules.lua?
Nevermind, changing that was stupid. Who is "RT?"
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: documentation on modrules.lua?
I think allowUnitCollisionDamage = false disables all damage caused by unit-wreck, unit-unit and unit-ground collisions.
- The Nixtux
- Posts: 11
- Joined: 13 Dec 2010, 10:26
Re: documentation on modrules.lua?
Just checked and team color nano spray overrides any unidef setting.
Re: documentation on modrules.lua?
knorke wrote:i guess the nanoColor tag in unitdefs still workss nano spray is colored per faction not per team.
if the tag knorke cited works then I don't agree forb.Forboding Angel wrote:Nevermind, changing that was stupid. Who is "RT?"
Re: documentation on modrules.lua?
It works but the players team-nano setting takes priority over it <-- should be fixed.