• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Really strange thing. Help please.

Status
Not open for further replies.
Level 11
Joined
Oct 11, 2012
Messages
711
There is something really weird going on in my map...
After playing my map for more than 2 hours, when a hero dies, it will just disappear from the map, the items are left on the ground. I do not know what causes this. If I play the map for just 1 hour or less, this will not happen.
Because the items are left on the ground, I suppose its not a "RemoveUnit()" function that causes this.
I am using Bribe's unit indexer and another unit indexer (the one with a library...), do they conflict with each other and causes this?
 
Level 11
Joined
Oct 11, 2012
Messages
711
op limit ? no no , maybe indexers went out of memory , i mean space , i mean higher than normal value . Use one indexer yes . Also post the trigger of reviving here, that's if the hero revives .

Alright, I will just use one indexer then. The trigger of reviving is badly coded, better not to show them, LOL. The trigger works if I do not play the map for too long, so I think the trigger is OK.
 
Level 11
Joined
Oct 11, 2012
Messages
711
If the code is ad coded then let us see what's bad in it and we improve it -_______-

The two unit indexers may collide each other.. Don't be afraid showing us the triggers because we will correct the mistakes or bad coded that you've done in the trigger.

Alright, guys, here is my poorly written code, >_<. I know that I should not use locations and BJs and should use a timer, will change that later. LOL

JASS:
function Trig_revive_Conditions takes nothing returns boolean
    if (GetUnitTypeId(GetTriggerUnit())=='U000')or(GetUnitTypeId(GetTriggerUnit())=='E002')or(GetUnitTypeId(GetTriggerUnit())=='h023')or(GetUnitTypeId(GetTriggerUnit())=='H024')or(GetUnitTypeId(GetTriggerUnit())=='O00W')or(GetUnitTypeId(GetTriggerUnit())=='O00Y')or(GetUnitTypeId(GetTriggerUnit())=='O00Z')or(GetUnitTypeId(GetTriggerUnit())=='O010')or(GetUnitTypeId(GetTriggerUnit())=='O011')then
        return false
    endif
    return(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO))and(GetPlayerController(GetOwningPlayer(GetTriggerUnit()))==MAP_CONTROL_USER)
endfunction
function Trig_revive_Func001C takes nothing returns boolean
    return(udg_Made==3)
endfunction
function Trig_revive_Func009C takes nothing returns boolean
    return(udg_Made==2)
endfunction
function Trig_revive_Actions takes nothing returns nothing
    local location a
    set a = GetRectCenter(gg_rct________113)
    if(Trig_revive_Func001C())then
        call SetUnitLifePercentBJ(gg_unit_H00F_0198,(GetUnitLifePercent(gg_unit_H00F_0198)*.5))
    endif
    set udg_die=(udg_die+1)
    set udg_die=ModuloInteger(udg_die,30)
    set udg_hero[udg_die]=GetTriggerUnit()
    call TriggerSleepAction(30.)
    set udg_revive=(udg_revive+1)
    set udg_revive=ModuloInteger(udg_revive,30)
    if(Trig_revive_Func009C())then
        set udg_LSdian=GetRectCenter(gg_rct_nv_shen)
        call ReviveHeroLoc(udg_hero[udg_revive],udg_LSdian,true)
        call RemoveLocation(udg_LSdian)
    else
        call ReviveHeroLoc(udg_hero[udg_revive],a,true)
        call RemoveLocation(a)
    endif
    set a = null
endfunction
function InitTrig_revive takes nothing returns nothing
    set gg_trg_revive=CreateTrigger()
    call TriggerRegisterPlayerUnitEventSimple(gg_trg_revive,Player(0),EVENT_PLAYER_UNIT_DEATH)
    call TriggerRegisterPlayerUnitEventSimple(gg_trg_revive,Player(1),EVENT_PLAYER_UNIT_DEATH)
    call TriggerRegisterPlayerUnitEventSimple(gg_trg_revive,Player(2),EVENT_PLAYER_UNIT_DEATH)
    call TriggerRegisterPlayerUnitEventSimple(gg_trg_revive,Player(3),EVENT_PLAYER_UNIT_DEATH)
    call TriggerRegisterPlayerUnitEventSimple(gg_trg_revive,Player(4),EVENT_PLAYER_UNIT_DEATH)
    call TriggerRegisterPlayerUnitEventSimple(gg_trg_revive,Player(5),EVENT_PLAYER_UNIT_DEATH)
    call TriggerRegisterPlayerUnitEventSimple(gg_trg_revive,Player(6),EVENT_PLAYER_UNIT_DEATH)
    call TriggerRegisterPlayerUnitEventSimple(gg_trg_revive,Player(7),EVENT_PLAYER_UNIT_DEATH)
    call TriggerAddCondition(gg_trg_revive,Condition(function Trig_revive_Conditions))
    call TriggerAddAction(gg_trg_revive,function Trig_revive_Actions)
endfunction
 
Status
Not open for further replies.
Top