[h5] Multiplayer script functions - the list

Maps and the art of mapmaking.
Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

[h5] Multiplayer script functions - the list

Unread postby Franzy » 05 May 2008, 13:24

Here is the list of multiplayer script functions (they can be used in singleplayer maps too), as requested :)

They are not documented yet, sorry.

---------------------------------------------
DisableCameraFollowHeroesForPlayers
MessageBoxForPlayers
MoveCameraForPlayers
Play2DSoundForPlayers
Play3DSoundForPlayers
QuestionBoxForPlayers
SetAmbientLightForPlayers
StartCutSceneForPlayer
StartDialogSceneForPlayers
--------------------------------
These are analogs for singleplayer functions (corresponding SP functions won't work correctly or work at all in MP maps). They are only different in that they have an additional first parameter, PlayerFilter. This constant is defined in advmap-startup.lua:
PLAYERFLT_1 = 1
PLAYERFLT_2 = 2
PLAYERFLT_3 = 4
PLAYERFLT_4 = 8
PLAYERFLT_5 = 16
PLAYERFLT_6 = 32
PLAYERFLT_7 = 64
PLAYERFLT_8 = 128
PLAYERFLT_ALL = 255
PLAYERFLT_TEAM_1 = -1
PLAYERFLT_TEAM_2 = -2
PLAYERFLT_TEAM_3 = -3
PLAYERFLT_TEAM_4 = -4
PLAYERFLT_TEAM_5 = -5
PLAYERFLT_TEAM_6 = -6
PLAYERFLT_TEAM_7 = -7
PLAYERFLT_TEAM_8 = -8

For example, to show message to first player only, you should write:
MessageBoxForPlayers(PLAYERFLT_1,GetMapDataPath().."mymessage.txt").
To show a message to 1 and 3 players, write: MessageBoxForPlayers(PLAYERFLT_1+PLAYERFLT_3,GetMapDataPath().."mymessage.txt"), or simply MessageBoxForPlayers(5,GetMapDataPath().."mymessage.txt").
(NB: team constants can NOT be summed like that)

-------------------------------
These function are useless in singleplayer but can come in handy in MP:

GetTurnTimeLeft(Player)
IsPlayerCurrent(Player)
IsPlayerInGhostMode(Player)
IsPlayerLost(Player)
IsPlayerWaitingForTurn(Player)
IsTeamCurrent(Player)

Names are self-explanatory, I believe.

----------------
P.S. Devs say these functions will be fully documented in patch 3.1.

User avatar
rdeford
Assassin
Assassin
Posts: 299
Joined: 17 Apr 2007
Location: Sequim, USA
Contact:

Unread postby rdeford » 05 May 2008, 16:57

Thanks Franzy!!!
rdeford, Mage Of Soquim

“Forgiving and being forgiven, loving and being loved,
living and letting live, is the simple basis for it all."

Ernest Holmes 1984

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 05 May 2008, 20:30

You're welcome. If you have any questions, feel free to ask. I'll redirect them to the guys in russian forum who have experience creating MP maps.

Sarvi
Leprechaun
Leprechaun
Posts: 46
Joined: 29 Sep 2006

mp script functions

Unread postby Sarvi » 09 Jan 2009, 10:03

Where is the info on the new multiplayer script functions? I have installed patch 3.1 and read the readme file but have not found any mention of them anywhere....
Ach wie schoen das niemand weiss....

User avatar
Asheera
Round Table Knight
Round Table Knight
Posts: 4506
Joined: 06 Jul 2008
Location: The Shadows
Contact:

Unread postby Asheera » 09 Jan 2009, 12:33

As far as I know they are not documented unfortunately...
No matter how powerful one becomes, there is always someone stronger. That's why I'm in a constant pursuit of power, so I can be prepared when an enemy tries to take advantage of me.

User avatar
rdeford
Assassin
Assassin
Posts: 299
Joined: 17 Apr 2007
Location: Sequim, USA
Contact:

Unread postby rdeford » 09 Jan 2009, 13:25

@ Ashreea -- I think you are right.

@ Sarvi -- I managed to get a few of them working in my Gang of Two map using trial and error. You might wish to look at its script for ideas.
rdeford, Mage Of Soquim

“Forgiving and being forgiven, loving and being loved,
living and letting live, is the simple basis for it all."

Ernest Holmes 1984

User avatar
Asheera
Round Table Knight
Round Table Knight
Posts: 4506
Joined: 06 Jul 2008
Location: The Shadows
Contact:

Unread postby Asheera » 09 Jan 2009, 13:39

Where do you have problems Sarvi? With those filters? Well, ask where you're stuck and maybe we can help :)
No matter how powerful one becomes, there is always someone stronger. That's why I'm in a constant pursuit of power, so I can be prepared when an enemy tries to take advantage of me.

Sarvi
Leprechaun
Leprechaun
Posts: 46
Joined: 29 Sep 2006

re- multiplayer script functions

Unread postby Sarvi » 10 Jan 2009, 00:25

Thanks guys!
I don't have any problems (yet!). The filters were explained nicely by Franzy earlier in this forum.
I've studied the 'Gang of Two' script too (playing the map at the moment), which is i believe the first scripted multiplayer map...Ground-breaking work ,Mage of Soquim!!
Ach wie schoen das niemand weiss....


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 0 guests