How I connect shields like "Among the ruins" campaign?
Moderator: Moderators
-
- Private Third Class
- Posts: 52
- Joined: Thu Apr 05, 2018 11:48 am
- Projects :: Kashyyyk Droid Invasion
- xbox live or psn: DaviidHL_
How I connect shields like "Among the ruins" campaign?
In this mission you have to destroy a shield generator to destroy a force shield. I already placed but still not working. Any solutions?
- GAB
- 1st Lieutenant
- Posts: 431
- Joined: Sun Jul 03, 2011 8:56 pm
- Location: Somewhere around the world
- Contact:
Re: How I connect shields like "Among the ruins" campaign?
I don't remeber exactly how they did it, but have a look at the campaign script for the Mygetto mission.
-
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: How I connect shields like "Among the ruins" campaign?
It's probably something along the lines of:DaviidHL wrote:In this mission you have to destroy a shield generator to destroy a force shield. I already placed but still not working. Any solutions?
Code: Select all
OnObjectKillName(KillObject("force_shield_object_name"), "shield_generator_object_name");
Code: Select all
local function ForceShieldDest()
KillObject("force_shield_object_name");
end
OnObjectKillName(ForceShieldDest, "shield_generator_object_name");
-
- Second Lance Corporal
- Posts: 102
- Joined: Sun May 07, 2017 11:31 pm
- Projects :: ANF - ISM Skin Changer - BF1 Ports
- Location: Kentucky, USA
Re: How I connect shields like "Among the ruins" campaign?
I've done something similar with a plasma bridge that can be disabled by destroying it's generator. Like so:
And then to respawn it when the generator is repaired, you can use this code:
EDIT:
Marth's code is prettier tho, I'd go with that if it works
Code: Select all
ff_bridge_destroy = OnObjectKill(
function(object, killer)
if GetEntityName(object) == "myg1_prop_shield_generator" then
KillObject("myg1_prop_energy_collector_shield1") -- if you want to link more shields to it, just add another KillObject line after this one
end
end
)
Code: Select all
ff_bridge_create = OnObjectRepair(
function(object, repairer)
if GetEntityName(object) == "myg1_prop_shield_generator" then
RespawnObject("myg1_prop_energy_collector_shield1") -- if you want to link more shields to it, just add another Respawn Object line after this one
end
end
)
Marth's code is prettier tho, I'd go with that if it works
-
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: How I connect shields like "Among the ruins" campaign?
More on anonymous functions for those interested: http://lua-users.org/wiki/ShortAnonymousFunctionsCalrissian97 wrote:Marth's code is prettier tho, I'd go with that if it works