//! textmacro tmdmtp takes integer
//you would usually use this function for addressing the players both involved in a special event
//like for example, a player's hero kills the hero of another player, or maybe he steals some gold
//the boolean if true would make the message display to them, and false display to everyone else
//with these boolean functions, you can display two different message to both players with one
// call, and with an additional call, display a message to everyone else, utilizing two strings
//example:
/*
call msgtwo35(GetOwningPlayer(GetTriggerUnit()),"You got owned by "+GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+"!",GetOwningPlayer(GetKillingUnit()),"You just dominated "+GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+"!",true)
call msgtwo35(GetOwningPlayer(GetTriggerUnit()),GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+" just got owned by ",GetOwningPlayer(GetKillingUnit()),GetPlayerName(GetOwningPlayer(GetKillingUnit()))+"!",false)
*/
function msgtwo$integer$ takes player p1, string s1, player p2, string s2, boolean two returns nothing
local integer i = 0
local integer ip1 = GetPlayerId(p1)
local integer ip2 = GetPlayerId(p2)
if two then
call DisplayTimedTextToPlayer(p1,0,0,$integer$,s1)
call DisplayTimedTextToPlayer(p2,0,0,$integer$,s2)
else
loop
if i == ip1 then
set i = i + 1
elseif i == ip2 then
set i = i + 1
else
call DisplayTimedTextToPlayer(Player(i),0,0,$integer$,s1+s2)//if you want, you can just delete either s1 or s2 at this point if you don't care for submitting two halves in the function call
set i = i + 1
endif
exitwhen i > 11
endloop
endif
endfunction
//! endtextmacro
//! runtextmacro tmdmtp("5")
//! runtextmacro tmdmtp("10")
//! runtextmacro tmdmtp("15")
//! runtextmacro tmdmtp("20")
//! runtextmacro tmdmtp("25")
//! runtextmacro tmdmtp("30")
//! runtextmacro tmdmtp("35")
//! runtextmacro tmdmtp("40")
//! runtextmacro tmdmtp("45")
//! runtextmacro tmdmtp("50")
//! runtextmacro tmdmtp("55")
//! runtextmacro tmdmtp("60")
//! runtextmacro tmdmtp("65")
//! runtextmacro tmdmtp("70")
//! runtextmacro tmdmtp("75")
//! runtextmacro tmdmtp("80")
//! runtextmacro tmdmtp("85")
//! runtextmacro tmdmtp("90")
//! runtextmacro tmdmtp("95")
//! runtextmacro tmdmtp("100")
//! runtextmacro tmdmtp("105")
//! runtextmacro tmdmtp("110")
//! runtextmacro tmdmtp("115")
//! runtextmacro tmdmtp("120")
//! runtextmacro tmdmtp("125")
//! runtextmacro tmdmtp("130")
//! runtextmacro tmdmtp("135")
//! runtextmacro tmdmtp("140")
//! runtextmacro tmdmtp("145")
//! runtextmacro tmdmtp("150")
//! runtextmacro tmdmtp("155")
//! runtextmacro tmdmtp("160")
//! runtextmacro tmdmtp("165")
//! runtextmacro tmdmtp("170")
//! runtextmacro tmdmtp("175")
//! runtextmacro tmdmtp("180")
//! runtextmacro tmdmtp("185")
//! runtextmacro tmdmtp("190")
//! runtextmacro tmdmtp("195")
//! runtextmacro tmdmtp("200")
//! runtextmacro tmdmtp("205")
//! runtextmacro tmdmtp("210")
//! runtextmacro tmdmtp("215")
//! runtextmacro tmdmtp("220")
//! runtextmacro tmdmtp("225")
//! runtextmacro tmdmtp("230")
//! runtextmacro tmdmtp("235")
//! runtextmacro tmdmtp("240")
//! runtextmacro tmdmtp("245")
//! runtextmacro tmdmtp("250")
//! runtextmacro tmdmtp("255")
//! runtextmacro tmdmtp("260")
//! runtextmacro tmdmtp("265")
//! runtextmacro tmdmtp("270")
//! runtextmacro tmdmtp("275")
//! runtextmacro tmdmtp("280")
//! runtextmacro tmdmtp("285")
//! runtextmacro tmdmtp("290")
//! runtextmacro tmdmtp("295")
//! runtextmacro tmdmtp("300")
//you would usually use this function for addressing the players both involved in a special event
//like for example, a player's hero kills the hero of another player, or maybe he steals some gold
//the boolean if true would make the message display to them, and false display to everyone else
//with these boolean functions, you can display two different message to both players with one
// call, and with an additional call, display a message to everyone else, utilizing two strings
//example:
/*
call msgtwo35(GetOwningPlayer(GetTriggerUnit()),"You got owned by "+GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+"!",GetOwningPlayer(GetKillingUnit()),"You just dominated "+GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+"!",true)
call msgtwo35(GetOwningPlayer(GetTriggerUnit()),GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+" just got owned by ",GetOwningPlayer(GetKillingUnit()),GetPlayerName(GetOwningPlayer(GetKillingUnit()))+"!",false)
*/
public function Two takes player p1, string s1, player p2, string s2, boolean two, integer duration returns nothing
local integer i = 0
local integer ip1 = GetPlayerId(p1)
local integer ip2 = GetPlayerId(p2)
if two then
call DisplayTimedTextToPlayer(p1,0,0,duration,s1)
call DisplayTimedTextToPlayer(p2,0,0,duration,s2)
else
loop
if i == ip1 then
set i = i + 1
elseif i == ip2 then
set i = i + 1
else
call DisplayTimedTextToPlayer(Player(i),0,0,duration,s1+s2)//if you want, you can just delete either s1 or s2 at this point if you don't care for submitting two halves in the function call
set i = i + 1
endif
exitwhen i > 11
endloop
endif
endfunction
//TDHT=TheDemonHuntTournament, just replace TDHT with your map's main library
I figure this will be useful for all my maps.
//function msgtwo$integer$ takes player p1, string s1, player p2, string s2, boolean two returns nothing
// the above is not useful, use Msg_SinglePlayer twice instead.
library MSGS
public function Diplomatic takes player p, boolean sendToAllies, string s, integer duration returns nothing
if IsPlayerAlly(p,GetLocalPlayer())==sendToAllies then
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,duration,s)
endif
endfunction
public function SinglePlayer takes player p, string s, integer duration returns nothing
call DisplayTimedTextToPlayer(p,0,0,duration,s)
endfunction
public function All takes string s, integer duration returns nothing
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,duration,s)
endfunction
endlibrary
Fixed. Cheers.your third function doesn't even work.
it makes sense because it means faster message creation on the cost of ugly function names that break up the whole concept of your map. if your map needs to have an unusually large ammount of messages and dont know copy & paste, you'll want this system.