Page 1 of 2
Player Exclusive Regions?
Posted: Wed Jan 27, 2010 5:50 pm
by General_Nate
From the DMI:
RepSharpShooter wrote:As I start to model a starship, I thought, "Hey someone's probably going to steal my ship when I'm not around!" But I then realized that I could use the same security as I used in the jedi master unlocking procedure to keep them out.
Theres a region called rs_access. On enter region, it gets the profile name of the person. If it's not my profile name, it will kill the person/detonate a grenade with push = 9999. I could even do thing like poison them or something xD. Whatever would work online though. Now you may ask, "well how do we keep someone from stealing someone else's identity?" The answer is that getProfileName does not get the GameSpy ID of the user. It gets the regular profile name (which IS NOT displayed online if you have a GSID). This means one could use the profile name as a "password" which nobody would know.
How would one pull off such a move? Most of that is German to me...
Thanks very much for you help!
Re: Player Exclusive Regions?
Posted: Wed Jan 27, 2010 6:25 pm
by Fiodis
That explanation is, actually, fairly clear. If you don't understand it I'd recommend learning more advanced LUA coding before you attempt it.
Re: Player Exclusive Regions?
Posted: Wed Jan 27, 2010 6:37 pm
by General_Nate
Fiodis wrote:That explanation is, actually, fairly clear. If you don't understand it I'd recommend learning more advanced LUA coding before you attempt it.
Normally, I would take that and cherish it. But right now, I have a lot submission that has to get out before the end of the month. If it's clear to you, please enlighten me.
Here is all that I don't understand:
Theres a region called rs_access. Do I have to specify that in the LUA? how do I get an "rs_access" region? On enter region, it gets the profile name of the person. Is this the region that does this? Or the LUA command listed below? If it's not my profile name, it will kill the person/detonate a grenade with push = 9999. Is this automatic or do I have to put this in the lua myself? If I do, what is the command?I could even do thing like poison them or something xD. Whatever would work online though. Now you may ask, "well how do we keep someone from stealing someone else's identity?" The answer is that getProfileName<-- Is that what I have to put in the lua? does not get the GameSpy ID of the user. It gets the regular profile name (which IS NOT displayed online if you have a GSID). This means one could use the profile name as a "password" which nobody would know.
Please help! And thanks in advance.
Re: Player Exclusive Regions?
Posted: Wed Jan 27, 2010 7:01 pm
by Fiodis
In this case, you'll need a crash-course. Assuming you know what OnEnterRegion means (which I think you do), there's a v1.3 patch LUA command that enables you to grab the in-game name of a player. You do have to code for the grenade to go off, perhaps by spawning a self-destructing autoturret at a path point inside the region. I forget the exact wording of the function that gets the player's name, but it's in the v1.3 documentation.
CreateEntity to spawn the turret, btw.
Re: Player Exclusive Regions?
Posted: Wed Jan 27, 2010 7:56 pm
by General_Nate
Ok, this is starting to make sense.
But:
Fiodis wrote:there's a v1.3 patch LUA command that enables you to grab the in-game name of a player.
What code command is that, or where do I look to find it?
Re: Player Exclusive Regions?
Posted: Wed Jan 27, 2010 8:33 pm
by Fiodis
Fiodis wrote:I forget the exact wording of the function that gets the player's name, but it's in the v1.3 documentation.

Re: Player Exclusive Regions?
Posted: Wed Jan 27, 2010 8:49 pm
by General_Nate
Ok, I've gotten it down to this:
It doesn't work.
Am I missing anything? I have everything I need for the teleport BTW.
Re: Player Exclusive Regions?
Posted: Thu Jan 28, 2010 1:34 am
by lucasfart
General_Nate wrote:
Ok, I've gotten it down to this:
It doesn't work.
Am I missing anything? I have everything I need for the teleport BTW.
on the second line you misspelt region? unless its meant to be regIn

also on the 4th line you added a symbol in front of the = and misspelt your own name (genaral)

Re: Player Exclusive Regions?
Posted: Thu Jan 28, 2010 6:16 am
by MercuryNoodles
His name's mispelled, yes, but it's actually his ingame name, so that's not a problem.
if name ~= "Genaral Nate" then
So, if someone has a name approximately equal to Genaral Nate, they get access to something?

