Page 1 of 1

DeathRegion Error

Posted: Wed Jul 08, 2009 3:16 pm
by Frog
whenever i make a death region ingame i name it "deathergion1" and add it in my LUA but nothing happens ingame u survive?
heres where i added it in my LUA

Hidden/Spoiler:
--start header
function ScriptInit()
local CIS = 1
local REP = 2
local ATT = 1
local DEF = 2
--end header
--start objectives
AddMissionObjective(REP,"red",

"level.Must.objectives.1");
AddMissionObjective(REP,"orange",

"level.Must.objectives.2");
AddMissionObjective(REP,"orange",

"level.Must.objectives.3");
AddMissionObjective(CIS,"red",

"level.Must.objectives.1");
AddMissionObjective(CIS,"orange",

"level.Must.objectives.2");
AddMissionObjective

(CIS,"orange","level.Must.objectives.3");
--end objectives
--start soundlvl
ReadDataFile("sound\\tat.lvl;tat1cw");
--end soundlvl

-- Start sidelvls
ReadDataFile("SIDE\\cis.lvl",
"cis_inf_basic",
"cis_inf_countdooku",
"cis_inf_droideka");
ReadDataFile("SIDE\\rep.lvl",
"rep_inf_basic",
"rep_inf_macewindu",
"rep_inf_jet_trooper");
--end sidelvls
--start loadouts
SetTeamName(CIS, "CIS")
SetTeamIcon(CIS, "cis_icon")
AddUnitClass(CIS, "cis_inf_battledroid",10)
AddUnitClass(CIS, "cis_inf_assault",1)
AddUnitClass(CIS, "cis_inf_pilotdroid",2)
AddUnitClass(CIS, "cis_inf_assassindroid",2)
AddUnitClass(CIS, "cis_inf_droideka",1)
SetHeroClass(CIS, "cis_inf_countdooku")
SetTeamName(REP, "Republic")
SetTeamIcon(REP, "rep_icon")
AddUnitClass(REP, "rep_inf_clone_trooper",10)
AddUnitClass(REP, "rep_inf_arc_trooper",1)
AddUnitClass(REP, "rep_inf_clone_pilot",2)
AddUnitClass(REP, "rep_inf_clone_sharpshooter",2)
AddUnitClass(REP, "rep_inf_jet_trooper",1)
SetHeroClass(REP, "rep_inf_macewindu")
--end loadouts
--start teamstats
SetUnitCount(ATT, 16)
SetReinforcementCount(ATT, 200)
SetUnitCount(DEF, 16)
SetReinforcementCount(DEF, 200)
--end teamstats
--start alliances
SetTeamAsFriend(ATT, 1)
SetTeamAsEnemy(ATT, 2)
SetTeamAsFriend(DEF, 2)
SetTeamAsEnemy(DEF, 1)
SetAttackingTeam(ATT);
--end alliances

--start memorypools
ClearWalkers()
AddWalkerType(0, 4)-- special -> droidekas
AddWalkerType(1, 4)-- 1x2 (1 pair of legs)
AddWalkerType(2, 0)-- 2x2 (2 pairs of legs)
AddWalkerType(3, 0)-- 3x2 (3 pairs of legs)
SetMemoryPoolSize("PowerupItem", 60)
SetMemoryPoolSize("EntityMine", 40)
--end memorypools
--start worldlvl
ReadDataFile("dc:Must\\Must.lvl")
--end worldlvl
--start spawndelay
SetSpawnDelay(10.0, 0.25)
--end spawndelay
-- SetMaxFlyHeight(200)
-- SetMaxPlayerFlyHeight(200)
--start ainotify
--end ainotify
--start stayinturrets
--end stayinturrets
--start denseenvironment
SetDenseEnvironment("false")
--end denseenvironment
--AddDeathRegion("deathregion") <----
--AddDeathRegion("deathregion2") <----
--AddDeathRegion("deathregion3")<----





