|
 |
| Author |
Message |
|
Israelidomination
|
Posted: 24 May, 2012
|
|
Joined: 30 May, 2008 Posts: 118 Location: Under the brick and steel of a nondescript building
|
I'm trying to modify the scripts of the Novax defence satellite and the station itself so that if the satellite dies or self destructs the sation itself will build a new one instead of self destructing. I tried using the forged alliance forever script for the rebuilding pods fix by modifying it slightly: Code: NotifyOfSatelliteDeath = function(self, Satellite) end,
RebuildSatellite = function(self, Satellite) local ecobp = self:GetBlueprint().Satellite self.RebuildingSatellite = CreateEconomyEvent(self, 1600, 160, 10, self.SetWorkProgress) self:RequestRefreshUI() WaitFor(self.RebuildingSatellite) self:SetWorkProgress(0.0) self.AnimManip = CreateAnimator(self) self.AnimManip:PlayAnim( '/units/XEB2402/XEB2402_aopen.sca' ) self.Trash:Add(self.AnimManip) self:PlayUnitSound('MoveArms') WaitFor( self.AnimManip ) local location = self:GetPosition('Attachpoint01') local pod = CreateUnitHPR('UEA0002', self:GetArmy(), location[1], location[2], location[3], 0, 0, 0) pod:SetParent(self, 'Satellite') pod:SetCreator(self) self.Trash:Add(Satellite) self.satellite = Satellite else end, This didn't work, however. Also, if possible, I'd like to modify the UEF SCU to rebuild its pod as well.
|
|
| Top |
|
 |
|
DeadMG
|
Posted: 25 May, 2012
|
|
Joined: 15 Feb, 2007 Posts: 20036 Location: Presumably, at the time of posting, his computer.
|
Israelidomination wrote: This didn't work, however. Also, if possible, I'd like to modify the UEF SCU to rebuild its pod as well. Thanks so much for all the relevant information. I am now going to psychically divine both the problem and the solution from your mind. Wait, that only works on people who are not ******* morons.
_________________ I'm watchin you!
|
|
| Top |
|
 |
|
Domino
|
Posted: 25 May, 2012
|
|
Joined: 26 Feb, 2009 Posts: 2996
|
|
Hi,
If bm doesnt tell you how to do it tonight, ill tell you how to make it build the satalite (not create) tomorrow as im to tired tonight. totally whacked out had a very busy day.
_________________ Domino. ______________
|
|
| Top |
|
 |
|
Israelidomination
|
Posted: 28 May, 2012
|
|
Joined: 30 May, 2008 Posts: 118 Location: Under the brick and steel of a nondescript building
|
Quote: Wait, that only works on people who are not ******* morons. Israelidomination wrote: This didn't work, however. Also, if possible, I'd like to modify the UEF SCU to rebuild its pod as well. Thanks so much for all the relevant information. I am now going to psychically divine both the problem and the solution from your mind. Wait, that only works on people who are not ******* morons. Then this should work out well then. But srsly DeadMG, if you're gonna be a jerk, go back to watching your... you know, whatever you were watching before reading my post. Perhaps you don't actually have the knowledge of coding to do squat with the game. You made some good mods, though, so for now I'll just assume your account has been hijacked by an *sshole. The satellite station simply behaves as it normally does, the script I added apparently does nothing.
|
|
| Top |
|
 |
|
DeadMG
|
Posted: 30 May, 2012
|
|
Joined: 15 Feb, 2007 Posts: 20036 Location: Presumably, at the time of posting, his computer.
|
|
You deserve it. Why are you wasting my time asking for help when you can't even be bothered to describe the problem you're having? It's offensive to people who actually take time out to try and help people- such as me.
_________________ I'm watchin you!
|
|
| Top |
|
 |
|
Israelidomination
|
Posted: 30 May, 2012
|
|
Joined: 30 May, 2008 Posts: 118 Location: Under the brick and steel of a nondescript building
|
|
I'm asking for coding help here. It is obvious to anyone reading that I didn't waste your time, you keep coming back and responding. Derail some other thread please...
The code I used is above. I'll repeat that the code has no apparent affect in game. When I self destruct the Novax, the center will also explode instead of rebuilding another satellite. Should I not have used the command "self, satellite" and used some other script line that I don't know about? What am I doing wrong?
Look DeadMG, you are a great modder, but would you calm down long enough to read my posts? If you won't stop hyperventillating, vent by playing Supcom or something. Punch your neighbor's doberman, maybe get strung out on acid and bite off someone's face, run for congress, do something, anything but rage on my mod problem topic. Pretty please.
P.S. To anyone who is in the mood, plz help
|
|
| Top |
|
 |
|
liveordie
|
Posted: 30 May, 2012
|
|
Joined: 02 Jul, 2010 Posts: 1261
|
|
| Top |
|
 |
