I know many people have asked if bombs can affect friendly units, as explosions don't just hurt enemies, but everything in it's range. Well I finally figured that one out. I used Boba Fetts harmonic bomb, and attached a lua script to the projectile... Hostile Put that line in the "Harmonic" bombs unit code. Heres the .lua script, copy it to notepad, then save it as Hostile.lua in the SWFOC\DATA\SCRIPTS\GAMEOBJECT\ folder....
--///////////////////////////////////////////////////////////////////////////////////////////////// --Hostile by Sidious Invader. --///////////////////////////////////////////////////////////////////////////////////////////////// require("PGStateMachine") require("PGStoryMode") function Definitions() DebugMessage("%s -- In Definitions", tostring(Script)) Define_State("State_Init", State_Init); end function State_Init(message) if message == OnEnter then hostile = Find_Player("Hostile") closest_target = Find_First_Object("Proj_Harmonic_Bomb_Slave_I3") closest_target.Change_Owner(hostile) end end
Now, all this script really does is change it's faction from Empire(Boba's faction) to faction "Hostile" after it's created(dropped.) Then bam all units in it's blast radius are damaged, including Boba Fett! Hope you like it!!
Yay that's some cool code!! Although I'm probably not going to use this in game, it's some cool stuff to learn from^^
:bows::bows::bows: <- that's speaking for itself, I suppose
I can't imagine what I'd use this for, but nice job. :)
For realism, my friend. How does it look like when bombardment smashes everything in sight but your units don't even get scratched?
daang! i dig your style. ahah. ima use it. thank youu man.
I have been pissed of about the frendly fire issue since the game came out,that changes today :D
Filo;4564819For realism, my friend. How does it look like when bombardment smashes everything in sight but your units don't even get scratched?
Yeah, well I'm a cheap bastard, and I prefer clumping lots of area effect attacks against my foes. :p
Alast, some more quality work from SI. Now one question, can it find multiple harmonic bomb projectiles/objects?
Yeah, in the code instead of Find_First_Object(), I should have used Find_All_Objects_Of_Type().