Page 1 of 2

Objects appearing in a certain era only? [Solved]

Posted: Fri Nov 28, 2008 8:36 pm
by elfie
Is it possible to make destructable command posts appear only in a certain era and not the other era? Would this be possible even if the eras had the same mode(conquest)? Would it also be possible to have the regular command posts from one era not show up in another era that also has the same mode(conquest)? If this can be done, then how? Thanks in advanced. :D

Re: Objects appearing in a certain era only?

Posted: Fri Nov 28, 2008 8:41 pm
by computergeek
Make a new layer in ZE for the special era that you want the objects to appear in. You will then need to make it's .mrqs and update the word's req. Look at adding a ctf era to see what files need to be changed for the new layer. You then change the era's lua to read that layer

Re: Objects appearing in a certain era only?

Posted: Fri Nov 28, 2008 8:59 pm
by Master_Ben
You could also do something along the same lines: creating a new world (aka world2) w/out the cp's and reference that in the era's lua. This would take up a lot of space though, I think. :runaway:

Re: Objects appearing in a certain era only?

Posted: Fri Nov 28, 2008 10:02 pm
by elfie
computergeek wrote:Make a new layer in ZE for the special era that you want the objects to appear in. You will then need to make it's .mrqs and update the word's req. Look at adding a ctf era to see what files need to be changed for the new layer. You then change the era's lua to read that layer
Okay, got the first part with the .mrqs and I updated the .req, but what do I do to make the lua read the layer?

Re: Objects appearing in a certain era only?

Posted: Fri Nov 28, 2008 10:07 pm
by computergeek
Look for

Code: Select all

    ReadDataFile("dc:***\\***.lvl", "***_eli")
under the memory pools
The "***_eli" part is your layer's name

Follow this tutorial to get your new layer working
Although it is for a hunt mode, you can use it for what you need
I am testing this right now. If it works I'll tell you exactly what I did

Re: Objects appearing in a certain era only?

Posted: Sun Nov 30, 2008 3:20 pm
by elfie
Yeah, I did what you said and followed the tutorials, computergeek, but for some reason the game mode loads, but there are no AI! I am the only person spawning on the map. That seems to happen a lot when I change that line in the lua. Also, I got this error in my munge log which I don't have a clue what it means:

Code: Select all

ERROR[configmunge ]:Input file option $copy: recursive ! must be followed by wildcard. [continuing]
ERROR[configmunge of]:Input file of does not exist. [continuing]
   2 Errors    0 Warnings

Re: Objects appearing in a certain era only?

Posted: Sun Nov 30, 2008 6:06 pm
by computergeek
I don't understand that munge log error, but can you post your BFront2.log?
Make sure that line is referencing the .mrq for your layer
And you saved your .wld after doing the stuff in ZE right?

Re: Objects appearing in a certain era only?

Posted: Sun Nov 30, 2008 10:04 pm
by Eggman
What did you name the layer in ZE, and could you post the section of the .lua you changed? You may have just made a typo in one of them.

As an example, I have a map with different objects in the GCW era. The layer name is "gcwconquest," and in the .lua I have this line:

Code: Select all

    ReadDataFile("dc:MAP\\MAP.lvl", "MAP_gcwconquest")

Re: Objects appearing in a certain era only?

Posted: Mon Dec 01, 2008 12:54 am
by Sky_216
Can't you just use the 'KillObject' function in your luas to remove certain objects from that era?

Re: Objects appearing in a certain era only?

Posted: Mon Dec 01, 2008 7:15 am
by Aman/Pinguin
Skyhammer_216 wrote:Can't you just use the 'KillObject' function in your luas to remove certain objects from that era?
Yes you can, I prefer that way and use it alot.

Re: Objects appearing in a certain era only?

Posted: Mon Dec 01, 2008 7:44 am
by Silas
Dagobah i think does that. There's a crashed clone ship i believe as well as the x-wing in the map. You could try looking for soemthing in the luas maybe. Just another option

