infantry portal range command station?

PricePrice Join Date: 2003-09-27 Member: 21247Members
Can anyone tell me, where i can find the code that only allows infantry portals be placed in the command station radius?

Comments

  • endarendar Join Date: 2010-07-27 Member: 73256Members, Squad Five Blue
    Balance.lua line 6:

    kInfantryPortalAttachRange = 10

    You should be able to reverse that and find the code. Probably in infantryportal.lua or the command station file (forgot name).
  • PricePrice Join Date: 2003-09-27 Member: 21247Members
    edited February 2012
    <!--quoteo(post=1900598:date=Feb 7 2012, 11:53 AM:name=endar)--><div class='quotetop'>QUOTE (endar @ Feb 7 2012, 11:53 AM) <a href="index.php?act=findpost&pid=1900598"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Balance.lua line 6:

    kInfantryPortalAttachRange = 10<!--QuoteEnd--></div><!--QuoteEEnd-->
    Oh thank you.

    But i can not find the funtion for it in the cs or ip file.
  • endarendar Join Date: 2010-07-27 Member: 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)
  • HarimauHarimau Join Date: 2007-12-24 Member: 63250Members
    edited February 2012
    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.
  • PricePrice Join Date: 2003-09-27 Member: 21247Members
    edited February 2012
    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_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 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?
  • PricePrice Join Date: 2003-09-27 Member: 21247Members
    edited February 2012
    maybe, maybe not ;)
    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.
Sign In or Register to comment.