Page 1 of 1

Trouble with Kashyyyk Barriers

Posted: Sun Nov 26, 2006 9:59 pm
by Zaniac
Ok, so I'm making a Kashyyk Map. In it at two different points on the map I made a pen sort of thing where the wookiees are kept enslaved. As seen here:
http://i129.photobucket.com/albums/p231 ... 8/wok3.jpg

http://i129.photobucket.com/albums/p231 ... 8/wok4.jpg

For those of you who can't see the pics the pen door is blocked off by the Kashyyk Seawall. (the big wooden one)

Now my problem is the wookiees inside crowd around the wooden barricade and with enough running, simply run out of the pen as seen here:
http://i129.photobucket.com/albums/p231 ... 8/wok1.jpg

http://i129.photobucket.com/albums/p231 ... 8/wok2.jpg

How can I stop the wookiees from not running out until someone destroys the front barricade? Any help would be appreciated.

And also, is there any way I can code my lua so that the all/rep focuses on destroying the wooden baricade because as of now they just ignore it. Thanks again.

RE: Trouble with Kashyyyk Barriers

Posted: Sun Nov 26, 2006 10:56 pm
by t551
To stop the wookies, you can place AI barriers.

Posted: Mon Nov 27, 2006 4:37 pm
by Zaniac
I know about AI barriers but I want the wookiees to be able to leave the pen after someone has destroyed the wooden barrier. Like in the shipped Kashyyyk map, how do they do it that the droids don't go through the seawall near the back cp until they have destroyed the switch? I need to learn how to do something like that, does anyone know how to do this?

Posted: Mon Nov 27, 2006 6:49 pm
by valiant
Look in the scripting of the campaign map shipped in the assets.

Posted: Tue Nov 28, 2006 4:54 pm
by Zaniac
Ok, I've taken a look at the KAS scripts and believe I've found what I need, so I copied what I figured I needed out of the script and into mine:
(I renamed everything that was woodl, woodc, or woodr to door1 and door2 becaused that's what I've named the wooden barricades in my map.)
--Gate Stuff --
BlockPlanningGraphArcs("seawall1")
BlockPlanningGraphArcs("door1")
BlockPlanningGraphArcs("door2")
DisableBarriers("disableme");

SetProperty("door1", "MaxHealth", 25000)
SetProperty("door1", "CurHealth", 25000)
SetProperty("door2", "MaxHealth", 25000)
SetProperty("door2", "CurHealth", 25000)

OnObjectKillName(woodl, "door1");
OnObjectKillName(woodc, "woodc");
OnObjectRespawnName(woodll, "door1");
OnObjectRespawnName(woodcr, "door2");
end

function door1()
UnblockPlanningGraphArcs("door1");
DisableBarriers("door1");
SetProperty("door1", "MaxHealth", 1800)
-- SetProperty("door1", "CurHealth", 15)
end

function door2()
UnblockPlanningGraphArcs("door2");
DisableBarriers("door2");
SetProperty("door2", "MaxHealth", 1800)
-- SetProperty("door2", "CurHealth", 15)
end

function door1()
BlockPlanningGraphArcs("door1")
EnableBarriers("door1")
SetProperty("door1", "MaxHealth", 15000)
SetProperty("door1", "CurHealth", 15000)
end

function door2()
BlockPlanningGraphArcs("door2")
EnableBarriers("door2")
SetProperty("door2", "MaxHealth", 15000)
SetProperty("door2", "CurHealth", 15000)
end
After munging this I got these errors:
C:\BF2_ModTools\ToolsFL\Bin\luac.exe: ..\..\common\scripts\KAE\KAEc_con.lua:61: <eof> expected near `end'
ERROR[scriptmunge scripts\KAE\KAEc_con.lua]:Could not read input file.ERROR[scriptmunge scripts\KAE\KAEc_con.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings
I can't find what's wrong, can anyone see what I've done wrong?

How to find the error

Posted: Tue Nov 28, 2006 5:42 pm
by AceMastermind
There appears to be something missing on line 61 in your KAEc_con LUA,
to find line 61, just open KAEc_con in notepad, then hit ctrl+G and type 61, to go to that line.

Posted: Tue Nov 28, 2006 6:14 pm
by Teancum
DisableBarriers("MY_BARRIER_NAME") and EnableBarriers("MY_BARRIER_NAME") will turn barriers on/off.

Posted: Tue Nov 28, 2006 7:59 pm
by Zaniac
Thank you Teancum I'll try that.

Ace: Turns out I just took out line 61 (all it said was: "end") and I didn't get any errors anymore. :lol: I love it when my dumb luck solves my problems.