Does anyone know how to call a function when the user Forfeits/Disconnects (preferably in the mutator class)? Destroyed() is not called. I'm out of ideas.
Announcement
Collapse
No announcement yet.
Calling a function on disconnect [solved]
Collapse
X
-
It's all garbage collected.
What I really want to do is have this function (I can put it anywhere) call:
when the level is exited
OR
When the next level loads, but it needs to be able to be called without a mutator.
I'm thinking that this could be done by having the mutator spawn a class that won't be garbage-collected and have the function in that class. Make the class figure out when the level is destroyed, call the function, then destroy itself.
Comment
-
Well, I figured out a way to do it, thanks to UnrealWiki.In case anyone's wondering, I now have it set up like so:
When the mutator spawns, it spawns a dummy playercontroller. The playercontroller class has the native GetEntryLevel() function. The dummy playercontroller then spawns an actor in the Entry level so it isn't garbage-collected, then destroys itself. That actor doesn't do anything until the user returns to the menu, when it calls the function and then destroys itself.
Whew.
Seems like a lot of work to do something relatively simple...
Comment
Comment