• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

My map can affect Dota? is that possible?

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,163
First, let me tell you about the problem.

2 weeks ago we have played JFA (v1.3c) for 10 days but 2 days ago we've encountered with weird problem.

At the JFA (v1.4beta) version, we've created 2 new slots for refree players and re-created neutral spawn triggers. In the game, when the neutral creeps spawned, some of the players dropped from the game. I said "ok maybe the problem is new neutral creeps spawn trigger" but when we created old version same thing happened again and i was back to my home but one of my friends called me and said "hey, i'm dropping from dota map when the neutral creeps spawned"

When i'm arrived at my home i'm uninstalled warcraft 3 and installed again and installed our gaming server again but i realized some of the players drops from the game when neutral creeps spawned

and let me show you to my new neutral creep spawn trigger

Part I

Code:
library NCSpawn initializer Init

globals
    public constant real NEUTRAL_SPAWN_TIME = 60.00 




    public hashtable Hash = InitHashtable()
    camp array Camps
    private integer CampCount = 0
endglobals

struct camp
    integer array types[4]
    integer array counts[4]
    integer typeCount
endstruct



function GetRectId takes rect r returns integer
    local integer i = 1
    loop
        if udg_CreepSpawnRegions[i] == r or udg_CreepSpawnCenterRegions[i] == r then
            return i
        endif
        set i = i + 1
        exitwhen i == 14
    endloop
    return 0
endfunction

function ReturnNCSpawnSmall takes nothing returns nothing
    //local integer id = GetHandleId(LoadRectHandle(Hash, GetHandleId(GetTriggeringRegion()), 0))
    local real x
    local real y

    
    //set x = GetRectCenterX(LoadRectHandle(Hash, id, 0))
    //set y = GetRectCenterY(LoadRectHandle(Hash, id, 0))
    //call IssuePointOrder(GetTriggerUnit(), "move", x, y)
    local integer id = GetHandleId(GetTriggeringRegion())
    
    if LoadRectHandle(Hash, id, 0) == LoadRectHandle(Hash, GetHandleId(GetTriggerUnit()), 0) then
        // creep kendi spawn regionundan cikmis ise
        
        // center regionun kayitli oldugu id'yi bul
        set id = GetHandleId(LoadRectHandle(Hash, id, 0))
        set x = GetRectCenterX(LoadRectHandle(Hash, id, 0))
        set y = GetRectCenterY(LoadRectHandle(Hash, id, 0))
        call IssuePointOrder(GetTriggerUnit(), "move", x, y)
    endif
endfunction

function ReturnNCSpawnBarat takes nothing returns nothing
    local integer id = GetHandleId(LoadRectHandle(Hash, GetHandleId(GetTriggeringRegion()), 0))
    local real x = GetRectCenterX(LoadRectHandle(Hash, id, 0))
    local real y = GetRectCenterY(LoadRectHandle(Hash, id, 0))
    call SetUnitPosition(GetTriggerUnit(), x, y)
    call IssueImmediateOrder(GetTriggerUnit(), "stop")
endfunction

function ReturnNCSpawn takes nothing returns nothing
    local integer id = GetHandleId(LoadRectHandle(Hash, GetHandleId(GetTriggeringRegion()), 0))
    call IssuePointOrder(GetTriggerUnit(), "move", GetRectCenterX(LoadRectHandle(Hash, id, 0)), GetRectCenterY(LoadRectHandle(Hash, id, 0)))
endfunction

function LeaveNCSpawn takes rect r returns nothing
    local region re = CreateRegion()
    call RegionAddRect(re, r)
    call TriggerRegisterLeaveRegion(gg_trg_NC_Spawn_Leave_Region, re, null)
    // region points to bigger rect
    call SaveRectHandle(Hash, GetHandleId(re), 0, r)
    // bigger rect points to center rect
    call SaveRectHandle(Hash, GetHandleId(r), 0, udg_CreepSpawnCenterRegions[GetRectId(r)])
    set re = null
endfunction
    
