Hidden/Spoiler:
Disabling spawn for a certain player in MP [Solved]
Moderator: Moderators
-
Noobasaurus
- Droid Pilot Assassin

- Posts: 2006
- Joined: Tue Aug 17, 2010 5:56 pm
Disabling spawn for a certain player in MP [Solved]
What I want to have happen is when someone dies, they are unable to spawn back in. However, I can't do this with changing the teams of the CPs or their spawnpaths. I attempted to use a list but I have no clue to go about a) checking if they are a player who died b) marking them as a player who died. I figured the initial code might be something like this:
But I know that it won't work in this stage, because I only know half about how to get data from lists, how it actually stores the data, and how to retrieve data. How can I use the information of a character that spawns to search the list for him, and if it finds that his playerMarked value is one, then it stops him from spawning?
Last edited by Noobasaurus on Sun Apr 12, 2015 3:19 pm, edited 1 time in total.
-
razac920
- 2nd Lieutenant

- Posts: 365
- Joined: Sun Jan 16, 2011 12:42 am
Re: Disabling spawn for a certain player in MP
I found a nice way of disabling spawn (and keeping the dead body from vanishing) by using DeactivateObject on the deceased character's CharacterUnit (note that once the character is dead, GetCharacterUnit won't work, so you'll have to store that information ahead of time).
-
Noobasaurus
- Droid Pilot Assassin

- Posts: 2006
- Joined: Tue Aug 17, 2010 5:56 pm
Re: Disabling spawn for a certain player in MP
Oh I forgot to mention that I tried that and it doesn't seem to work in MP. The dead body stays, but the player is still allowed to spawn.
OH WAIT...you said do that to their unit which would be stored ahead of time...ooooh. That would make sense.
EDIT: So I tried a few things, and I'm getting closer.
However, I get this error:
I'm not sure on how to get a string out of this. The only string that I can think of if the player's unit class, but I don't see how that's relevant to deactivating their object.
EDIT2: Okay, so I just realized that I don't need all of that fancy stuff for what I'm doing. I'm a dummy. Here's what I've got.
Basically if they're on one team, we don't want to see their dead body. If they're on the other, it's fine. However, I can still spawn even after the DeactivateObject. Everything else works fine. I'm not sure why I can still spawn.
EDIT3: Whoops, forgot that they needed 0 reinforcements. Solved.
OH WAIT...you said do that to their unit which would be stored ahead of time...ooooh. That would make sense.
EDIT: So I tried a few things, and I'm getting closer.
Hidden/Spoiler:
Code: Select all
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: bad argument #1 to `DeactivateObject' (string expected, got table)
stack traceback:
[C]: in function `DeactivateObject'
(none): in function <(none):428>EDIT2: Okay, so I just realized that I don't need all of that fancy stuff for what I'm doing. I'm a dummy. Here's what I've got.
Hidden/Spoiler:
EDIT3: Whoops, forgot that they needed 0 reinforcements. Solved.
