|
Thread: Determining a player's faction through scripts? | |
|
Maurice
Hero of Order
Part of the furniture
|
posted March 14, 2009 11:33 AM |
|
|
Determining a player's faction through scripts?
I'm currently thinking about an older idea that I had. The idea revolves around some scripting, which makes changes to the map during gameplay, depending on the faction of the current player.
However, for that idea to work, the script needs to somehow know the faction of that player. Now a work-around is to determine the Hero each player starts with and use that to determine the faction of the player, storing that in an array to which it can refer during the game.
Personally, I don't think that's an elegant solution, especially since this idea might also be workable as a mod, usable in different maps - and other mods might add other Heroes, messing up the determination I suggested above. Is there another way?
|
|
Asheera
Honorable
Undefeatable Hero
Elite Assassin
|
posted March 14, 2009 03:12 PM |
|
|
There's the new GetPlayerRace(player) function that comes with 3.1 patch for TotE which you can use.
GetPlayerRace(1) -- returns the race of player 1, for example
As for town IDs:
TOWN_HEAVEN = 0
TOWN_PRESERVE = 1
TOWN_ACADEMY = 2
TOWN_DUNGEON = 3
TOWN_NECROMANCY = 4
TOWN_INFERNO = 5
TOWN_FORTRESS = 6
TOWN_STRONGHOLD = 7
____________
|
|
Maurice
Hero of Order
Part of the furniture
|
posted March 14, 2009 04:09 PM |
|
Edited by Maurice at 16:10, 14 Mar 2009.
|
Gotcha! Thanks much! I did some scripting a while ago, but only recently installed TotE patch 3.1, as I didn't play for a while. This should make my idea much easier to accomplish .
|
|
|