Page 1 of 1

Linked Turrets

Posted: Fri Nov 09, 2007 1:11 pm
by EGG_GUTS
Ok I've read Xwingguy's tut and I still don't really under stand could some one help a.k.a Dumb it down for me?
Xwingguy wrote: LinkedFrigate =
{
TurretList = nil, --List of turret names that must be destroyed when the Frigate is destroyed
Frigate = nil, --Name of the frigate (duh)
Do I put the list of frigates and turrets in my map on that part?

I completely don't understand this...
Xwingguy wrote: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.

Code: Select all

	--imp Frigates
	local impfrig1list = {"imp_bldg_frig_turbo", "imp_bldg_frig_turbo1", 
					"imp_bldg_frig_turbo2", "imp_bldg_frig_turbo3",
					"imp_bldg_boxturret8", "imp_bldg_boxturret10",
					 "imp_bldg_boxturret9" }
	ImpFrigate1 = LinkedFrigate:New{TurretList = impfrig1list, Frigate = "imp-frigate"}
	ImpFrigate1:Init()

	--all Frigates
	local allfriglist= {"all_bldg_frig_turbo", "all_bldg_frig_turbo1", 
					"all_bldg_frig_turbo2", "all_bldg_frig_turbo3",
					"all-frigtur1", "all-frigtur2", "all-frigtur3", 
					"all-frigtur4", "all-frigtur5",
					"all-frigtur6", "all-frigtur7", "all-frigtur8"}
	AllFrigate = LinkedFrigate:New{TurretList = allfriglist, Frigate = "all-frigate"}
	AllFrigate:Init()
And for this do I put the oringinal "LinkedDestroyables" Lua back in?
Xwingguy wrote:Rename the LinkedDestroyables.lua that you just modified to "LinkedFrigate" (without quotes).

Cut this file and paste it into data_???\Common\Scripts
[/quote][/quote]

I that's all

Thanks

Re: Linked Turrets

Posted: Fri Nov 09, 2007 8:15 pm
by trainmaster611
I know someone has also posted this somewhere else but for the sake of making everything easier, just add an explosion radius to the frigate_exp.odf

Re: Linked Turrets

Posted: Fri Nov 09, 2007 11:27 pm
by MercuryNoodles
No, don't put anything in the LinkedFrigate lua. Your frigate and turret list go in your map's lua.

Also, LinkedFrigate is supposed to be a new lua, not a replacement for LinkedDestroyables.

Re: Linked Turrets

Posted: Sat Nov 10, 2007 11:59 am
by EGG_GUTS
MercuryNoodles wrote:No, don't put anything in the LinkedFrigate lua. Your frigate and turret list go in your map's lua.

Also, LinkedFrigate is supposed to be a new lua, not a replacement for LinkedDestroyables.
Did you do the linking yet for your space map?

Re: Linked Turrets

Posted: Sun Nov 11, 2007 8:55 am
by MercuryNoodles
Actually, I haven't needed the LinkedFrigate lua. I don't use that many turrets, at least, not yet. What does that have to do with this?

Re: Linked Turrets

Posted: Sun Nov 11, 2007 1:02 pm
by EGG_GUTS
MercuryNoodles wrote:Actually, I haven't needed the LinkedFrigate lua. I don't use that many turrets, at least, not yet. What does that have to do with this?
Because if you were I was wondering if you could to post your Lua as a reference to help me. :wink:

Re: Linked Turrets

Posted: Sun Nov 11, 2007 3:05 pm
by MercuryNoodles
Well, after a little digging, I think the tut wasn't made for beginners. I'll see if I can explain.

1) Go to data_***/Common/Scripts. You need to make a new lua containing the LinkFrigate stuff. Instead of following the crazy instructions, just make a new text file, paste the script contents, and use Save As to name the new file "LinkedFrigate.lua". Confirm the save. (Never, ever just use "save", unless you're purposely overwriting something. Even then, I wouldn't get into the habit of doing that.)

2) Go to data_***/Common, and open the mission.req file. Add "LinkedFrigate" under "script", just like the others. Save it.

3) Open your space map's common lua, and add ScriptCB_DoFile("LinkedFrigate") at the top, with the other lines like it. (ScriptCB_DoFile("setup_teams"))

4) In the same lua, setup the frigate and turret list under function SetupTurrets(). It should go like this:

Code: Select all

local randomturretlistname = {"turret1", "turret2"}
randomfunctionname = LinkedFrigate:New{TurretList = randomturretlistname, Frigate = "ZEfrigatename"}
randomfunctionname:Init()
As should be obivious, you want to put all of your frigate linkage stuff between the "function setupTurrets()" and "end" lines. By "end", I mean the one below "function SetupTurrets" with no spaces before it. Don't break up any other function/end pairings between these two lines.

5)Save, munge, enjoy. Have a cookie. :P

Granted, I'm not at all an expert, but I believe that should be close enough to the mark, and hopefully less confusing.

Re: Linked Turrets

Posted: Wed Nov 14, 2007 4:35 pm
by EGG_GUTS
So how do I tell it which turret is on which frigate?

Re: Linked Turrets

Posted: Wed Nov 14, 2007 10:34 pm
by AceMastermind
First get some paper and a pen, then launch ZE and go into Object edit mode and click on each turret and write down it's name and which frigate it is on.