Hard Light Productions Forums
Modding, Mission Design, and Coding => The Scripting Workshop => Topic started by: Luke on October 11, 2013, 12:35:28 pm
-
Hi
Like the topic says, is it possible?
In documentation i found "getName()" and "getCampaignFilename()", but i am not sure if this are the correct functions and i don't know how i must use this. This functions need a "player handle" but in the FSO LUA docu i found nothing about this.
Any ideas?
-
They look like the correct functions to me. I think you need to use them like this:
#Conditional Hooks
$Application: FS2_Open
$On Game Init:
[
player_name = ""
player_campaign_file = ""
]
$State: GS_STATE_GAME_PLAY
$On State Start:
[
player_name = hv.Player:getName()
player_campaign_file = hv.Player:getCampaignFilename()
]
$On HUD Draw:
[
if hu.HUDDrawn == true then
gr.drawString(player_name)
gr.drawString(player_campaign_file)
end
]
#End
-
I don't think that is going to work as hv.Player is a ship handle and not the player handle.
Actually I haven't found any point in the code where a player handle is ever created for the scripting system which means that it's impossible to get a player handle at the moment.
-
Yeah, you're right, my suggested script doesn't work at all. I should have tested it before posting :nervous:
-
Ok, thanks anyway.
-
I'll see if I can get around to add that in, this should be a quick addition.