Flags Confusion [Solved]
Posted: Thu Oct 01, 2009 5:58 pm
I want to have a conquest map where the teams can unlock specialized unit classes/gain bonus team points by picking up (not capturing) hidden flags scattered around the level. (Once they pick them up, I'll implement some LUA code to give various extra bonuses to the one who picked it up, and give some extra bonuses to the team if he succeeds in not dying with the flag until a timer runs out - hence the odd emphasis on picking up the flag rather than capturing it. Am I making sense? This isn't capture-the-flag, it's protect-the-flag.)
To this end, I created a blank test map and attempted to put a flag into conquest mode. I copied over the msh files for the flag and also com_item_flag_neutral and com_item_flag_neutral_carried (as well as their cloth odfs) into my world's odf and msh folders.
I placed a flag object in ZE, in the base layer, and named it "flagthing1". Then I added the following to ScriptPostLoad:
In-game, the flag appears, but is unpickupable (just a prop). I get this:
One odd thing being that it lists the site of the error as line 312 when there's only 233 lines in my LUA.
I don't have much experience with flags. What am I doing wrong?
EDIT - I tried removing those lines from my LUA and changing the ClassLabel from "prop" to "flag". Result: flag item vanishes. I get this:
Whyever not?
To this end, I created a blank test map and attempted to put a flag into conquest mode. I copied over the msh files for the flag and also com_item_flag_neutral and com_item_flag_neutral_carried (as well as their cloth odfs) into my world's odf and msh folders.
I placed a flag object in ZE, in the base layer, and named it "flagthing1". Then I added the following to ScriptPostLoad:
Code: Select all
AddFlag{name = "flagthing1", homeRegion = "", captureRegion = "cp1_capture",
capRegionMarker = "hud_objective_icon", capRegionMarkerScale = 3.0,
mapIcon = "flag_icon", mapIconScale = 2.0}Code: Select all
Message Severity: 3
.\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `AddFlag' (a nil value)
stack traceback:
(none): in function `ScriptPostLoad'I don't have much experience with flags. What am I doing wrong?
EDIT - I tried removing those lines from my LUA and changing the ClassLabel from "prop" to "flag". Result: flag item vanishes. I get this:
Code: Select all
Message Severity: 2
.\Source\FlagItem.cpp(945)
Could not build FlagItem