--start soundconfig
OpenAudioStream("sound\\tat.lvl","tatcw_music");
OpenAudioStream("sound\\tat.lvl","tat1");
OpenAudioStream("sound\\tat.lvl","tat1");
OpenAudioStream("sound\\cw.lvl","cw_vo");
OpenAudioStream("sound\\cw.lvl","cw_tac_vo");
OpenAudioStream("sound\\tat.lvl","tat1_emt");
SetBleedingVoiceOver

(CIS,CIS,"cis_off_com_report_us_overwhelmed",1);
SetBleedingVoiceOver

(CIS,REP,"cis_off_com_report_enemy_losing",1);
SetBleedingVoiceOver

(REP,CIS,"rep_off_com_report_enemy_losing",1);
SetBleedingVoiceOver

(REP,REP,"rep_off_com_report_us_overwhelmed",1);
SetLowReinforcementsVoiceOver(CIS, CIS,

"cis_off_defeat_im", .1,1);
SetLowReinforcementsVoiceOver(CIS, REP,

"cis_off_victory_im", .1,1);
SetLowReinforcementsVoiceOver(REP, REP,

"rep_off_defeat_im", .1,1);
SetLowReinforcementsVoiceOver(REP, CIS,

"rep_off_victory_im", .1,1);
SetOutOfBoundsVoiceOver(2,"Allleaving");
SetOutOfBoundsVoiceOver(1,"Impleaving");
SetAmbientMusic(CIS,1.0,"cis_tat_amb_start",0,1);
SetAmbientMusic(CIS,0.99,"cis_tat_amb_middle",1,1);
SetAmbientMusic(CIS,0.1,"cis_tat_amb_end",2,1);
SetAmbientMusic(REP,1.0,"rep_tat_amb_start",0,1);
SetAmbientMusic(REP,0.99,"rep_tat_amb_middle",1,1);
SetAmbientMusic(REP,0.1,"rep_tat_amb_end",2,1);
SetVictoryMusic(CIS,"cis_tat_amb_victory");
SetDefeatMusic (CIS,"cis_tat_amb_defeat");
SetVictoryMusic(REP,"rep_tat_amb_victory");
SetDefeatMusic (REP,"rep_tat_amb_defeat");
SetSoundEffect

("ScopeDisplayZoomIn","binocularzoomin");
SetSoundEffect

("ScopeDisplayZoomOut","binocularzoomout");
SetSoundEffect

("SpawnDisplayUnitChange","shell_select_unit");
SetSoundEffect

("SpawnDisplayUnitAccept","shell_menu_enter");
SetSoundEffect

("SpawnDisplaySpawnPointChange","shell_select_change")

;
SetSoundEffect

("SpawnDisplaySpawnPointAccept","shell_menu_enter");
SetSoundEffect("SpawnDisplayBack","shell_menu_exit");
SetPlanetaryBonusVoiceOver

(REP,REP,0,"rep_bonus_rep_medical");
SetPlanetaryBonusVoiceOver

(REP,CIS,0,"rep_bonus_cis_medical");
SetPlanetaryBonusVoiceOver(REP,REP,1,"");
SetPlanetaryBonusVoiceOver(REP,CIS,1,"");
SetPlanetaryBonusVoiceOver

(REP,REP,2,"rep_bonus_rep_sensors");
SetPlanetaryBonusVoiceOver

(REP,CIS,2,"rep_bonus_cis_sensors");
SetPlanetaryBonusVoiceOver

(REP,REP,3,"rep_bonus_rep_hero");
SetPlanetaryBonusVoiceOver

(REP,CIS,3,"rep_bonus_cis_hero");
SetPlanetaryBonusVoiceOver

(REP,REP,4,"rep_bonus_rep_reserves");
SetPlanetaryBonusVoiceOver

(REP,CIS,4,"rep_bonus_cis_reserves");
SetPlanetaryBonusVoiceOver

(REP,REP,5,"rep_bonus_rep_sabotage");--sabotage
SetPlanetaryBonusVoiceOver

(REP,CIS,5,"rep_bonus_cis_sabotage");
SetPlanetaryBonusVoiceOver(REP,REP,6,"");
SetPlanetaryBonusVoiceOver(REP,CIS,6,"");
SetPlanetaryBonusVoiceOver

