Is "player name" available in lua?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
theITfactor
Chief Warrant Officer
Chief Warrant Officer
Posts: 327
Joined: Wed Jun 28, 2006 12:56 pm
Projects :: The Pwnfest and Games Complex
Games I'm Playing :: SWTOR
xbox live or psn: You and I Know
Location: The Old Republic
Contact:

Is "player name" available in lua?

Post by theITfactor »

I am trying to make it so when Player A enters a region, the game says "Player A = Failure" or something like that. Right now it just says "Haha you fail" from the localize. Any idea how to make it dynamic and add in the player's name?

Code: Select all

ActivateRegion("drop1")

region1 = OnEnterRegion(
		function(region, player)
			if IsCharacterHuman(player) then
				RewindAnimation("drop1")
				PlayAnimation("drop1")
				ShowMessageText( "message.custom.drop", DEF )									ShowMessageText( "message.custom.drop", ATT )				
			end
		end, 
		"drop1"
	)
message.custom.drop is the static message
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: Is "player name" available in lua?

Post by RepSharpshooter »

You can get the profile name. Hold on while I search my luas. I'll edit it in later. Zerted helped me :D

But, can't you only show text that has been localized in the core.lvl? That may prevent you from doing this.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Is "player name" available in lua?

Post by [RDH]Zerted »

The only way I can think of to do that would be to make a pop-up message. However, I don't have a clue how a dedicated server handles a pop-up message or how well they work in MP.
Post Reply