Flags Confusion [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Flags Confusion [Solved]

Post by Fiodis »

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:

Code: Select all

	AddFlag{name = "flagthing1", homeRegion = "", captureRegion = "cp1_capture",
				capRegionMarker = "hud_objective_icon", capRegionMarkerScale = 3.0, 
				mapIcon = "flag_icon", mapIconScale = 2.0}
In-game, the flag appears, but is unpickupable (just a prop). I get this:

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'
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:

Code: Select all

Message Severity: 2
.\Source\FlagItem.cpp(945)
Could not build FlagItem
Whyever not?
Last edited by Fiodis on Thu Oct 01, 2009 9:32 pm, edited 1 time in total.
myers73
Lieutenant General
Lieutenant General
Posts: 690
Joined: Fri Apr 03, 2009 11:04 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Atlanta, GA xfire=myers73 IngameName=mYers

Re: Flags Confusion

Post by myers73 »

try placing it in the conquest layer...not sure what the problem is.
Xavious
Sith Master
Sith Master
Posts: 2783
Joined: Mon Jun 12, 2006 3:46 pm

Re: Flags Confusion

Post by Xavious »

Fiodis wrote:I tried removing those lines from my LUA and changing the ClassLabel from "prop" to "flag". Result: flag item vanishes.
Wait... why was it a prop before? Why don't you keep the ClassLabel "flag" and try re-adding the lines in your lua?
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Flags Confusion

Post by Fiodis »

Actually, it came as class label "prop". I had changed it to "flag" and tried it with the LUA lines, but got the same LUA arguement as before. This one:

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'


EDIT - Silly me. Forgot the memory pools. Solved now, thanks.
Post Reply