Page 1 of 1

Hunt mode just won't work [Solved]

Posted: Fri Sep 09, 2011 9:24 am
by Tears2Roses
Hello. I am trying to get a hunt mode working. Following firefeks tutorial without pictures ( I got it PMed to me by unlucky 13) I always get a crapload of errors... Generally LUA related things, thats simple enough to fix. But I want to know what these sev 3 errors mean.
Hidden/Spoiler:
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to compare two nil values
stack traceback:
(none): in function `ifs_login_EnterInterface'
(none): in function <(none):598>

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to compare two nil values
stack traceback:
(none): in function `ifs_login_EnterInterface'
(none): in function <(none):598>

ifs_sp_campaign: Input_Accept(): Entered: _tab_instant
missionlist_ExpandMapList()
ifs_missionselect_pcMulti_fnSetMapPreview(): Defaulting index to 1
this.CurButton = check_mode5
cur_button = nil
Checkbox for check_era7 clicked
this.CurButton = check_era7
cur_button = nil
this.CurButton = nil
cur_button = nil
DoubleClicked
custom_AddMapNew()
custom_printTable(): table: 05B3122C
The key, value is: mode_hunt_g 1
The key, value is: era_g 1
The key, value is: isModLevel 1
The key, value is: mode_con_g 1
The key, value is: bSelected 1
The key is mapluafile, the formated value is: DTW<A>_<B>
custom_printTable(): Returning
custom_printTable(): table: 05B36B4C
The key, value is: key mode_con
The key, value is: subst con
The key, value is: showstr modename.name.con
The key, value is: descstr modename.description.con
The key, value is: icon mode_icon_con
custom_printTable(): Returning
gMapEras.key = era_g Era = era_g subst = g
Adding map: DTWg_hunt idx: 1
this.CurButton = Launch
cur_button = nil

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\Entity.cpp(218)
Entity base class "com_inf_default" not found


Entity refers to the localizeing tools ( that my best guess ) and that one is in orange. Other than that im clueless. The first 2 severity three I seem to always get. Those are the long, non coloured ones. Do those two severity 3 errors affect anything? The only thing I was doing was moddifying a hoth script. The .req/mission.req/addme must be fine, I had it working except it loaded hoth hunt. After modifying the LUA, I get the above errors ( and some munge log errors, I fixed those. ) This is my LUA

Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveTDM")
ScriptCB_DoFile("setup_teams")

