Moderator
M
Moderator
VGsatomi: Approved. I like how you did the hero/ability picking. Wide variety of abilities for each hero. Should lessen the amount of time between waves in my opinion.
(3 ratings)
Whoa... the reconstructing tower is a mindblowing idea for me. I will try testing this if it goes well. Thank you!
The problem was just strategy. Use a melee hero choosing auras benefiting your troops. then the map can be ended in under 15 minutes. If you want it to be a short map then it is definitely that for a single player. (played in single player only) but i would say that it isn't very interesting in single player without enemy heroes.lol I also have tried that method and it went just like you said. The defending team captured the tower back in just 1-2 minute, and cpuld push back to the enemy base and capture their back tower, then the opponent capture it back. That turned into a loop and made that a 1 hour game, which I don't want that.
@zv27
to be honest, no I don't know how to do it lol but for now there are many triggers that pointing Player1 and Player7, so changing this whole thing will cause me a lot of troubles refixing the triggers.
So I will think about it, and it would be great to know how to do this if you please : ) Thank you very much!
I do want the how to remove player slot and still having them take part in their color in-game playing, so please tell me whenever you feel comfortable. It could be here in this reply or by messaging me : ) Thanks a lot!
Create a new map with size 96x96 for testing, set the starting location of all players except the player 1 and 7GUI would be appreciate. My knowledge of JASS using is not very advanced lol...
and yes my map is not protected. I just don't feel like protecting my map because there aren't many mapmakers from where I play WCIII (in my country's server) ppl there just play DotA and never give sheezt for other maps.
@thekebecer
will do : )
function FillGlobalVariable takes nothing returns nothing
local integer x
set x=0
loop
exitwhen (x>16)
set udg_death_time[x]=0
set x=x+1
endloop
set x=0
loop
exitwhen(x>8)
set udg_check_is_used[x]=false
set udg_check_is_revived[x]=false
set udg_check_is_picked[x]=false
set x=x+1
endloop
set x=0
loop
exitwhen(x>15)
set udg_check_is_repicked[x]=false
set udg_check_is_randomed[x]=false
set udg_death_counter[x]=0
set udg_which_unit[x]=null
set x=x+1
endloop
endfunction
function RegHashTable takes nothing returns hashtable
if udg_HTable==null then
call InitHashtable()
set udg_HTable=InitHashtable()
endif
return udg_HTable
endfunction
function RegisterPlayersInRedForce takes player whichPlayer returns boolean
return(whichPlayer==udg_Player_NightElf[0])or(whichPlayer==udg_Player_NightElf[1])or(whichPlayer==udg_Player_NightElf[2])or(whichPlayer==udg_Player_NightElf[3])or(whichPlayer==udg_Player_NightElf[4])or(whichPlayer==udg_Player_NightElf[5])
endfunction
function RegisterPlayersInGreenForce takes player whichPlayer returns boolean
return(whichPlayer==udg_Player_Undead[0])or(whichPlayer==udg_Player_Undead[1])or(whichPlayer==udg_Player_Undead[2])or(whichPlayer==udg_Player_Undead[3])or(whichPlayer==udg_Player_Undead[4])or(whichPlayer==udg_Player_Undead[5])
endfunction
function RegisterPlayersIfActive takes player whichPlayer returns boolean
return(GetPlayerSlotState(whichPlayer)==ConvertPlayerSlotState(1))//and GetPlayerController(whichPlayer)==ConvertMapControl(0)
endfunction
function RegisterOfActivePlayers takes nothing returns nothing
if RegisterPlayersIfActive(GetEnumPlayer())then
set bj_forceCountPlayers=bj_forceCountPlayers+1
endif
endfunction
function RegisterTheNumberOfActivePlayers takes force whichForce returns integer
set bj_forceCountPlayers=0
call ForForce(whichForce,function RegisterOfActivePlayers)
return bj_forceCountPlayers
endfunction
function RegisterPlayers takes nothing returns nothing
local integer x
local integer ForceRedCounter
local integer ForceGreenCounter
set udg_Player_NightElf[0]=Player(0)
set udg_Player_NightElf[1]=Player(1)
set udg_Player_NightElf[2]=Player(2)
set udg_Player_NightElf[3]=Player(3)
set udg_Player_NightElf[4]=Player(4)
set udg_Player_NightElf[5]=Player(5)
set udg_Player_Undead[0]=Player(6)
set udg_Player_Undead[1]=Player(7)
set udg_Player_Undead[2]=Player(8)
set udg_Player_Undead[3]=Player(9)
set udg_Player_Undead[4]=Player(10)
set udg_Player_Undead[5]=Player(11)
set udg_Player_Neutral_Hostile=Player(12)
set udg_Player_Neutral_Victim=Player(13)
set udg_Player_Neutral_Extra=Player(14)
set udg_Player_Neutral_Passive=Player(15)
set udg_txt[GetPlayerId(udg_Player_NightElf[0])]="|c00ff0303"
set udg_txt[GetPlayerId(udg_Player_NightElf[1])]="|c000042ff"
set udg_txt[GetPlayerId(udg_Player_NightElf[2])]="|c001ce6b9"
set udg_txt[GetPlayerId(udg_Player_NightElf[3])]="|c00540081"
set udg_txt[GetPlayerId(udg_Player_NightElf[4])]="|c00fffc01"
set udg_txt[GetPlayerId(udg_Player_NightElf[5])]="|c00ff8000"
set udg_txt[GetPlayerId(udg_Player_Undead[0])]="|c0020c000"
set udg_txt[GetPlayerId(udg_Player_Undead[1])]="|c00e55bb0"
set udg_txt[GetPlayerId(udg_Player_Undead[2])]="|c00959697"
set udg_txt[GetPlayerId(udg_Player_Undead[3])]="|c007ebff1"
set udg_txt[GetPlayerId(udg_Player_Undead[4])]="|c00106246"
set udg_txt[GetPlayerId(udg_Player_Undead[5])]="|c004e2a04"
call SetPlayerColor(udg_Player_NightElf[0],ConvertPlayerColor(0))
call SetPlayerColor(udg_Player_NightElf[1],ConvertPlayerColor(1))
call SetPlayerColor(udg_Player_NightElf[2],ConvertPlayerColor(2))
call SetPlayerColor(udg_Player_NightElf[3],ConvertPlayerColor(3))
call SetPlayerColor(udg_Player_NightElf[4],ConvertPlayerColor(4))
call SetPlayerColor(udg_Player_NightElf[5],ConvertPlayerColor(5))
call SetPlayerColor(udg_Player_Undead[0],ConvertPlayerColor(6))
call SetPlayerColor(udg_Player_Undead[1],ConvertPlayerColor(7))
call SetPlayerColor(udg_Player_Undead[2],ConvertPlayerColor(8))
call SetPlayerColor(udg_Player_Undead[3],ConvertPlayerColor(9))
call SetPlayerColor(udg_Player_Undead[4],ConvertPlayerColor(10))
call SetPlayerColor(udg_Player_Undead[5],ConvertPlayerColor(11))
set x=0
loop
exitwhen x>5
call SetPlayerAlliance(udg_Player_NightElf[0],udg_Player_NightElf[x],ConvertAllianceType(0),true)
call SetPlayerAlliance(udg_Player_NightElf[1],udg_Player_NightElf[x],ConvertAllianceType(0),true)
call SetPlayerAlliance(udg_Player_NightElf[2],udg_Player_NightElf[x],ConvertAllianceType(0),true)
call SetPlayerAlliance(udg_Player_NightElf[3],udg_Player_NightElf[x],ConvertAllianceType(0),true)
call SetPlayerAlliance(udg_Player_NightElf[4],udg_Player_NightElf[x],ConvertAllianceType(0),true)
call SetPlayerAlliance(udg_Player_NightElf[5],udg_Player_NightElf[x],ConvertAllianceType(0),true)
call SetPlayerAlliance(udg_Player_Undead[0],udg_Player_Undead[x],ConvertAllianceType(0),true)
call SetPlayerAlliance(udg_Player_Undead[1],udg_Player_Undead[x],ConvertAllianceType(0),true)
call SetPlayerAlliance(udg_Player_Undead[2],udg_Player_Undead[x],ConvertAllianceType(0),true)
call SetPlayerAlliance(udg_Player_Undead[3],udg_Player_Undead[x],ConvertAllianceType(0),true)
call SetPlayerAlliance(udg_Player_Undead[4],udg_Player_Undead[x],ConvertAllianceType(0),true)
call SetPlayerAlliance(udg_Player_Undead[5],udg_Player_Undead[x],ConvertAllianceType(0),true)
call SetPlayerAlliance(udg_Player_NightElf[0],udg_Player_NightElf[x],ConvertAllianceType(5),true)
call SetPlayerAlliance(udg_Player_NightElf[1],udg_Player_NightElf[x],ConvertAllianceType(5),true)
call SetPlayerAlliance(udg_Player_NightElf[2],udg_Player_NightElf[x],ConvertAllianceType(5),true)
call SetPlayerAlliance(udg_Player_NightElf[3],udg_Player_NightElf[x],ConvertAllianceType(5),true)
call SetPlayerAlliance(udg_Player_NightElf[4],udg_Player_NightElf[x],ConvertAllianceType(5),true)
call SetPlayerAlliance(udg_Player_NightElf[5],udg_Player_NightElf[x],ConvertAllianceType(5),true)
call SetPlayerAlliance(udg_Player_Undead[0],udg_Player_Undead[x],ConvertAllianceType(5),true)
call SetPlayerAlliance(udg_Player_Undead[1],udg_Player_Undead[x],ConvertAllianceType(5),true)
call SetPlayerAlliance(udg_Player_Undead[2],udg_Player_Undead[x],ConvertAllianceType(5),true)
call SetPlayerAlliance(udg_Player_Undead[3],udg_Player_Undead[x],ConvertAllianceType(5),true)
call SetPlayerAlliance(udg_Player_Undead[4],udg_Player_Undead[x],ConvertAllianceType(5),true)
call SetPlayerAlliance(udg_Player_Undead[5],udg_Player_Undead[x],ConvertAllianceType(5),true)
set x=x+1
endloop
set x=1
loop
exitwhen x>5
if RegisterPlayersIfActive(udg_Player_NightElf[x])then
call ForceAddPlayer(udg_NightElf_Force,udg_Player_NightElf[x])
endif
if RegisterPlayersIfActive(udg_Player_Undead[x])then
call ForceAddPlayer(udg_Undead_Force,udg_Player_Undead[x])
endif
set x=x+1
endloop
call SetPlayerTeam(udg_Player_NightElf[0],0)
call SetPlayerTeam(udg_Player_NightElf[1],0)
call SetPlayerTeam(udg_Player_NightElf[2],0)
call SetPlayerTeam(udg_Player_NightElf[3],0)
call SetPlayerTeam(udg_Player_NightElf[4],0)
call SetPlayerTeam(udg_Player_NightElf[5],0)
call SetPlayerTeam(udg_Player_Undead[0],1)
call SetPlayerTeam(udg_Player_Undead[1],1)
call SetPlayerTeam(udg_Player_Undead[2],1)
call SetPlayerTeam(udg_Player_Undead[3],1)
call SetPlayerTeam(udg_Player_Undead[4],1)
call SetPlayerTeam(udg_Player_Undead[5],1)
call SetPlayerName(udg_Player_NightElf[0],"Force 1")
call SetPlayerName(udg_Player_Undead[0],"Force 2")
set ForceRedCounter=RegisterTheNumberOfActivePlayers(udg_NightElf_Force)
set ForceGreenCounter=RegisterTheNumberOfActivePlayers(udg_Undead_Force)
set x=1
loop
exitwhen x>5
if RegisterPlayersIfActive(udg_Player_NightElf[x])then
call SetPlayerState(udg_Player_NightElf[x],ConvertPlayerState(1),(4000/ForceRedCounter))
call SetPlayerState(udg_Player_NightElf[x],ConvertPlayerState(2),0)
call SetPlayerState(udg_Player_NightElf[x],ConvertPlayerState(4),10)
endif
if RegisterPlayersIfActive(udg_Player_Undead[x])then
call SetPlayerState(udg_Player_Undead[x],ConvertPlayerState(1),(4000/ForceGreenCounter))
call SetPlayerState(udg_Player_Undead[x],ConvertPlayerState(2),0)
call SetPlayerState(udg_Player_Undead[x],ConvertPlayerState(4),10)
endif
if not RegisterPlayersIfActive(udg_Player_NightElf[x])then
call SetPlayerName(udg_Player_NightElf[x],"[email protected] "+I2S(x))
endif
if not RegisterPlayersIfActive(udg_Player_Undead[x])then
call SetPlayerName(udg_Player_Undead[x],"[email protected] "+I2S(5+x))
endif
call SetPlayerHandicapXP(udg_Player_NightElf[x],1)
call SetPlayerHandicapXP(udg_Player_Undead[x],1)
set x=x+1
endloop
set x=0
loop
call SetPlayerState(udg_Player_NightElf[x],ConvertPlayerState(7),1)
call SetPlayerState(udg_Player_Undead[x],ConvertPlayerState(7),1)
set x=x+1
exitwhen x>5
endloop
endfunction
function RescriptCreateRect takes nothing returns nothing
set udg_rct_Marketplace_NightElf=Rect(-4864.,3872.,-3744.,4736.)
set udg_rct_Marketplace_Undead=Rect(3712.,-5280.,4832.,-4416.)
set udg_rct_NightElf_Hero_Spawn=Rect(-3808.,3264.,-3328.,3712.)
set udg_rct_Undead_Hero_Spawn=Rect(3136.,-4096.,3616.,-3648.)
endfunction
function SetupUnit takes nothing returns nothing
local player p
local unit lf0
local unit lf7
set p=Player(1)
set udg_Circle_Of_Power_P1_Blue=CreateUnit(p,'ncop',-4544.,4544.,270.)
set p=Player(2)
set udg_Circle_Of_Power_P2_Teal=CreateUnit(p,'ncop',-4416.,4544.,270.)
set p=Player(3)
set udg_Circle_Of_Power_P3_Purple=CreateUnit(p,'ncop',-4288.,4544.,270.)
set p=Player(4)
set udg_Circle_Of_Power_P4_Yellow=CreateUnit(p,'ncop',-4160.,4544.,270.)
set p=Player(5)
set udg_Circle_Of_Power_P5_Orange=CreateUnit(p,'ncop',-4032.,4544.,270.)
set p=Player(15)
set lf0=CreateUnit(p,'ntav',-4288.,4288.,270.)
call SetUnitColor(lf0,ConvertPlayerColor(0))
call SaveAgentHandle(RegHashTable(),0,StringHash("Red Tavern"),lf0)
set lf7=CreateUnit(p,'n000',4288.,-4864.,270.)
call SetUnitColor(lf7,ConvertPlayerColor(6))
call SaveAgentHandle(RegHashTable(),0,StringHash("Green Tavern"),lf7)
set p=Player(7)
set udg_Circle_Of_Power_P7_Pink=CreateUnit(p,'ncop',4032.,-5120.,270.)
set p=Player(8)
set udg_Circle_Of_Power_P8_Gray=CreateUnit(p,'ncop',4160.,-5120.,270.)
set p=Player(9)
set udg_Circle_Of_Power_P9_Light_Blue=CreateUnit(p,'ncop',4288.,-5120.,270.)
set p=Player(10)
set udg_Circle_Of_Power_P10_Dark_Green=CreateUnit(p,'ncop',4416.,-5120.,270.)
set p=Player(11)
set udg_Circle_Of_Power_P11_Brown=CreateUnit(p,'ncop',4544.,-5120.,270.)
endfunction
function LimitSelectionForPlayer takes integer whichInteger,player whichPlayer returns nothing
call SetPlayerTechMaxAllowed(whichPlayer,whichInteger,0)
set udg_check_is_used[GetUnitPointValueByType(whichInteger)]=true
endfunction
function LimitSelectionForAllPlayer takes integer i returns nothing
call LimitSelectionForPlayer(i,udg_Player_NightElf[1])
call LimitSelectionForPlayer(i,udg_Player_NightElf[2])
call LimitSelectionForPlayer(i,udg_Player_NightElf[3])
call LimitSelectionForPlayer(i,udg_Player_NightElf[4])
call LimitSelectionForPlayer(i,udg_Player_NightElf[5])
call LimitSelectionForPlayer(i,udg_Player_Undead[1])
call LimitSelectionForPlayer(i,udg_Player_Undead[2])
call LimitSelectionForPlayer(i,udg_Player_Undead[3])
call LimitSelectionForPlayer(i,udg_Player_Undead[4])
call LimitSelectionForPlayer(i,udg_Player_Undead[5])
endfunction
function RescriptHeroData takes nothing returns nothing
set udg_First_NightElf_Hero=1
set udg_Max_Hero_Num[1]='Ekee'
set udg_Max_Hero_Num[2]='Emoo'
set udg_Max_Hero_Num[3]='Edem'
set udg_Max_Hero_Num[4]='Ewar'
set udg_Last_NightElf_Hero=4
set udg_First_Undead_Hero=8
set udg_Max_Hero_Num[8]='Udea'
set udg_Max_Hero_Num[9]='Ulic'
set udg_Max_Hero_Num[10]='Udre'
set udg_Max_Hero_Num[11]='Ucrl'
set udg_Last_Undead_Hero=11
endfunction
function AddUnitToMarket takes integer i returns unit
if i<=4 then
return LoadUnitHandle(RegHashTable(),0,StringHash("Red Tavern"))
elseif i<=12 then
return LoadUnitHandle(RegHashTable(),0,StringHash("Green Tavern"))
endif
return null
endfunction
function RescriptAddHeroesToMarketplace takes nothing returns nothing
local integer x=udg_First_NightElf_Hero
loop
exitwhen x>udg_Last_NightElf_Hero
call AddUnitToStock(AddUnitToMarket(x),udg_Max_Hero_Num[x],0,1)
set x=x+1
endloop
set x=udg_First_Undead_Hero
loop
exitwhen x>udg_Last_Undead_Hero
call AddUnitToStock(AddUnitToMarket(x),udg_Max_Hero_Num[x],0,1)
set x=x+1
endloop
endfunction
function MoveUnitInstantlyToCoordinates takes unit u,real x,real y returns boolean
local rect rct=GetWorldBounds()
local real lf1=GetRectMinX(rct)
local boolean check=true
if(x<lf1)then
set x=lf1
set check=false
else
set lf1=GetRectMaxX(rct)
if(x>lf1)then
set check=false
set x=lf1
endif
endif
set lf1=GetRectMinY(rct)
if(y<lf1)then
set y=lf1
set check=false
else
set lf1=GetRectMaxY(rct)
if(y>lf1)then
set y=lf1
set check=false
endif
endif
call SetUnitX(u,x)
call SetUnitY(u,y)
set rct=null
return check
endfunction
function SetUnitLoc takes unit u,location l returns boolean
return MoveUnitInstantlyToCoordinates(u,GetLocationX(l),GetLocationY(l))
endfunction
function InitTrig_Trigger_1_JASS_Version_Example_1 takes nothing returns nothing
call FillGlobalVariable()
call RescriptCreateRect()
call RegisterPlayers()
call SetupUnit()
call RescriptHeroData()
call RescriptAddHeroesToMarketplace()
call TimerStart(udg_endless_time,99999.,false,null)
call SetFloatGameState(ConvertFGameState(2),6.)
endfunction
function HeroSpawnOrRevivedCond takes nothing returns boolean
return not IsUnitType(GetTriggerUnit(),ConvertUnitType(0))==false and not udg_check_is_picked[GetUnitPointValue(GetTriggerUnit())] and not IsUnitType(GetTriggerUnit(),ConvertUnitType(10)) and not IsUnitIllusion(GetTriggerUnit())
endfunction
function HeroSpawnOrRevivedMain takes nothing returns nothing
local unit u=GetTriggerUnit()
local integer x
local integer y
local real lX
local real lY
local location l
local rect r=udg_rct_NightElf_Hero_Spawn
local rect R=udg_rct_Undead_Hero_Spawn
set udg_check_is_picked[GetUnitPointValue(u)]=true
set udg_which_unit[GetPlayerId(GetOwningPlayer(u))]=u
set udg_check_is_used[GetUnitPointValue(u)]=true
call LimitSelectionForAllPlayer(GetUnitTypeId(u))
call SetPlayerState(GetOwningPlayer(u),ConvertPlayerState(4),6)
if RegisterPlayersInRedForce(GetOwningPlayer(u))then
set lX=GetRectCenterX(r)
set lY=GetRectCenterY(r)
set l=Location(GetRandomReal(GetRectMinX(r),GetRectMaxX(r)),GetRandomReal(GetRectMinY(r),GetRectMaxY(r)))
else
set lX=GetRectCenterX(udg_rct_Undead_Hero_Spawn)
set lY=GetRectCenterY(udg_rct_Undead_Hero_Spawn)
set l=Location(GetRandomReal(GetRectMinX(R),GetRectMaxX(R)),GetRandomReal(GetRectMinY(R),GetRectMaxY(R)))
endif
set udg_check_is_revived[GetUnitPointValue(u)]=true
call ClearSelection()
if GetLocalPlayer()==GetOwningPlayer(u)then
call PanCameraToTimed(lX,lY,0)
call SelectUnit(u,true)
endif
set udg_death_time[GetPlayerId(GetOwningPlayer(u))]=0
set udg_death_counter[GetPlayerId(GetOwningPlayer(u))]=udg_death_counter[GetPlayerId(GetOwningPlayer(u))]+1
if GetTriggerEventId()==ConvertPlayerUnitEvent(46)then
call MoveUnitInstantlyToCoordinates(u,lX,lY)
call SetUnitLoc(u,l)
else
call MoveUnitInstantlyToCoordinates(u,lX,lY)
call SetUnitLoc(u,l)
endif
if(udg_check_is_repicked[GetPlayerId(GetOwningPlayer(u))])then
call DisplayTimedTextToForce(GetPlayersEnemies(GetOwningPlayer(u)),10.,("An enemy has repicked into "+(GetUnitName(u)+".")))
elseif (udg_check_is_randomed[GetPlayerId(GetOwningPlayer(u))])then
call DisplayTimedTextToForce(GetPlayersEnemies(GetOwningPlayer(u)),10.,("An enemy has randomed "+(GetUnitName(u)+".")))
else
call DisplayTimedTextToForce(GetPlayersEnemies(GetOwningPlayer(u)),10.,("An enemy has chosen "+(GetUnitName(u)+".")))
endif
set x=udg_First_NightElf_Hero
set y=udg_Last_NightElf_Hero
loop
exitwhen x>y
call SetPlayerTechMaxAllowed(GetOwningPlayer(u),udg_Max_Hero_Num[x],0)
set x=x+1
endloop
set x=udg_First_Undead_Hero
set y=udg_Last_Undead_Hero
loop
exitwhen x>y
call SetPlayerTechMaxAllowed(GetOwningPlayer(u),udg_Max_Hero_Num[x],0)
set x=x+1
endloop
call RemoveLocation(l)
set u=null
endfunction
function InitTrig_Trigger_2_JASS_Version_Example_1 takes nothing returns nothing
local trigger ltt=CreateTrigger()
local region R1
local region R2
local boolexpr bx=Filter(function HeroSpawnOrRevivedCond)
local integer i=0
loop
call TriggerRegisterPlayerUnitEvent(ltt,Player(i),ConvertPlayerUnitEvent(46),null)
set i=i+1
exitwhen i==16
endloop
set R1=CreateRegion()
call RegionAddRect(R1,udg_rct_Marketplace_NightElf)
call TriggerRegisterEnterRegion(ltt,R1,bx)
set R2=CreateRegion()
call RegionAddRect(R2,udg_rct_Marketplace_Undead)
call TriggerRegisterEnterRegion(ltt,R2,bx)
call TriggerAddAction(ltt,function HeroSpawnOrRevivedMain)
call DestroyBoolExpr(bx)
set ltt=null
endfunction
@thekebecer
1) will fix thx
2) I know how to deal with green icon. could u tell me which one of them still showing green one if possible? if not that is fine though. : ) thx again!
@zv27
Tried it and worked just fine. You are awesome. Thank you for such great help!