(REP,REP,7,"rep_bonus_rep_training");--advanced

training
SetPlanetaryBonusVoiceOver

(REP,CIS,7,"rep_bonus_cis_training");--advanced

training
SetPlanetaryBonusVoiceOver

(CIS,CIS,0,"cis_bonus_cis_medical");
SetPlanetaryBonusVoiceOver

(CIS,REP,0,"cis_bonus_rep_medical");
SetPlanetaryBonusVoiceOver(CIS,CIS,1,"");
SetPlanetaryBonusVoiceOver(CIS,REP,1,"");
SetPlanetaryBonusVoiceOver

(CIS,CIS,2,"cis_bonus_cis_sensors");
SetPlanetaryBonusVoiceOver

(CIS,REP,2,"cis_bonus_rep_sensors");
SetPlanetaryBonusVoiceOver

(CIS,CIS,3,"cis_bonus_cis_hero");
SetPlanetaryBonusVoiceOver

(CIS,REP,3,"cis_bonus_rep_hero");
SetPlanetaryBonusVoiceOver

(CIS,CIS,4,"cis_bonus_cis_reserves");
SetPlanetaryBonusVoiceOver

(CIS,REP,4,"cis_bonus_rep_reserves");
SetPlanetaryBonusVoiceOver

(CIS,CIS,5,"cis_bonus_cis_sabotage");--sabotage
SetPlanetaryBonusVoiceOver

(CIS,REP,5,"cis_bonus_rep_sabotage");
SetPlanetaryBonusVoiceOver(CIS,CIS,6,"");
SetPlanetaryBonusVoiceOver(CIS,REP,6,"");
SetPlanetaryBonusVoiceOver

(CIS,CIS,7,"cis_bonus_cis_training");--advanced

training
SetPlanetaryBonusVoiceOver

(CIS,REP,7,"cis_bonus_rep_training");--advanced

training
--end soundconfig



--start activebonus
--end activebonus

--start camerashots
AddCameraShot(-0.404895, 0.000992, -0.914360, -

0.002240, -85.539894, 20.536297, 141.699493);
AddCameraShot(0.040922, 0.004049, -0.994299, 0.098381,

-139.729523, 17.546598, -34.360893);
AddCameraShot(-0.312360, 0.016223, -0.948547, -

0.049263, -217.381485, 20.150953, 54.514324);
--end camerashots

--start footer
end
--end footer

Re: DeathRegion Error

Posted: Wed Jul 08, 2009 4:07 pm
by newguy99
You must remove the three
--
--
--
tags from the lua because this tells the computer not to read that part!
:wink:

Re: DeathRegion Error

Posted: Wed Jul 08, 2009 4:12 pm
by Frog
well ok i removed the tags but now when i test the map it crashes :P
Hidden/Spoiler:
ReadDataFile("dc:Must\\Must.lvl")
--end worldlvl
--start spawndelay
SetSpawnDelay(10.0, 0.25)
--end spawndelay
--start ainotify
--end ainotify
--start stayinturrets
--end stayinturrets
--start denseenvironment
SetDenseEnvironment("false")
--end denseenvironment
AddDeathRegion("deathregion")
AddDeathRegion("deathregion2")
AddDeathRegion("deathregion3")




--start soundconfig
OpenAudioStream("sound\\tat.lvl","tatcw_music");
OpenAudioStream("sound\\tat.lvl","tat1");
OpenAudioStream("sound\\tat.lvl","tat1");
OpenAudioStream("sound\\cw.lvl","cw_vo");
theres the new LUA

Re: DeathRegion Error

Posted: Wed Jul 08, 2009 5:12 pm
by newguy99
Hidden/Spoiler:
--end camerashots

(>try adding death region part here<)

--start footer
end
--end footer
P.S. Sorry, I went back to the documentation and this fix might be only for SWBF 2 so I might have to find someone else who knows SWBF 1 :oops:

Re: DeathRegion Error