function RegisterCreepCamp takes integer id1, integer id2, integer id3, integer count1, integer count2, integer count3 returns nothing
    local integer array ids
    local integer array counts
    local integer i = 1
    local unit u
    local boolean b = false
    set Camps[CampCount] = camp.create()
    set Camps[CampCount].typeCount = 0
        
    if id1 != 0 and count1 != 0 then
        set ids[1] = id1
        set counts[1] = count1
        set b = true
    endif
    if id2 != 0 and count2 != 0 then
        set ids[2] = id2
        set counts[2] = count2
        set b = true
    endif
    if id3 != 0 and count3 != 0 then
        set ids[3] = id3
        set counts[3] = count3
        set b = true
    endif
        
    loop
        if ids[i] != 0 then
            set Camps[CampCount].types[i] = ids[i]
            set Camps[CampCount].counts[i] = counts[i]
            set Camps[CampCount].typeCount = Camps[CampCount].typeCount + 1
        endif
        set i = i + 1
        exitwhen i == 4
    endloop
    
    if b then
        set CampCount = CampCount + 1
    else
        call Camps[CampCount].destroy()
    endif
    
endfunction

private function Enum takes nothing returns boolean
    if GetWidgetLife(GetFilterUnit()) > 0 and GetOwningPlayer(GetFilterUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) then
        return true
    endif
    return false
endfunction

function PeriodicNeutralSpawn takes nothing returns nothing
    local integer i = 0
    local integer j = 0
    local integer k = 0
    local integer rnd
    // loop for region
    loop
        set i = i + 1
        call GroupEnumUnitsInRect(bj_lastCreatedGroup, udg_CreepSpawnCenterRegions[i], Condition(function Enum))
        if FirstOfGroup(bj_lastCreatedGroup) == null then
            // randomize for camp
            set rnd = GetRandomInt(0, CampCount - 1)
            // loop for types
            loop
                set j = j + 1
                // loop for count
                loop
                    exitwhen k >= Camps[rnd].counts[j]
                    set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), Camps[rnd].types[j], GetRectCenterX(udg_CreepSpawnCenterRegions[i]), GetRectCenterY(udg_CreepSpawnCenterRegions[i]), 0)
                    call SaveRectHandle(Hash, GetHandleId(bj_lastCreatedUnit), 0, udg_CreepSpawnRegions[i])
                    set k = k + 1
                    
                endloop
                set k = 0
                exitwhen j >= Camps[rnd].typeCount
            endloop
            set j = 0
        endif
        exitwhen i >= udg_CreepSpawnRegionCount
    endloop
endfunction

public function Display takes nothing returns nothing
    local integer i = 0
    local integer j = 1
    call BJDebugMsg("Camp Count:"+I2S(CampCount))
    loop
        call BJDebugMsg("Creep type count of camp "+I2S(i + 1)+"="+I2S(Camps[i].typeCount))
        loop
            call BJDebugMsg(I2S(j+1)+"st type of camp "+I2S(i + 1)+"="+GetObjectName(Camps[i].types[j]))
            set j = j + 1
            exitwhen j >= Camps[i].typeCount
        endloop
        set i = i + 1
        exitwhen i >= CampCount
    endloop
endfunction

private function Init takes nothing returns nothing
    
    
endfunction
    
    
endlibrary

