Page 1 of 1
Prevent One Class From Picking Up the Flag? [Solved]
Posted: Thu Jul 16, 2015 2:32 pm
by jedimoose32
Hi everyone.
My question is pretty much just what the title says. Anyone know how to prevent one specific class from picking up a flag? I've searched through the documentation and the LUA Callbacks list and can't find anything there. Looked through the odf parameters list as well. It's worth mentioning that this class is playable by humans, so I can't use the AllowAIPickup odf parameter. And this needs to be multiplayer compatible so I can't use AllowTeamPickup either.

Re: Prevent One Class From Picking Up the Flag?
Posted: Thu Jul 16, 2015 11:49 pm
by Noobasaurus
There's the thing where a droideka needs to deploy from ball mode the pickup flag (I think), so that could be useful. Same with vehicles.
Re: Prevent One Class From Picking Up the Flag?
Posted: Thu Jul 16, 2015 11:51 pm
by jedimoose32
Do you know the parameter off hand? I haven't been able to find anything related to that.
Re: Prevent One Class From Picking Up the Flag?
Posted: Fri Jul 17, 2015 1:19 am
by Noobasaurus
I don't believe that there is one, but you could try using the ClassLabel "walkerdroid".
Or perhaps this:
Re: Prevent One Class From Picking Up the Flag?
Posted: Fri Jul 17, 2015 1:59 am
by jedimoose32
What does TEMP_Type 0 do?
Edit: Seems to be related to walker animations. So no, unfortunately I don't think anything droideka-related will help. My current plan is not as... elegant... but should do the trick - I'll just teleport characters of this specific class backward about .5 m if they get within 1 m of the flag.

Re: Prevent One Class From Picking Up the Flag?
Posted: Fri Jul 17, 2015 12:10 pm
by Noobasaurus
Hmm, I thought that it might be related to whether it could pick it up (ball mode or not). I was thinking TEMP_Type 1 might disable the unit from picking it up, but I suppose from your findings it doesn't.
There's also these two:
Code: Select all
CanCharacterInteractWithFlag(lua_State *aState);
GetFlagCarrier(lua_State *aState);
If the unit spawns as a certain class, you set the first one to false. The second one might be useful if a unit is carrying the flag which you don't want to, and in that case kill them or something.

Re: Prevent One Class From Picking Up the Flag?
Posted: Fri Jul 17, 2015 1:22 pm
by jedimoose32
I'm pretty sure CanCharacterInteractWithFlag() is for returning a Boolean only, it doesn't set the value for the character. At least, that's the only way I've seen it used in the shipped game code. But I'll try using it.
Re: Prevent One Class From Picking Up the Flag?
Posted: Tue Jul 28, 2015 10:30 pm
by [RDH]Zerted
jedimoose32 wrote:I'll just teleport characters of this specific class backward about .5 m if they get within 1 m of the flag.

Sounds like a good way to case wall hacks. You can also kill anyone who picks up the flag as that specific class. You should put a message at the start of the mission about the class not being able to get the flag.
Can you move the units (including human players) of the class on to a 3rd and 4th team and prevent those teams from being able to pick up the flag using AllowTeamPickup? It may or may not work depending on how you want the normal teams to interact with the flag, but I didn't think AllowTeamPickup by itself causes issues in MP.
There isn't much else you can do from the Lua side. Your best bet is an ODF parameter if one exists.
Re: Prevent One Class From Picking Up the Flag?
Posted: Wed Jul 29, 2015 12:16 am
by Maveritchell
It really depends on what you want to do with the flag. It might be easier to simply test which classes are picking up the flag, and if the wrong class picks it up, kill the flag and respawn it.
Re: Prevent One Class From Picking Up the Flag?
Posted: Wed Jul 29, 2015 8:26 pm
by jedimoose32
I want the flag to stay put... I really don't want it to reset to its spawn position when this class tries to pick it up (e.g. if someone else is running with it and drops it, then this class tries to pick it up, it should stay on the first player's dead body). So maybe I'll get the flag's matrix every time it's dropped and then kill the class that tries to pick it up, and also teleport the flag to the matrix where it was dropped.
Re: Prevent One Class From Picking Up the Flag?
Posted: Thu Jul 30, 2015 12:51 am
by Maveritchell
jedimoose32 wrote:I want the flag to stay put... I really don't want it to reset to its spawn position when this class tries to pick it up (e.g. if someone else is running with it and drops it, then this class tries to pick it up, it should stay on the first player's dead body). So maybe I'll get the flag's matrix every time it's dropped and then kill the class that tries to pick it up, and also teleport the flag to the matrix where it was dropped.
Why are you killing anyone?
Why all the violence?
You don't need to kill whoever picks it up just to make sure only your approved classes pick it up. What I meant was that you should kill the flag once it's picked up and then respawn it back at its picked-up location. Like you said, you already know how to test for its location matrix when it's picked up or dropped, so just respawn the flag there if a non-approved class picks it up. It should be a relatively fluid and seamless experience for the class, too, which is not what you'll get with a force kill-and-respawn (of a unit).
Re: Prevent One Class From Picking Up the Flag?
Posted: Thu Jul 30, 2015 1:42 am
by jedimoose32
Mm, good point. I guess that's way simpler. Thanks!