endarJoin Date: 2010-07-27Member: 73256Members, Squad Five Blue
I don't think its straight forward.
Have a look at ns2utility.lua, line 120
// Make sure we're within range of something that's required (ie, an infantry portal near a command station) local attachRange = LookupTechData(techId, kStructureAttachRange, 0)
That's still only defining a number, and not determining how the range is implemented.
I guess it depends what the OP is trying to do. If they're trying to increase/decrease the range, then just change Balance.lua, line 6: kInfantryPortalAttachRange = 10
If they're trying to decouple the CC from the IP, then: ns2utility.lua, line 130: local buildNearClass = LookupTechData(techId, kStructureBuildNearClass)
which, in the case of the IP, refers to: techData.lua, line 201: { [kTechDataId] = kTechId.InfantryPortal, [kTechDataMapName] = InfantryPortal.kMapName, [kTechDataDisplayName] = "INFANTRY_PORTAL", [kTechDataCostKey] = kInfantryPortalCost, [kTechDataPointValue] = kInfantryPortalPointValue, [kTechDataBuildTime] = kInfantryPortalBuildTime, [kTechDataMaxHealth] = kInfantryPortalHealth, [kTechDataMaxArmor] = kInfantryPortalArmor, [kTechDataModel] = InfantryPortal.kModelName, <!--coloro:#00FF00--><span style="color:#00FF00"><!--/coloro-->[kStructureBuildNearClass] = "CommandStation", [kStructureAttachId] = kTechId.CommandStation, [kStructureAttachRange] = kInfantryPortalAttachRange,<!--colorc--></span><!--/colorc--> [kTechDataEngagementDistance] = kInfantryPortalEngagementDistance, [kTechDataHotkey] = Move.P, [kTechDataNotOnInfestation] = true, [kTechDataTooltipInfo] = "INFANTRY_PORTAL_TOOLTIP"},
You'd have to look at the other stuff in techData.lua to see how to deal with it (but I think you might just be able to remove it). Same, but opposite, for if they're trying to make other structures be attached to some structure (e.g. making sentries only buildable near some other structure).
If they're trying to change something else, like I don't know, changing the shape of the allowable build area from a circle to a square, or only making IPs be able to be built in certain rooms, then they'd have to look deeper.
Oh its balancemisc and techdata, now i know how it works ;) Thank you guys, specialy harimau! <img src="http://img830.imageshack.us/img830/9254/68311925.jpg" border="0" class="linked-image" /> the only thing i have to create is that the sentrys goes offline if the tf is destroyed and online if another tf is in range.
Soul_RiderMod BeanJoin Date: 2004-06-19Member: 29388Members, Constellation, Squad Five Blue
I wondered when someone was going to do this :)
The question is, are you doing this to provide a possible solution to turret spam in NS2? Or are you doing this as the 1st step in a Classic NS1 recreation mod?
Comments
kInfantryPortalAttachRange = 10
You should be able to reverse that and find the code. Probably in infantryportal.lua or the command station file (forgot name).
kInfantryPortalAttachRange = 10<!--QuoteEnd--></div><!--QuoteEEnd-->
Oh thank you.
But i can not find the funtion for it in the cs or ip file.
Have a look at ns2utility.lua, line 120
// Make sure we're within range of something that's required (ie, an infantry portal near a command station)
local attachRange = LookupTechData(techId, kStructureAttachRange, 0)
I guess it depends what the OP is trying to do. If they're trying to increase/decrease the range, then just change
Balance.lua, line 6:
kInfantryPortalAttachRange = 10
If they're trying to decouple the CC from the IP, then:
ns2utility.lua, line 130:
local buildNearClass = LookupTechData(techId, kStructureBuildNearClass)
which, in the case of the IP, refers to:
techData.lua, line 201:
{ [kTechDataId] = kTechId.InfantryPortal, [kTechDataMapName] = InfantryPortal.kMapName, [kTechDataDisplayName] = "INFANTRY_PORTAL", [kTechDataCostKey] = kInfantryPortalCost, [kTechDataPointValue] = kInfantryPortalPointValue, [kTechDataBuildTime] = kInfantryPortalBuildTime, [kTechDataMaxHealth] = kInfantryPortalHealth, [kTechDataMaxArmor] = kInfantryPortalArmor, [kTechDataModel] = InfantryPortal.kModelName, <!--coloro:#00FF00--><span style="color:#00FF00"><!--/coloro-->[kStructureBuildNearClass] = "CommandStation", [kStructureAttachId] = kTechId.CommandStation, [kStructureAttachRange] = kInfantryPortalAttachRange,<!--colorc--></span><!--/colorc--> [kTechDataEngagementDistance] = kInfantryPortalEngagementDistance, [kTechDataHotkey] = Move.P, [kTechDataNotOnInfestation] = true, [kTechDataTooltipInfo] = "INFANTRY_PORTAL_TOOLTIP"},
You'd have to look at the other stuff in techData.lua to see how to deal with it (but I think you might just be able to remove it).
Same, but opposite, for if they're trying to make other structures be attached to some structure (e.g. making sentries only buildable near some other structure).
If they're trying to change something else, like I don't know, changing the shape of the allowable build area from a circle to a square, or only making IPs be able to be built in certain rooms, then they'd have to look deeper.
Thank you guys, specialy harimau!
<img src="http://img830.imageshack.us/img830/9254/68311925.jpg" border="0" class="linked-image" />
the only thing i have to create is that the sentrys goes offline if the tf is destroyed and online if another tf is in range.
The question is, are you doing this to provide a possible solution to turret spam in NS2? Or are you doing this as the 1st step in a Classic NS1 recreation mod?
For now i just try, but its not that easy for me.
I got stuck on turn the sentry off if the TF is destroyed in range.