Page 1 of 1

"no unit corpses" lua script buggy

Posted: 11 Oct 2009, 00:43
by TradeMark
units that are added by map will leave corpse

Re: "no unit corpses" lua script buggy

Posted: 11 Oct 2009, 04:10
by SirMaverick
How's the corpse called?
Why I'm asking:

Code: Select all

function gadget:AllowFeatureCreation(featureDefID, teamID, x, y, z)
  local featureName = (FeatureDefs[featureDefID].tooltip or "nil")
  if string.find(featureName, 'Wreckage') then
    return false
  elseif string.find(featureName, 'Shards') then
    return false
  elseif string.find(featureName, 'Rubble') then
    return false
  elseif string.find(featureName, 'Heap') then
    return false
  end
  return true
end

Re: "no unit corpses" lua script buggy

Posted: 11 Oct 2009, 04:31
by TradeMark

Code: Select all

[tllmedfusion_dead]
{
	Description=Fusion Wreckage;
	Object=tllmedfusion_dead;
	Featuredead=tllmedfusion_heap;
	Footprintx=5;
	Footprintz=5;
	Height=12;
	Blocking=1;
	Metal=2500;
	Damage=3000;
}

[tllmedfusion_heap]
{
	Description=Fusion Debris;
	Object=4x4c;
	Footprintx=5;
	Footprintz=4;
	Blocking=0;
	Metal=1250;
	Damage=1500;
}
that "debris" one.

shouldnt you white list the corpses instead of blacklisting? theres less allowed corpses than the disallowed ones...

so just make array of those wall corpses and allow only them.

or even better: give wall corpses some identifier that differs from everything else, that'll do it for sure, and easier to maintain too.

Re: "no unit corpses" lua script buggy

Posted: 11 Oct 2009, 06:36
by SirMaverick
TradeMark wrote:that "debris" one.
Just rename to one of the 4 possibilities.

Re: "no unit corpses" lua script buggy

Posted: 11 Oct 2009, 15:35
by TradeMark
SirMaverick wrote:
TradeMark wrote:that "debris" one.
Just rename to one of the 4 possibilities.
and re-upload all my maps? lol...


why cant you just do it like i said? it will be bulletproof system.

Re: "no unit corpses" lua script buggy

Posted: 11 Oct 2009, 16:56
by TradeMark

Code: Select all

function gadget:AllowFeatureCreation(featureDefID, teamID, x, y, z)
	local featureName = (FeatureDefs[featureDefID].tooltip or "nil")
	if string.find(featureName, 'Teeth') then
		return true
	end
	if string.find(featureName, 'Wall') then
		return true
	end
	return false
end
now it will allow corpses with teeth or wall in their names. and thats all we need.

Re: "no unit corpses" lua script buggy

Posted: 15 Oct 2009, 15:49
by TradeMark
is it fixed yet?

Re: "no unit corpses" lua script buggy

Posted: 15 Oct 2009, 16:38
by TheFatController
Stop posting that in threads :P no it's not fixed yet cause new BA hasn't been released but when it is it'll be fixed..!

Re: "no unit corpses" lua script buggy

Posted: 15 Oct 2009, 17:39
by TradeMark
thats all i wanted to hear. so you use my code now instead?

Re: "no unit corpses" lua script buggy

Posted: 15 Oct 2009, 18:26
by TheFatController
I need to make sure it wouldn't break stuff like growing feature maps should anyone ever wish to make one but otherwise yeah that's a good way of doing it.