Forged Alliance Forever Forged Alliance Forever Forums 2014-04-09T18:36:59+02:00 /feed.php?f=41&t=7179 2014-04-09T18:36:59+02:00 2014-04-09T18:36:59+02:00 /viewtopic.php?t=7179&p=70894#p70894 <![CDATA[Re: Quesion: Modifying Unit Scripts]]> Statistics: Posted by rockoe10 — 09 Apr 2014, 18:36


]]>
2014-04-09T10:17:48+02:00 2014-04-09T10:17:48+02:00 /viewtopic.php?t=7179&p=70863#p70863 <![CDATA[Re: Quesion: Modifying Unit Scripts]]> Statistics: Posted by IceDreamer — 09 Apr 2014, 10:17


]]>
2014-04-09T07:50:00+02:00 2014-04-09T07:50:00+02:00 /viewtopic.php?t=7179&p=70855#p70855 <![CDATA[Re: Quesion: Modifying Unit Scripts]]>
The blueprint changes are easier. But ATM I'm having some difficulty getting the changed state script to work. I might have a look at this latter.

I think, for now, I will just focus on the other aspects of the submarine balance. A summary of the changes I am currently modelling:

- Increase Torpedo weapon damage by (100% T1, 75% T2, 50% T3/T4)
- Increase Submarine HP by (100% T1, 75% T2, 50% T3/T4)
- Apply sonar stealth capability to all submarines
- Increase underwater vision radius for submarines, frigates, destroyers, battle cruisers, sonar and torpedo platforms.
- Increase sonar range and decrease radar for destroyers
- Decrease underwater vision and sonar range for cruisers, battleships, and missile ships.

Statistics: Posted by Hawkei — 09 Apr 2014, 07:50


]]>
2014-04-09T06:42:46+02:00 2014-04-09T06:42:46+02:00 /viewtopic.php?t=7179&p=70850#p70850 <![CDATA[Re: Quesion: Modifying Unit Scripts]]> Statistics: Posted by IceDreamer — 09 Apr 2014, 06:42


]]>
2014-04-09T02:59:48+02:00 2014-04-09T02:59:48+02:00 /viewtopic.php?t=7179&p=70836#p70836 <![CDATA[Re: Quesion: Modifying Unit Scripts]]>
The code is not yet tested. It will likely need debugging. It is a copy of the state change components from the Selen pasted into the Tigershark script.

Statistics: Posted by Hawkei — 09 Apr 2014, 02:59


]]>
2014-04-09T02:04:19+02:00 2014-04-09T02:04:19+02:00 /viewtopic.php?t=7179&p=70834#p70834 <![CDATA[Re: Quesion: Modifying Unit Scripts]]>
However, something looks wrong with this script. I don't think this "ChangeState( self.unit, self.unit.VisibleState )" is correct :/

Statistics: Posted by IceDreamer — 09 Apr 2014, 02:04


]]>
2014-04-09T02:00:03+02:00 2014-04-09T02:00:03+02:00 /viewtopic.php?t=7179&p=70833#p70833 <![CDATA[Quesion: Modifying Unit Scripts]]>
I have a question about creating mods for units. The basic intention of my mod is to change all non-stealth submarines to become stealthed when stationary and not firing. For this behaviour I have copied the Seraphim combat scout behaviour. Which I have found uses a script instead of blueprint parameters to control its visibility status.

The modified script for the UEF T1 submarine should be as follows:

Code:
#****************************************************************************
#**
#**  File     :  /cdimage/units/UES0203/UES0203_script.lua
#**  Author(s):  John Comes, David Tomandl, Jessica St. Croix
#**
#**  Summary  :  UEF Attack Sub Script
#**
#**  Copyright © 2005 Gas Powered Games, Inc.  All rights reserved.
#**  Modified by Hawkei 2014
#****************************************************************************

local TSubUnit = import('/lua/terranunits.lua').TSubUnit
local TANTorpedoAngler = import('/lua/terranweapons.lua').TANTorpedoAngler
local TDFLightPlasmaCannonWeapon = import('/lua/terranweapons.lua').TDFLightPlasmaCannonWeapon

UES0203 = Class(TSubUnit) {
    PlayDestructionEffects = true,
    DeathThreadDestructionWaitTime = 0,

    Weapons = {
        Torpedo01 = Class(TANTorpedoAngler) {         
         OnWeaponFired = function(self, target)
            SDFPhasicAutoGunWeapon.OnWeaponFired(self, target)
            ChangeState( self.unit, self.unit.VisibleState )
         end,
         
         OnLostTarget = function(self)
            SDFPhasicAutoGunWeapon.OnLostTarget(self)
            if self.unit:IsIdleState() then
                ChangeState( self.unit, self.unit.InvisState )
            end
         end,},
        PlasmaGun = Class(TDFLightPlasmaCannonWeapon) {}
    },

    OnStopBeingBuilt = function(self, builder, layer)

        #These start enabled, so before going to InvisState, disabled them.. they'll be reenabled shortly
           self:DisableUnitIntel('SonarStealth')
      self.Stealthed = false
        ChangeState( self, self.InvisState ) # If spawned in we want the unit to be invis, normally the unit will immediately start moving
    end,
   
    InvisState = State() {
        Main = function(self)
            self.Stealthed = false
            local bp = self:GetBlueprint()
            if bp.Intel.StealthWaitTime then
                WaitSeconds( bp.Intel.StealthWaitTime )
            end
         self:EnableUnitIntel('SonarStealth')
         self.Stealthed = true
        end,
       
        OnMotionHorzEventChange = function(self, new, old)
            if new != 'Stopped' then
                ChangeState( self, self.VisibleState )
            end

    },
   
    VisibleState = State() {
        Main = function(self)
            if self.Cloaked then
                self:DisableUnitIntel('SonarStealth')
         end
        end,
       
        OnMotionHorzEventChange = function(self, new, old)
            if new == 'Stopped' then
                ChangeState( self, self.InvisState )
            end

    },

}


TypeClass = UES0203


So my question is this: Is it possible to merge or overwrite the existing script for the UES0203? Or do I need to create an entirely new unit?

Statistics: Posted by Hawkei — 09 Apr 2014, 02:00


]]>