PART II

  • NC Spawn Ayarlar
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Spawn olabilecek creep camp çeÅŸitleri --------
      • -------- Kullanış ÅŸekli şöyle: --------
      • -------- call RegisterNCCamp(creepÇeÅŸidi1, creepÇeÅŸidi2, creepÇeÅŸidi3, çıkacakCreepSayısı1, çıkacakCreepSayısı2, çıkacakCreepSayısı3) --------
      • Custom script: call RegisterCreepCamp('h02I', 0, 0, 3, 0, 0)
      • Custom script: call RegisterCreepCamp('h04H', 'h02V', 0, 2, 1, 0)
      • Custom script: call RegisterCreepCamp('e00R', 0, 0, 1, 0, 0)
      • Custom script: call RegisterCreepCamp('h04G', 'h04I', 0, 2, 1, 0)
      • -------- Regionlar --------
      • -------- Kücük creeplerin regionları --------
      • Set CreepSpawnRegions[1] = NcUstCheck1 <gen>
      • Set CreepSpawnCenterRegions[1] = NcUst1 <gen>
      • Set CreepSpawnRegions[2] = NcUstCheck2 <gen>
      • Set CreepSpawnCenterRegions[2] = NcUst2 <gen>
      • Set CreepSpawnRegions[3] = NcUstCheck3 <gen>
      • Set CreepSpawnCenterRegions[3] = NcUst3 <gen>
      • Set CreepSpawnRegions[4] = NcUstCheck4 <gen>
      • Set CreepSpawnCenterRegions[4] = NcUst4 <gen>
      • Set CreepSpawnRegions[5] = NcAltCheck1 <gen>
      • Set CreepSpawnCenterRegions[5] = NcAlt1 <gen>
      • Set CreepSpawnRegions[6] = NcAltCheck2 <gen>
      • Set CreepSpawnCenterRegions[6] = NcAlt2 <gen>
      • Set CreepSpawnRegions[7] = NcAltCheck3 <gen>
      • Set CreepSpawnCenterRegions[7] = NcAlt3 <gen>
      • Set CreepSpawnRegions[8] = NcAltCheck4 <gen>
      • Set CreepSpawnCenterRegions[8] = NcAlt4 <gen>
      • -------- DiÄŸer regionlar --------
      • Set CreepSpawnRegions[9] = NCBuyukUst <gen>
      • Set CreepSpawnCenterRegions[9] = NCUstBuyukSpawn <gen>
      • Set CreepSpawnRegions[10] = NCBuyukAlt <gen>
      • Set CreepSpawnCenterRegions[10] = NCAltBuyukSpawn <gen>
      • Set CreepSpawnRegions[11] = BaratSolBolge <gen>
      • Set CreepSpawnCenterRegions[11] = BaratSolCenter <gen>
      • Set CreepSpawnRegions[12] = BaratSagBolge <gen>
      • Set CreepSpawnCenterRegions[12] = BaratSagCenter <gen>
      • Set CreepSpawnRegions[13] = SpiritArea <gen>
      • Set CreepSpawnCenterRegions[13] = SpiritCenter <gen>
      • -------- Küçük spawn region sayısı --------
      • Set CreepSpawnRegionCount = 8
      • -------- Kücük creepler regiondan cikmasn --------
      • For each (Integer A) from 1 to CreepSpawnRegionCount, do (Actions)
        • Loop - Actions
          • Custom script: call LeaveNCSpawn(udg_CreepSpawnRegions[bj_forLoopAIndex])
      • -------- Büyük creepler regiondan cikmasn --------
      • Custom script: call LeaveNCSpawn(gg_rct_NCBuyukUst)
      • Custom script: call LeaveNCSpawn(gg_rct_NCBuyukAlt)
      • -------- Barat regiondan cikmasin --------
      • Custom script: call LeaveNCSpawn(gg_rct_BaratSolBolge)
      • Custom script: call LeaveNCSpawn(gg_rct_BaratSagBolge)
      • -------- Spirit regiondan cikmasın --------
      • Custom script: call LeaveNCSpawn(gg_rct_SpiritArea)
PART III

  • NC Spawn Leave Region
    • Events
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Triggering unit)) Equal to Baratrum the Teabringer (neutral)
              • (Unit-type of (Triggering unit)) Equal to Spirit
              • (Custom value of (Triggering unit)) Equal to 5
              • (Custom value of (Triggering unit)) Equal to 10
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Baratrum the Teabringer (neutral)
            • Then - Actions
              • -------- Barat --------
              • Set TempPoint = (Position of (Triggering unit))
              • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
              • Custom script: call RemoveLocation(udg_TempPoint)
              • Custom script: call ReturnNCSpawnBarat()
            • Else - Actions
              • -------- Ghost --------
              • -------- Buyuk Creepler Ust --------
              • -------- Buyuk Creepler Alt --------
              • Custom script: call ReturnNCSpawn()
        • Else - Actions
          • -------- Kucuk Creepler --------
          • Custom script: call ReturnNCSpawnSmall()
