Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: FUBAR-BDHR on November 10, 2008, 01:17:17 am

Title: Multiplayer player deaths revisited
Post by: FUBAR-BDHR on November 10, 2008, 01:17:17 am
I know we have the sexps now to determine the number of respawns for a ship and the number of deaths.  Problem is I can't seem to get it to work.  I'm storing respawns-left + 1  to a variable at mission start then checking each possible player ship to see if the ship-deaths = the respawn variable.  If they do then the event should trigger and the mission should end.  Event never triggers.  I don't know why though.  I did a test with Alpha 1 and it fires off the test message.  Starting to think ship-deaths doesn't work for the player AI ships. 
Title: Re: Multiplayer player deaths revisited
Post by: karajorma on November 10, 2008, 02:47:31 am
That's odd. The SEXP should work with player AI ships. The AI and the player ships get their respawn and ship-death counts in a different way since for the player I can just pull them out of the player information so it's quite possible that there is a bug in the way it's doing it for AI ships. In fact I can think of two possibilities off the top of my head.

Stick it in Mantis and assign it to me. Since it's a bug in my own code it will be top priority. :)
Title: Re: Multiplayer player deaths revisited
Post by: FUBAR-BDHR on November 10, 2008, 12:44:16 pm
Great another bug and just when you guys had me down below 20.   :D  http://scp.indiegames.us/mantis/view.php?id=1812

Title: Re: Multiplayer player deaths revisited
Post by: karajorma on November 10, 2008, 01:12:21 pm
I'm compiling as we speak. With luck I'll have you back below 20 again soon.

The problem was that when a player ship dies the variable I was using to check how many times it had died ( stats.m_player_deaths ) is updated. However with an AI ship there is no such variable and the one I was using (respawn_count) isn't updated the final time a ship dies (meaning that the SEXP had passed all my tests because I'd never actually killed my wingman for good).

I'll try getting the count in a different way now. 

EDIT : Fixed and in SVN