Hard Light Productions Forums
Modding, Mission Design, and Coding => The Scripting Workshop => Topic started 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?
-
Hover over the Ready Room, I think the help text is different.
-
I meant in relation to scripting...since this is the Scripting forum.
-
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.
-
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.
-
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.
-
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?
-
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.
-
http://www.hard-light.net/forums/index.php/topic,51203.new.html#new
-
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 :)