Hard Light Productions Forums

Modding, Mission Design, and Coding => The Scripting Workshop => Topic started by: chief1983 on December 24, 2007, 06:14:05 pm

Title: How to tell if pilot is single or mulitplayer
Post by: chief1983 on December 24, 2007, 06:14:05 pm
So if I'm in the Main Menu state, is there a reliable way to tell if the currently loaded pilot is a single or multiplayer pilot?
Title: Re: How to tell if pilot is single or mulitplayer
Post by: jr2 on December 24, 2007, 07:32:50 pm
Hover over the Ready Room, I think the help text is different.
Title: Re: How to tell if pilot is single or mulitplayer
Post by: chief1983 on December 24, 2007, 09:13:55 pm
I meant in relation to scripting...since this is the Scripting forum.
Title: Re: How to tell if pilot is single or mulitplayer
Post by: WMCoolmon on December 25, 2007, 01:13:51 am
No. I actually disabled the players stuff in HEAD, because it's set up very weird. The same storage space is used in Freespace 2 to store local players/pilots, and remote players/pilots, and is loaded when the game starts or a multiplayer game is joined. Or so it looked to me. I'm not very familiar with that code.

In 3.6.9, you might be able to do it by checking the player's current campaign field.
Title: Re: How to tell if pilot is single or mulitplayer
Post by: Wanderer on December 25, 2007, 02:12:27 am
Just a small note... If you are planning on using scripting on MP keep in mind that ALL SCRIPTS are evaluated locally - so given the MP lag the scripts will give different results for separate players. So things like distance checks etc. are essentially useless.
Title: Re: How to tell if pilot is single or mulitplayer
Post by: chief1983 on December 26, 2007, 09:44:55 am
It only mattered in the Main Menu state, so not really "in game", just on the way in.  I was trying to work with that 3d scripted main menu replacement, but it didn't work right in multiplayer.  I've tried using player:getCampaignName(), but it was with a pre-3.6.10 build, so that may just be why it wasn't working as expected, although the scripting.html dump still listed it as a valid method.  Thanks for the tips though.  Can you think of any other way for a script to do a proper Ready Room button, that either goes to Multi or the Campaign based on what type of pilot is loaded, or any other information that might be able to tell you where it should be going?  Player was only one method I had considered.  If there's anything else that's different based on whether a multi or single player pilot is loaded, I could probably just use that.
Title: Re: How to tell if pilot is single or mulitplayer
Post by: chief1983 on December 28, 2007, 01:35:48 pm
So no one else has any ideas?  I mean, I guess the only thing that could help at this point is a code change in the engine?  The current system just can't do it I guess?
Title: Re: How to tell if pilot is single or mulitplayer
Post by: Wanderer on December 30, 2007, 04:25:23 am
Hmmm... there seems to be 'player:getCampaignFilename()' function still in there. But access that you first need to access the 'player' variable via 'hook variables' option. But i'm not sure if that is enough to tell the difference between SP and MP pilots.
Title: Re: How to tell if pilot is single or mulitplayer
Post by: WMCoolmon on December 30, 2007, 06:56:52 pm
http://www.hard-light.net/forums/index.php/topic,51203.new.html#new
Title: Re: How to tell if pilot is single or mulitplayer
Post by: chief1983 on December 30, 2007, 07:07:46 pm
Yup, saw.  That's awesome.  Now to get all that rolled up into one nice big 3.6.10 final and get FS2NetD updated to work :)