-- Empire Attacking (attacker is always #1)
ALL = 2
IMP = 1
-- These variables do not change
ATT = 1
DEF = 2


---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------



function ScriptPostLoad()

hunt = ObjectiveTDM:New{teamATT = 1, teamDEF = 2, pointsPerKillATT = 1, pointsPerKillDEF = 3, textATT = "game.modes.hunt", textDEF = "game.modes.hunt2", multiplayerRules = true}

hunt.OnStart = function(self)
AddAIGoal(ATT, "Deathmatch", 1000)
AddAIGoal(DEF, "Deathmatch", 1000)
end


hunt:Start()

end

function ScriptInit()

-- Empire Attacking (attacker is always #1)
--local ALL = 2
--local IMP = 1
-- These variables do not change
--local ATT = 1
--local DEF = 2

--SetAttackingTeam(ATT)


SetMaxFlyHeight(70)
SetMaxPlayerFlyHeight(70)
SetGroundFlyerMap(1);

ReadDataFile("sound\\hot.lvl;hot1gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman",
"all_inf_rocketeer",
"all_inf_engineer",
"all_inf_sniper")

ReadDataFile("dc:SIDE\\imp.lvl",
"imp_inf_rifleman")

SetupTeams{

all={
team = ALL,
units = 32,
reinforcements = -1,
soldier = {"all_inf_rifleman"},
assault = {"all_inf_rocketeer"},
engineer = {"all_inf_engineer"},
sniper = {"all_inf_sniper"},

},

imp={
team = IMP,
units = 32,
reinforcements = -1,
soldier = {"imp_inf_rifleman", 8},
}
}


--Setting up Heros--



-- Level Stats
ClearWalkers()
SetMemoryPoolSize("EntityWalker", -2)
AddWalkerType(0, 0) -- 0 droidekas
AddWalkerType(0, 0) -- 6 atsts with 1 leg pairs each
AddWalkerType(0, 0) -- 2 atats with 2 leg pairs each

SetMemoryPoolSize("Aimer", 90)
SetMemoryPoolSize("AmmoCounter", 269)
SetMemoryPoolSize("BaseHint", 250)
SetMemoryPoolSize("CommandWalker", 2)
SetMemoryPoolSize("ConnectivityGraphFollower", 56)
SetMemoryPoolSize("EnergyBar", 269)
SetMemoryPoolSize("EntityCloth", 28)
SetMemoryPoolSize("EntityFlyer", 6)
SetMemoryPoolSize("EntityLight", 225)
SetMemoryPoolSize("EntitySoundStatic", 16)
SetMemoryPoolSize("EntitySoundStream", 5)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 54)
SetMemoryPoolSize("MountedTurret", 46)
SetMemoryPoolSize("Navigator", 63)
SetMemoryPoolSize("Obstacle", 400)
SetMemoryPoolSize("OrdnanceTowCable", 40) -- !!!! need +4 extra for wrapped/fallen cables !!!!
SetMemoryPoolSize("PathFollower", 63)
SetMemoryPoolSize("PathNode", 268)
SetMemoryPoolSize("RedOmniLight", 240)
SetMemoryPoolSize("TreeGridStack", 329)
SetMemoryPoolSize("UnitController", 63)
SetMemoryPoolSize("UnitAgent", 63)
SetMemoryPoolSize("Weapon", 269)

ReadDataFile("dc:DTW\\DTW.lvl", "DTW_hunt")
SetSpawnDelay(10.0, 0.25)
SetDenseEnvironment("false")
SetDefenderSnipeRange(170)
AddDeathRegion("Death")


-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "all_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "gcw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\hot.lvl", "hot1gcw")
OpenAudioStream("sound\\hot.lvl", "hot1gcw")

-- SetBleedingVoiceOver(ALL, ALL, "all_off_com_report_us_overwhelmed", 1)
-- SetBleedingVoiceOver(ALL, IMP, "all_off_com_report_enemy_losing", 1)
-- SetBleedingVoiceOver(IMP, ALL, "imp_off_com_report_enemy_losing", 1)
-- SetBleedingVoiceOver(IMP, IMP, "imp_off_com_report_us_overwhelmed", 1)

-- SetLowReinforcementsVoiceOver(ALL, IMP, "all_hot_transport_away", .75, 1)
-- SetLowReinforcementsVoiceOver(ALL, IMP, "all_hot_transport_away", .5, 1)
-- SetLowReinforcementsVoiceOver(ALL, IMP, "all_hot_transport_away", .25, 1)

-- SetLowReinforcementsVoiceOver(ALL, ALL, "all_off_defeat_im", .1, 1)
-- SetLowReinforcementsVoiceOver(ALL, IMP, "all_off_victory_im", .1, 1)
-- SetLowReinforcementsVoiceOver(IMP, IMP, "imp_off_defeat_im", .1, 1)
-- SetLowReinforcementsVoiceOver(IMP, ALL, "imp_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(2, "Allleaving")
-- SetOutOfBoundsVoiceOver(1, "Impleaving")

SetAmbientMusic(ALL, 1.0, "all_hot_amb_hunt", 0,1)
-- SetAmbientMusic(ALL, 0.9, "all_hot_amb_middle", 1,1)
-- SetAmbientMusic(ALL, 0.1, "all_hot_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_hot_amb_hunt", 0,1)
-- SetAmbientMusic(IMP, 0.9, "imp_hot_amb_middle", 1,1)
-- SetAmbientMusic(IMP, 0.1, "imp_hot_amb_end", 2,1)

SetVictoryMusic(ALL, "all_hot_amb_victory")
SetDefeatMusic (ALL, "all_hot_amb_defeat")
SetVictoryMusic(IMP, "imp_hot_amb_victory")
SetDefeatMusic (IMP, "imp_hot_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
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")


-- Camera Stats
end


I deleted the camera stats, adjusted the LUA to call for my sides, deleted the killobject this and that at the begining, the PS2 bock.... I just don't know what that sev three entity error is. Thanks in advance.

Re: Hunt mode just won't work...

Posted: Fri Sep 09, 2011 10:24 am
by Noobasaurus
Bah, Fierfek's hunt mode tut works just fine.
Hidden/Spoiler:
[quote="Tears2Roses"]Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\Entity.cpp(218)
Entity base class "com_inf_default" not found[/quote]
This is a problem with your sides. Fix all your errors before adding a new mode.
Hidden/Spoiler:
[quote="Fierfek's Tutorial"]Part 19. Adding Hunt
Okay, so you’ve noticed that when you make a map with the tools, it doesn’t offer to make a hunt mode. So, we will do it manually.
First, we need to get a hunt script, because it is pretty different than our ones.
Go to assets/scripts/hot. Get the file “hot1g_hunt”, and copy it over to where the rest of our scripts are.
Open it up, and find this line:

ReadDataFile("HOT\\hot1.lvl", "hoth_hunt")

It is asking for the hoth file, but we don’t want that. We want it to read our file.
So, we’ll change it. Remember how to tell it to read from our mod folder? Adding a ‘dc:’. So, change the above line to this:

ReadDataFile("dc:MAP\\map.lvl", "map_hunt")

Now it is asking for our mission file. But wait, we don’t have one yet! Those are created automatically for modes like conquest and ctf, but not for hunt!
So, go to data_MAP/common/mission.
Find the file called “hot1g_hunt”. Make a copy of it. Call the new one “map*_Hunt (The * stands for whatever era you are making this for – c or g).
Open your new one up. It has this inside:

ucft
{
REQN
{
"script"
"hot1g_hunt"
}
}

Change the “hot1g_hunt” to “map*_hunt” (again, * stands for the era).
Now, go to the folder data_MAP/common. Open the file “mission.req”.
Go find this part:

"MAPg_con"
"MAPc_con"

This is telling the game which modes to load. We need to add our one.
Now it should look like this:

"MAPg_con"
"MAPc_con"
"MAP*_hunt"

I hope I don’t have to tell you what the * means again.
Okay, now go to data_MAP/addme. Open “addme.lua”.
Find this part:
sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "MAP%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1,}

In the file, that is one big line.
Okay, so this is telling the game which missions to load. See the part highlighted? Right after it, add this:

mode_hunt_* = 1,

So now, it should look like this:

sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "BUT%s_%s", era_g = 1, era_c = 1, mode_hunt_* = 1, mode_con_g = 1, mode_con_c = 1,}

I hope I don’t have to tell you what the * means again.
Okay, now scroll down the addme file. Find this part:

AddDownloadableContent("MAP","MAPg_con",4)
AddDownloadableContent("MAP","MAPc_con",4)

This is telling the game which modes to add in. We need to add our one.
Now, it looks like this:

AddDownloadableContent("MAP","MAPg_con",4)
AddDownloadableContent("MAP","MAPc_con",4)
AddDownloadableContent("MAP","MAP*_hunt",4)

DO I HAVE TO TELL YOU WHAT THE * MEANS AGAIN?!?!?!
We are done with scripts for now.
Go open your map in Zeroeditor.
Click on the change layer button:

Now you’ve got this screen:

Click “new”.
Now you have a new layer called “layer000”. Right click on it, and hit “rename layer”. Rename it to “hunt”.
Now the screen should look like this:

Now we have a hunt layer!
Exit the layers palette. Right next to it, you see the “configure” button:

Click it. Now you have this screen:

You see there is a “hunt” on the very left. Click on it, and then click “remove”.
Now, in the second column, at the top, type in “hunt”, and click add.
In the last column, click “add”. A new screen comes up:

Click hunt, the click ok.
Now the first screen should look like this:

Hit “update world REQ and mode MRQs”. Go to data_MAP/worlds/MAP/world1. Click the file showed. Then exit the first screen.
We are done! But wait – we need to add some command posts!
Add your command posts.
Now, the hunt mode is done! It will have rebels vs. wampas. I won’t tell you how to change that right now.
[/quote]
Or, if you want, you can even go here.

Re: Hunt mode just won't work...

Posted: Fri Sep 09, 2011 6:49 pm
by Tears2Roses
But what is that entity error....Im clueless. Firefeks tut works fine until I change the LUA... * sighs * ima re-start again.

Re: Hunt mode just won't work...

Posted: Fri Sep 09, 2011 6:58 pm
by DarthD.U.C.K.
there is no need to, you simply forgot to load the ingame.lvl that contains all the common models, textures and classes under scriptinit.

Re: Hunt mode just won't work...

Posted: Fri Sep 09, 2011 7:01 pm
by Tears2Roses
oh under function script init add ReadDataFile("ingame.lvl") ?

Re: Hunt mode just won't work...

Posted: Sat Sep 10, 2011 6:28 am
by DarthD.U.C.K.
yes

Re: Hunt mode just won't work...

Posted: Sat Sep 10, 2011 5:27 pm
by Tears2Roses
Thanks, it worked!