Posted: Wed Jul 08, 2009 5:16 pm
by Frog
its ok i found the error cuz i accidently typed one little thing in my LUA so it like crashed it every time so i fixed it thanks for your help

Re: DeathRegion Error

Posted: Wed Jul 08, 2009 5:18 pm
by newguy99
Yea,
NP, Glad the problem is fixed! And that I could be of help.

Re: DeathRegion Error

Posted: Thu Jul 09, 2009 2:05 pm
by Frog
ugh nothing still doesnt wanna work idk if its the LUA thats filled out wrong or the deathregion part in Zeroeditor

Re: DeathRegion Error

Posted: Thu Jul 09, 2009 2:56 pm
by ANDEWEGET
the lua looks right, so it could be something with the ZE part

Re: DeathRegion Error

Posted: Thu Jul 09, 2009 3:15 pm
by Frog
ummmm idk how to put pictures on here but heres wat i can do

my Region:ID is deathregion
then properties and everything else is blank

Re: DeathRegion Error

Posted: Thu Jul 09, 2009 4:15 pm
by newguy99
You can leave region ID with what ever you had it at,
but the properties must be "DeathRegion" or something like that,

so just fill in the propertys and if the lua aready points to the ID then leave the ID what it is.
I think that might be the problem that the properties is blank. :?

Re: DeathRegion Error

Posted: Thu Jul 09, 2009 8:13 pm
by Frog
ugh idk its still not working ill just figure it out eventually

Re: DeathRegion Error

Posted: Thu Jul 09, 2009 11:10 pm
by AceMastermind
Frog wrote:ummmm idk how to put pictures on here but heres wat i can do

my Region:ID is deathregion
then properties and everything else is blank
In ZE; give your region a name under Properties, it doesn't matter what you call it.
Then under Change Type, type in: DeathRegion
In the LUA; whatever name you gave your region under Properties in ZE is the name that you must use in the AddDeathRegion line

Re: DeathRegion Error

Posted: Fri Jul 10, 2009 1:22 pm
by Frog
ok i did that but watever i made the properties also changed the type so hopefully then i gave each of them a simple Region ID "bob","cat","frog"
and added them to my LUA
Hidden/Spoiler:
ReadDataFile("dc:Must\\Must.lvl")
--end worldlvl
--start spawndelay
SetSpawnDelay(10.0, 0.25)
--end spawndelay
--start flyheight
--end flyheight
--start ainotify
--end ainotify
--start stayinturrets
--end stayinturrets
--start denseenvironment
SetDenseEnvironment("false")
--end denseenvironment
--start birdsandfish
--end birdsandfish
AddDeathRegion("cat")
AddDeathRegion("frog") <------
AddDeathRegion("bob")

--start soundconfig
OpenAudioStream("sound\\tat.lvl","tatcw_music");
OpenAudioStream("sound\\tat.lvl","tat1");
OpenAudioStream("sound\\tat.lvl","tat1");
OpenAudioStream("sound\\cw.lvl","cw_vo");
OpenAudioStream("sound\\cw.lvl","cw_tac_vo");
OpenAudioStream("sound\\tat.lvl","tat1_emt");
SetBleedingVoiceOver(CIS,CIS,"cis_off_com_report_us_overwhelmed",1);

Re: DeathRegion Error

Posted: Sat Jul 11, 2009 1:08 pm
by AceMastermind
Frog wrote:...watever i made the properties also changed the type
Then just use the same naming convention that the shipped maps use.

Have a look at the DeathRegions layer for bespin2.wld in ZE.

There are 2 death regions for this world:
Region 8(Region ID name) > DeathRegion(Properties name) > DeathRegion(Type name)
Region 9(Region ID name) > DeathRegion2(Properties name) >DeathRegion2(Type name)

They are defined in the LUA as this:

Code: Select all

AddDeathRegion("DeathRegion");
AddDeathRegion("DeathRegion2");

Re: DeathRegion Error

Posted: Sat Jul 11, 2009 3:41 pm
by ANDEWEGET
you forgot the ;. maybe htat was your problem