Page 1 of 1
GetEntityClass Failure (and jetpacks)
Posted: Sat Oct 03, 2009 12:18 pm
by Fiodis
My protect-the-flag mode code has progressed somewhat, but I'm having trouble with a side objective that starts out like this:
I get this in the error log:
Code: Select all
Ok, OnFlagPickUp works....
Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(635)
Entity "0" not found
So it seems that OnFlagPickUp works, but GetEntityClass doesn't. I've tried variations like GetEntityClassName, GetEntityClass(GetCharacterUnit(picker)), GetCharacterClass, and GetCharacterUnit. None seem to work. Why is that?
And another little thing related to it but not to the code: is there any way to allow units to use jetpacks when they have the flag?
Re: GetEntityClass Failure (and jetpacks)
Posted: Sat Oct 03, 2009 12:32 pm
by Aman/Pinguin
I'm not sure why but I never used
GetEntityClass(picker), I kinda remember something was wrong with it.
GetCharacterClass(player) works though. It doesn't use the name of the class, but the class index (or whatever its called).
Example from Tuskencamp:
So, assuming the dark trooper is the 6th class in the IMP team, I would change your code to this:
Re: GetEntityClass Failure (and jetpacks)
Posted: Sat Oct 03, 2009 1:35 pm
by Maveritchell
Aman/Pinguin wrote:I'm not sure why but I never used GetEntityClass(picker), I kinda remember something was wrong with it.
Nothing's wrong with it, it just doesn't have a string output. You need to match up a GetEntityClass to a FindEntityClass, a la:
Code: Select all
GetEntityClass(etc) == FindEntityClass("ex_type_entity")
Re: GetEntityClass Failure (and jetpacks)
Posted: Sat Oct 03, 2009 5:15 pm
by Fiodis
Thanks! Any idea on the jetpack problem? I found nothing in any odfs and luas I searched, so I assume it's a hard-coded thing.
Re: GetEntityClass Failure (and jetpacks)
Posted: Sun Oct 04, 2009 12:31 pm
by [RDH]Zerted
You can give everyone a jet pack but with no fuel or recharge rate. When a unit gets the flag, up its recharge rate. When a unit drops the flag, but it back at zero. I think that would work...
Re: GetEntityClass Failure (and jetpacks)
Posted: Sun Oct 04, 2009 5:02 pm
by Frisbeetarian
That shouldn't work. When a jedi get's a flag, it has no fuel or recharge rate and still can't use its jump.
Re: GetEntityClass Failure (and jetpacks)
Posted: Sun Oct 04, 2009 9:56 pm
by Fiodis
So the lack of jetpacks while carrying a flag is a hardcoded thing? Maybe you could increase the jump distance and add an effect to the unit upon flag pickup to simulate a jump pack similar to the Dark Trooper's...but it's a messy workaround.
Re: GetEntityClass Failure (and jetpacks)
Posted: Sun Oct 04, 2009 10:56 pm
by [RDH]Zerted
Jump distance is a class property, so that wouldn't work. I assumed the can't fly with a flag was an ODF property, but I don't know those too well. There is the bug that if you get a flag while flying you can keep flying until you land, but that doesn't really help you...
Re: GetEntityClass Failure (and jetpacks)
Posted: Mon Oct 05, 2009 3:26 pm
by Fiodis
If there were only one unit and it were SP, that'd be all right, that it's a class property. Still, it seems these workarounds are too messy to look good.
And I don't recall any ODF property dealing with the jetpack removal while carrying flags either.