PART IV

  • NC Spawn Start
    • Events
      • Time - timer_nc_kucuk expires
    • Conditions
    • Actions
      • -------- Kücük Creepler, random --------
      • Custom script: call ExecuteFunc("PeriodicNeutralSpawn")
      • Custom script: call TimerStart(CreateTimer(), NCSpawn_NEUTRAL_SPAWN_TIME, true, function PeriodicNeutralSpawn)
      • -------- Büyük creepler --------
      • Trigger - Turn on NeutralCreepRespawnsBuyuk <gen>
      • Trigger - Run NeutralCreepRespawnsBuyuk <gen> (checking conditions)
PART V

  • NeutralCreepRespawnsBuyuk
    • Events
      • Time - Every 120.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in NCBuyukUst <gen>)) Equal to 0
        • Then - Actions
          • Unit - Create 1 Ogre Magi (neutral) for Neutral Hostile at (Center of NCUstBuyukSpawn <gen>) facing Default building facing degrees
          • Unit - Set the custom value of (Last created unit) to 5
          • Custom script: call SaveRectHandle(NCSpawn_Hash, GetHandleId(bj_lastCreatedUnit), 0, gg_rct_NCBuyukUst)
          • Unit - Create 1 Ogre Lord (neutral) for Neutral Hostile at (Center of NCUstBuyukSpawn <gen>) facing Default building facing degrees
          • Unit - Set the custom value of (Last created unit) to 5
          • Custom script: call SaveRectHandle(NCSpawn_Hash, GetHandleId(bj_lastCreatedUnit), 0, gg_rct_NCBuyukUst)
          • Unit - Create 1 Troll Warlord (neutral) for Neutral Hostile at (Center of NCUstBuyukSpawn <gen>) facing Default building facing degrees
          • Unit - Set the custom value of (Last created unit) to 5
          • Custom script: call SaveRectHandle(NCSpawn_Hash, GetHandleId(bj_lastCreatedUnit), 0, gg_rct_NCBuyukUst)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in NCBuyukAlt <gen>)) Equal to 0
        • Then - Actions
          • Unit - Create 1 Ogre Magi (neutral) for Neutral Hostile at (Center of NCAltBuyukSpawn <gen>) facing Default building facing degrees
          • Unit - Set the custom value of (Last created unit) to 10
          • Custom script: call SaveRectHandle(NCSpawn_Hash, GetHandleId(bj_lastCreatedUnit), 0, gg_rct_NCBuyukAlt)
          • Unit - Create 1 Ogre Lord (neutral) for Neutral Hostile at (Center of NCAltBuyukSpawn <gen>) facing Default building facing degrees
          • Unit - Set the custom value of (Last created unit) to 10
          • Custom script: call SaveRectHandle(NCSpawn_Hash, GetHandleId(bj_lastCreatedUnit), 0, gg_rct_NCBuyukAlt)
          • Unit - Create 1 Troll Warlord (neutral) for Neutral Hostile at (Center of NCAltBuyukSpawn <gen>) facing Default building facing degrees
          • Unit - Set the custom value of (Last created unit) to 10
          • Custom script: call SaveRectHandle(NCSpawn_Hash, GetHandleId(bj_lastCreatedUnit), 0, gg_rct_NCBuyukAlt)
        • Else - Actions
Here is the my neutral creeps spawn trigger. Anyone be in doubt about triggers and this trigger (i know it's stupid question but) can affect dota???

and my main problem is reasons of the dropping is about the map?
 
Level 23
Joined
Oct 20, 2012
Messages
3,075
I've never encountered a problem like this before, but a wild guess from me is that when you play JFA, the new code in that map messes something up that will drop players. When you play DOTA, part of the code that has been messed up is used again causing players to drop again. (I think this will happen especially if your spawning triggers is similar to that of DOTA's)

Try reinstalling again and play DOTA first before JFA. if players drop from the game again, then Idk what the hell is going on there.

That was just a wild guess though, was too lazy to check your code.
 
There are two things that can "carry over" between mades:
- overriding default files through imports, like the miscdata.txt, to change for example the font and text color of the warden poison ability.
- gamecache contents

I sometimes had issues with models or sounds "carrying over" to other maps after playing certain maps.
 
Status
Not open for further replies.
Top