Re: Player Exclusive Regions?
Posted: Thu Jan 28, 2010 6:33 am
by lucasfart
MercuryNoodles wrote:His name's mispelled, yes, but it's actually his ingame name, so that's not a problem.
if name ~= "Genaral Nate" then
So, if someone has a name approximately equal to Genaral Nate, they get access to something?


didn't think of it that way......good one MercuryNoodles!

Re: Player Exclusive Regions?
Posted: Thu Jan 28, 2010 10:17 am
by General_Nate
Yep. My ingame name is Gen
aral Nate.
I looked up "LUA not equal to symbol" and that (~=) is what I found. The munger didn't like "!=".
So: on enter region, if the person's name isn't mine, teleport them out of the lot.
What is the LUA symbol for "Not equal too"!?
Other than that, is the code correct?
Re: Player Exclusive Regions?
Posted: Thu Jan 28, 2010 10:52 am
by Aman/Pinguin
The code seems totally correct to me. I don't know how getProfileName() works so there might be something wrong, everything else seems correct though.
~= is correct, too.
Is there anything interesting in the error log?
Re: Player Exclusive Regions?
Posted: Thu Jan 28, 2010 2:24 pm
by General_Nate
Funny you say that:
The Error Log wrote:Message Severity: 3
.\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `getProfileName' (a nil value)
stack traceback:
(none): in function <(none):32>
I think it speaks for it's self.
Does anyone know the correct command for getting the name of a player?
Re: Player Exclusive Regions?
Posted: Thu Jan 28, 2010 3:27 pm
by Fiodis
Fiodis wrote:Fiodis wrote:I forget the exact wording of the function that gets the player's name, but it's in the v1.3 documentation.
Hint:
LucasArts\Star Wars Battlefront II\GameData\addon\AAA-v1.3patch\docs\howtos
Hint 2: Using Ingame Player Data.txt
Hint 3: uf_processPlayers()
Re: Player Exclusive Regions?
Posted: Thu Jan 28, 2010 4:04 pm
by General_Nate
Fiodis wrote:Fiodis wrote:Fiodis wrote:I forget the exact wording of the function that gets the player's name, but it's in the v1.3 documentation.
Hint:
LucasArts\Star Wars Battlefront II\GameData\addon\AAA-v1.3patch\docs\howtos
Hint 2: Using Ingame Player Data.txt
Hint 3: uf_processPlayers()
Ok, Well, I have it down to this:
ActivateRegion("g_n_only")
OnEnterRegion(
function(regIn,character)
local name = uf_processPlayers(character)
if name ~= "Genaral Nate" then
print("OnEnterRegion():",name)
MoveEntityToNode(character,"gn_node3")
end
end,
"g_n_only"
)
The only bad part it that it teleports me even if my name is "Genaral Nate" And it pops up with this jewel:
... Ummmm, I think I'm on the right track though.
Re: Player Exclusive Regions?
Posted: Thu Jan 28, 2010 4:54 pm
by Fiodis
You are, but did you even look at the doc I pointed you to? I won't bother posting it, as it is somewhat lengthy. But look at it yourself, and the example code there.
Re: Player Exclusive Regions?
Posted: Fri Jan 29, 2010 5:13 am
by [TFA]Padawan_Fighter
Fiodis wrote:
O.o
What are those things on the right?

Re: Player Exclusive Regions?
Posted: Fri Jan 29, 2010 9:28 am
by Fiodis
Hex code? Idk, really.
When did I write that? 
Re: Player Exclusive Regions?
Posted: Fri Jan 29, 2010 10:46 am
by General_Nate
The Tut wrote:exampleTable = {
{ indexstr = "1", namestr = "Alpha"},
{ indexstr = "3", namestr = "Bravo"},
{ indexstr = "2", namestr = "Player 1"},
{ indexstr = "4", namestr = "LastJoinedPlayer"},
}
Am I suppose-to add this for every person on BFII!? Or does it do it automatically?
Re: Player Exclusive Regions?
Posted: Fri Jan 29, 2010 11:08 am
by Fiodis
I think the whole point of it is to get their names off the player list.