|
Domino
|
Posted: 31 May, 2012
|
|
Joined: 26 Feb, 2009 Posts: 2996
|
Hi, Its actually quite easy to achieve your goal, but it involves an override of the OnKilled function in the satelites script. (xea0002) when the satelite dies, it does indeed also kill the parent (xeb2402) and vice versa. to stop this and only have the satelite die and create a new satelite, id do something like this.. hook the satelite script you only need to add the OnKilled function, override it with this.. XEA0002Code: OnKilled = function(self, instigator, type, overkillRatio) if self.IsDying then return end local wep = self:GetWeaponByLabel('OrbitalDeathLaserWeapon') for k, v in wep.Beams do v.Beam:Disable() end self.IsDying = true self.Parent:CreateNewSatelite() --> new function. TAirUnit.OnKilled(self, instigator, type, overkillRatio) end, ok now in the novax script hook it and add this, XEB2402Code: CreateNewSatelite = function(self) self.Satellite = nil -- its dying so let it die. ChangeState( self, self.WaitForSatDeath ) --> change state to wait for the old sat to die. end,
WaitForSatDeath = State() { Main = function(self) WaitSeconds(3) --> wait for the old sat to die. ChangeState( self, self.OpenState ) --> create the new satelite. end } and hapiness reigns supreme. if the change state doesnt work, we can rethink it to use a Forkthread instead, howeve rim confidant this will work.. i personally havent tested it.
_________________ Domino. ______________
|
|
| Top |
|
 |
|
Cursix
|
Posted: 31 May, 2012
|
|
Joined: 14 Apr, 2012 Posts: 9 Location: USA
|
liveordie wrote: Umm i thought the Sat only died if the station did  . In stock yes, but there are some mods that have sat defenses that shoot down sats. So there may be a reason to have the Novax rebuild the sat. Israelidomination, did you put in a function to catch the death of the sat? For example, the pods for the ACU have this function in them (UEA0001): Code: OnKilled = function(self, instigator, type, overkillRatio) self.Parent:NotifyOfPodDeath(self.Pod) self.Parent = nil TConstructionUnit.OnKilled(self, instigator, type, overkillRatio) end, Which in turn activates this in the ACU's script: Code: NotifyOfPodDeath = function(self, pod) if pod == 'LeftPod' then if self.HasLeftPod == false then #for fixing bug! return end self:ForkThread(self.RebuildPod,1) elseif pod == 'RightPod' then if self.HasRightPod == false then #for fixing bug! return end self:ForkThread(self.RebuildPod,2) end end, From what you pasted, it looks like your NotifyOfSatelliteDeath does nothing and you didn't provide the script for the actual sat which should be calling that function inside its OnKilled function. Or you could do what Domino suggested.
_________________ "Linux is user friendly... ...it's just very selective about who its friends are."
|
|
| Top |
|
 |
|
Israelidomination
|
Posted: 11 Aug, 2012
|
|
Joined: 30 May, 2008 Posts: 118 Location: Under the brick and steel of a nondescript building
|
My computer hard drive died so I haven't been able to work on this for a while. I have a solution to the SCU rebuilding its pods when they are killed: Code: RebuildPod = function(self, Pod) local ecobp = self:GetBlueprint().Pod self.RebuildingPod = CreateEconomyEvent(self, 1600, 160, 10, self.SetWorkProgress) self:RequestRefreshUI() WaitFor(self.RebuildingPod) self:SetWorkProgress(0.0) local location = self:GetPosition('AttachSpecial01') local pod = CreateUnitHPR('UEA0003', self:GetArmy(), location[1], location[2], location[3], 0, 0, 0) pod:SetParent(self, 'Pod') pod:SetCreator(self) self.Trash:Add(pod) self.HasPod = true self.Pod = pod self:RequestRefreshUI() end, NotifyOfPodDeath = function(self, pod) if self.HasPod == true then #for fixing bug! self:ForkThread(self.RebuildPod) else self:ForkThread(self.RebuildPod) --return end end, On an unrelated note, I also have code that adds more build bots to the Cybran ACU and SCU depending on weather or not they have build rate upgrades. The ACU adds 5 build bots for each tech upgrade and the SCU adds 1 buildbot for the rapid-fabricator upgrade. As an example this is the ACU code: Code: CreateBuildEffects = function( self, unitBeingBuilt, order ) if Buff.HasBuff( self, 'CybranACUT3BuildRate' ) then EffectUtil.SpawnBuildBots( self, unitBeingBuilt, 15, self.BuildEffectsBag ) EffectUtil.CreateCybranBuildBeams( self, unitBeingBuilt, self:GetBlueprint().General.BuildBones.BuildEffectBones, self.BuildEffectsBag ) elseif Buff.HasBuff( self, 'CybranACUT2BuildRate' ) then EffectUtil.SpawnBuildBots( self, unitBeingBuilt, 10, self.BuildEffectsBag ) EffectUtil.CreateCybranBuildBeams( self, unitBeingBuilt, self:GetBlueprint().General.BuildBones.BuildEffectBones, self.BuildEffectsBag ) else EffectUtil.SpawnBuildBots( self, unitBeingBuilt, 5, self.BuildEffectsBag ) EffectUtil.CreateCybranBuildBeams( self, unitBeingBuilt, self:GetBlueprint().General.BuildBones.BuildEffectBones, self.BuildEffectsBag ) end end, I'll look at the satellite station later... P.S. Did you know that both the Cybran and Seraphim ACUs have personal shield meshes in their files?
|
|
| Top |
|
 |
 |
 |
|