Destroying Frigate Turrets? (FAQ)
Moderator: Moderators
RE: Destroying Frigate Turrets?
C:\BF2_ModTools\data_SCL\Common\scripts\linkedturrets and linkeddestroyables is what you need although i have no idea how it works as i have never done a space map
-
- Old School Staff
- Posts: 2059
- Joined: Wed Feb 23, 2005 9:54 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
RE: Destroying Frigate Turrets?
he said that
try looking into that file and see if there are actually sometihng IN it
but I think I've seen some turrets on frigates in some campaigns being destroyed as well; just look the file(s) uup for that one

try looking into that file and see if there are actually sometihng IN it

but I think I've seen some turrets on frigates in some campaigns being destroyed as well; just look the file(s) uup for that one

Re: RE: Destroying Frigate Turrets?
Doh!!!Qdin wrote:he said that![]()

Destroy frigate turrets on destruction of frigate
I wrote this code purely to do what you're talking about. Read carefully and remember to put me in your credits.
I call this "LinkedFrigate" (you know like LinkedShields and LinkedDestroyables) and this code that I made actually does it better than what the people at Pandemic did.
Here's what you need to do step by step.
Go to your data_???\Common\Scripts folder and copy the LinkedDestroyables.lua file you will find there and paste it any other folder.
(So we don't accidently overwrite LinkedDestroyables.)
Open the LinkedDestroyables.lua that you just pasted with notepad or word pad and delete ALL of its contents.
Paste this new code in the empty LinkedDestroyables.lua.
Save the file and exit notepad/wordpad.
Rename the LinkedDestroyables.lua that you just modified to "LinkedFrigate" (without quotes).
Move LinkedFrigate.lua to data_???\Common\Scripts
Now you must fix the REQ for the new script file. Open the "mission.req" in data_???\Common folder.
All we're doing is adding 1 line. Underneath "scripts" which is underneath the second REQN add "LinkedFrigate" (with quotes included)
It should look something like this:
Now you've got to add it into your actual game scripts. So open your ???_cmn file in data_???\Common\Scripts\???.
right below where it says ScriptCB_Dofile("setupTeams") add this line:
Now here's where you do the coding for YOUR frigates, I'm just gonna show some example code. (This code should be placed in the setupTurrets() function.)
If you know how to make linkedTurrets or linkedShields, well it's pretty much the same. Here's the key facts:
You must specify TurretList which is the names of the turrets on a certain frigate in the form of an array as shown.
You must specify Frigate which is the name of the certain frigate as shown below.
Sorry if that was too complicated, but I'll anwser any questions.
I call this "LinkedFrigate" (you know like LinkedShields and LinkedDestroyables) and this code that I made actually does it better than what the people at Pandemic did.
Here's what you need to do step by step.
Go to your data_???\Common\Scripts folder and copy the LinkedDestroyables.lua file you will find there and paste it any other folder.
(So we don't accidently overwrite LinkedDestroyables.)
Open the LinkedDestroyables.lua that you just pasted with notepad or word pad and delete ALL of its contents.
Paste this new code in the empty LinkedDestroyables.lua.
Hidden/Spoiler:
Rename the LinkedDestroyables.lua that you just modified to "LinkedFrigate" (without quotes).
Move LinkedFrigate.lua to data_???\Common\Scripts
Now you must fix the REQ for the new script file. Open the "mission.req" in data_???\Common folder.
All we're doing is adding 1 line. Underneath "scripts" which is underneath the second REQN add "LinkedFrigate" (with quotes included)
It should look something like this:
Hidden/Spoiler:
Now you've got to add it into your actual game scripts. So open your ???_cmn file in data_???\Common\Scripts\???.
right below where it says ScriptCB_Dofile("setupTeams") add this line:
Code: Select all
ScriptCB_Dofile("LinkedFrigate")
Now here's where you do the coding for YOUR frigates, I'm just gonna show some example code. (This code should be placed in the setupTurrets() function.)
If you know how to make linkedTurrets or linkedShields, well it's pretty much the same. Here's the key facts:
You must specify TurretList which is the names of the turrets on a certain frigate in the form of an array as shown.
You must specify Frigate which is the name of the certain frigate as shown below.
Hidden/Spoiler:
Sorry if that was too complicated, but I'll anwser any questions.
-
- Old School Staff
- Posts: 2059
- Joined: Wed Feb 23, 2005 9:54 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- wishihadaname
- Captain
- Posts: 493
- Joined: Fri Dec 28, 2007 2:10 pm
- Projects :: The Corellian Resistance
- Location: Look to your left.... no, your other left....
How do I use xwingguys linked frigates?
The tutorial was very good up to the point were it says that I need to define the frigate and the turrets, were does all of that go in the script? also how do I define four differant frigates using only one script?
-
- Space Ranger
- Posts: 5557
- Joined: Tue Aug 17, 2010 3:30 pm
- Projects :: Evolved 2
- Location: Columbus, Ohio
- Contact:
linkedfrigate code probs?
I am haveing trouble getting the script that xwingguy made to work, i get a munge error when i try to munge it, even with the code he supplied in the tutorial unedited. here is my code
here is my munge error log
any ideas?
Hidden/Spoiler:
Code: Select all
C:\BF2_ModTools\ToolsFL\Bin\luac.exe: ..\..\common\scripts\LinkedFrigate.lua:42: unexpected symbol near `='
ERROR[scriptmunge scripts\LinkedFrigate.lua]:Could not read input file.ERROR[scriptmunge scripts\LinkedFrigate.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings
-
- Sith Master
- Posts: 2631
- Joined: Fri Mar 27, 2009 10:23 am
- Projects :: Something cool...
- xbox live or psn: Has no xbox....Yup
- Location: Does whatever a Spiderpig does
- Contact:
Re: linkedfrigate code probs?
In line 42 I extracted above is something wrong with the function. Maybe putting it in "" works?THEWULFMAN wrote:Hidden/Spoiler:any ideas?Code: Select all
C:\BF2_ModTools\ToolsFL\Bin\luac.exe: ..\..\common\scripts\LinkedFrigate.lua:42: unexpected symbol near `='
- DarthD.U.C.K.
- Master of the Force
- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: linkedfrigate code probs?
the line
works without any """s
Code: Select all
New = function(self, o)
-
- Space Ranger
- Posts: 5557
- Joined: Tue Aug 17, 2010 3:30 pm
- Projects :: Evolved 2
- Location: Columbus, Ohio
- Contact:
Re: linkedfrigate code probs?
, nothing working, i cant figure out whats wrong...
its REALY wierd that even xwingguys example code causes the errors
its REALY wierd that even xwingguys example code causes the errors
-
- Master Sergeant
- Posts: 166
- Joined: Sun Mar 31, 2013 2:56 pm
- Projects :: Cato Neimoidia- Invasion
- xbox live or psn: No gamertag set
Re: Destroying Frigate Turrets? (FAQ)
I tried this and i get no munge errors, but when the map crashes bf2 almost instantly after click launch in instant action. I'm trying to do this for three frigates on the cis side.
XXXc_common lua:
Short but strange BF2 error log:
any ideas??
XXXc_common lua:
Hidden/Spoiler:
Hidden/Spoiler:
any ideas??