Search results

  1. afisakov

    SaveReal function seems to fail in trigger, unsure why. Please help

    The code is below, and runs every time a building is constructed, I included multiple displaytext prompts to try to debug it but cannot tell why it is failing. Supposed to store the units atk speed as a real, modify it by abp(1 for now), ad set the new atk speed. function atk2 takes unit u...
  2. afisakov

    Help designing restricted randomness

    I am working on a map that has several bosses drop a random class-specific drop. Since there are 12 classes there is a 1/12 chance that a drop for your class will randomly appear and these bosses respawn. However, in reality the nature of rng makes it that killing the same boss 12x does not...
  3. afisakov

    Ability not adding issue

    Ok, I have an ability, rawcode 'A05J' that I am trying to add to every tower in the map, but for some reason it only shows up on base towers, not on upgraded ones. As you can see in the code below it should run on both upgrade finished and construct finish, also I have it triggered to display...
  4. afisakov

    Is it possible to pass a variable name to function?

    Not sure if I am asking this right but the situation is below. I have the damage values of a bunch of abilities saved under variable arrays. I want to make an abinfo trigger that will display text to player based on all values of the ability. Is it possible to pass the variable name into...
  5. afisakov

    Hashtable maximum key

    Is there currently a maximum value for key and missionkey inside a hashtable? I wanted to use it to make drop chances that scale with whether u got the previous drop and wrote it using LoadInteger(MiscHash,50,GetItemTypeId('I04J') ) However I know arrays have a max value of about 8000 and...
  6. afisakov

    Hashtable help/questions

    Hello, I am very new to using hashtables some Hopefully quick questions 1) does "RemoveSavedHandle" remove the unit like it sounds, or only destroy the reference and leave unit itself intact 2) does LoadItemHandle truly load/create something that needs to be removed? or is it more similar to...
  7. afisakov

    is there such a thing as item groups- do they leak?

    my experience with unit groups makes me very wary of EnumItemsInRectBJ but I do not know if there is such a thing as an item group to set it to so I can clean up the potential leak. 1) do item groups exist? 2) how do I use them to avoid a leak with this function?
  8. afisakov

    Does this leak?

    local real y= GetLocationY(GetSpellTargetLoc()) jasschecker seemed to flag it, but I thought getting the x or y coordinate of something did not leak? asking here to make sure
  9. afisakov

    Detect singleplayer

    Does anyone here know of a reliable way to detect singleplayer, but NOT a Lan player playing alone. I am working on an rpg and want to allow people to be able to play alone (solo lan), but not have access to the cheats in singleplayer (whosyourdaddy etc.).
  10. afisakov

    custom texttag, does this leak?

    I tried my best to write this efficiently, but wanted to know 1) does it leak somewhere 2) is there a way to make it more efficient function cconvert takes real percentage returns integer local integer result = R2I(percentage * 2.55) if (result < 0) then set result = 0 elseif (result > 255)...
  11. afisakov

    is there any advantage to keeping preloaded units?

    Ok, I know some maps tend to pre-load their heroes/units during map initialization by spawning them for neutral, to avoid lag when these units first show up later in game. but is there any advantage to keeping these units around? or can I just remove them right after spawning? Thanks
  12. afisakov

    quick memory leak question

    I know most points like GetUnitLoc tend to leak, but does point offset as well? for example testtrigger Actions Set TempPoint = (Position of (Triggering unit)) Unit - Create 1 Footman (2) for Player 1 (Red) at (TempPoint offset by (0.00, 100.00)) facing Default building...
  13. afisakov

    tooltip calculations?

    Is it possible to do any sort of automatic calculations in the tooltip field? I know you can fill in data values of the for <A001,DataA1> and you can multiply the value by 100 using <A001,DataA1,%> % to make ratios look like percents. |n skips to next line Can math be done in this field, like...
  14. afisakov

    questions about string leaks

    I remember reading in the past that strings kind of leak. That they all get stored in a table that cannot be readily cleared. Trying to get some more information on the issue. 1) Would a line like call DisplayTextToPlayer(udg_player[i],0,0,"You recieved |cffffcc00"+I2S(goldpay)+"|r interest...
  15. afisakov

    how to check gold cost

    How do I check the gold cost of a unit in a trigger? I am already using point value for something else so I can't emulate it that way. Is there a way to directly check the "gold cost" for triggering unit, or do I need to devise a workaround? Thanks in advance for the help.
  16. afisakov

    move part of ability not working, unsure why

    I am working on adding an AOE hex to a tower-defense map. I based it off a triggered-hex another unit has in-game. So far I got the hex to work but cannot force the unit to resume moving again afterwards. main ability: I tried to use the displaytexttoplayersall function to troubleshoot, but...
  17. afisakov

    Does this leak? (Jass damage trigger)

    My tower defense map starts encountering serious lag toward end of game, and I cannot tell f from memory leaks or just because of shear # of towers. This does not happen on easy mode so I doubt it is from enemy spawn or pathing triggers. This trigger intended to deal damage in 2 areas (full and...
  18. afisakov

    Does this leak?

    would calling unit u cause a leak that needs to be cleaned up? function CD_atk takes unit u returns nothing call GroupAddUnitSimple(u, udg_CoolingDown) call PolledWait(0.3) call GroupRemoveUnitSimple(u, udg_CoolingDown) endfunction ... call CD_atk(GetAttacker()) Tried to only include the...
  19. afisakov

    Can custom function take boolean or code?

    I have a trigger that is getting very repetitive in its steps, trying to make custom function to encompass most of these, to save space and make it easier to tweak. But game does not want to accept way I tried to trigger it. Original trigger function gen_enemy takes nothing returns boolean...
  20. afisakov

    Uncertainty how "return" works

    I am working on a trigger that picks a random unit to train, and I need it to not be the same as the last one trained. the full trigger action function Trig_Random_Actions takes nothing returns nothing local integer Random local integer i = 1 local integer iEnd = 10 local group...
Top