Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 5 - Modders Workshop > Thread: Determining a player's faction through scripts?
Thread: Determining a player's faction through scripts?
Maurice
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?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Asheera
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
____________

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Maurice
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 .

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0158 seconds