Re: Objects appearing in a certain era only?

Posted: Mon Dec 01, 2008 11:36 am
by Teancum
Silas wrote:Dagobah i think does that. There's a crashed clone ship i believe as well as the x-wing in the map. You could try looking for soemthing in the luas maybe. Just another option
Good call, Silas -- for anyone wanting to learn how, he just pointed out the perfect example of how Pandemic did it.

Re: Objects appearing in a certain era only?

Posted: Mon Dec 01, 2008 3:58 pm
by elfie
Teancum wrote:
Silas wrote:Dagobah i think does that. There's a crashed clone ship i believe as well as the x-wing in the map. You could try looking for soemthing in the luas maybe. Just another option
Good call, Silas -- for anyone wanting to learn how, he just pointed out the perfect example of how Pandemic did it.
That way might be easier. The layer thing seems to be creating problems. I don't believe it is a typo, but I will show you my lua:

Code: Select all

  SetSpawnDelay(10.0, 0.25)
    ReadDataFile("dc:TEL\\TEL.lvl", "TEL_headquarters")
    SetDenseEnvironment("true")

Re: Objects appearing in a certain era only?

Posted: Mon Dec 01, 2008 4:12 pm
by Frisbeetarian
Is that the only layer that the mode needs? You said that you have different layers for different modes, does this mean that you only set up a layer for each mode, or did you include a common layer for the modes as well? If so, that layer needs to be loaded also.

Re: Objects appearing in a certain era only?

Posted: Mon Dec 01, 2008 7:56 pm
by elfie
Frisbeetarian wrote:Is that the only layer that the mode needs? You said that you have different layers for different modes, does this mean that you only set up a layer for each mode, or did you include a common layer for the modes as well? If so, that layer needs to be loaded also.
Oh, that is interesting, that might be it. Would this be how I load two layers in one script:

Code: Select all

    SetSpawnDelay(10.0, 0.25)
    ReadDataFile("dc:TEL\\TEL.lvl", "TEL_headquarters")
    ReadDataFile("dc:TEL\\TEL.lvl", "TEL_conquest")
    SetDenseEnvironment("true")
Also guys, I know for sure it is not a typo, because I copy and pasted the layer name directly from Zeroeditor. If this doesn't work than I will try that Dagobah lua function. I will test this out now...

EDIT:
Hmm, now it loads with all the AI, but the CPs are still there because in order for it to work I needed conquest. Is there a way I can keep the conquest mode loaded but simply remove the cps just from that one game mode without needing yet another layer?

Re: Objects appearing in a certain era only?

Posted: Tue Dec 02, 2008 12:17 am
by Frisbeetarian
You'd need to use the KillObject function as stated above if you don't want another layer.

Re: Objects appearing in a certain era only?

Posted: Tue Dec 02, 2008 5:29 pm
by elfie
Frisbeetarian wrote:You'd need to use the KillObject function as stated above if you don't want another layer.
What is the code for that though? Btw thanks for all the help guys :D

Re: Objects appearing in a certain era only?

Posted: Tue Dec 02, 2008 5:45 pm
by Maveritchell
elfie wrote:What is the code for that though?
They already told you. KillObject. Use the Dagobah .lua as a guide (or basically any stock .lua).

Re: Objects appearing in a certain era only?

Posted: Tue Dec 02, 2008 5:49 pm
by elfie
Maveritchell wrote:
elfie wrote:What is the code for that though?
They already told you. KillObject. Use the Dagobah .lua as a guide (or basically any stock .lua).
I tried searching for "killobject", "kill", and "object" in the dagobah lua already and there was nothing there. Is it something simple like "function killobject com_bldg_controlzone"? I'm just not sure what it is really, because I know luas are fairly complex with codes and such.

Re: Objects appearing in a certain era only?

Posted: Tue Dec 02, 2008 6:08 pm
by AceMastermind
Have a look at the Hoth scripts:
KillObject("objectname")
goes inside:
function ScriptPostLoad()