How to make fissure block the movement of enemys

I got my fissure totally working, except 1 thing, how can i make it so that enemies can't walk over fissure, is there like a function that exists that i can use?

thank you

«1

Comments

  • Posts: 1,670

    Spawn point_simple_obstruction on a loop of positions:

    local ent = SpawnEntityFromTableSynchronous("point_simple_obstruction", {origin = position})
    

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • edited November 2015 Posts: 184

    fissure is believed to be consisted of a line of invisible dummy units. you need to create the line of dummy units, adjust their hull radius with unit:SetHullRadius, then FindClearSpaceForUnit the real units that might be caught in the middle of the fissure.

    Real fissue doesn't block the gridnav, so if you want to replicate it 100% you can't use the point_simple_obstruction method.

    Treat everyday as if you are a student, not a master. The student learns, grows and sees beauty. The master becomes bitter, resentful, and stagnates.

  • Posts: 329

    ok i understand, but is it necessary that i 100% replicate reall fissuren will it have implications if i dont?

  • Posts: 184

    yes, for example flying units can walk over blocked gridnav, but can not walk over other units.

    Treat everyday as if you are a student, not a master. The student learns, grows and sees beauty. The master becomes bitter, resentful, and stagnates.

  • Posts: 329

    ok i understand, thanks

  • Posts: 329

    ok i made all the dummys, but when i try to use

    dummy_forward_1:SetHullRadius(150)

    it gives me the error

    attempt to index local 'dummy_forward_1' (a nil value)

    any ideas?

  • Posts: 1,670

    your dummy_forward_1 variable is nil, obviously.

    Without the full creation code there's no way anyone can give you an idea of what are you doing wrong

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • Posts: 329

    here is the creating code of that specific dummy :

    local dummy_forward_1 = CreateUnitByName(npc_dummy_unit, (vector_forward * (fissure_radius / 2)), false, nil, nil, caster:GetTeam())

  • edited November 2015 Posts: 1,670

    npc_dummy_unit is missing commas, it takes a string not a variable. So "npc_dummy_unit"

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • Posts: 329

    goddamit, i should look better before i ask questions, thanks again noya

  • edited November 2015 Posts: 858

    @Noya semicolons... ,npc_dota_unit, would be rather bad

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • Posts: 1,670

    @Arhowk :huh:

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • Posts: 329

    ok 1 last thing, how do i remove all those dummys after fissure time is over?

  • Posts: 329

    nvr mind, i found the remoself function

  • Posts: 329

    hmmm i have 1 last weird bug, when i try fissure the first time it finally does exactly what it needs to do, but the second time i use fissure (doesnt matter if i use script reload in between) the dummys refuse to spawn , so the particles appear correctly but the path blocking dummys arent there, any ideas?

  • edited November 2015 Posts: 1,670

    Without the full creation code there's no way anyone can give you an idea of what are you doing wrong

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • Posts: 329

    i thought about this, but because its such a general issue i thought i might be something code-irrelevant, sorry,

    here is the code :

    http://pastebin.com/BKcrJ6vC

    beware! there a lot of dummys and projectiles, this is for every fissure in every direction

  • edited November 2015 Posts: 1,670

    NotLikeThis

    for i=1,7 do
       --dostuff
    end
    

    And again, fissure is not a projectile

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • Posts: 329

    yh i thought about both your suggestions, but i needed to create a dummy every iteration, and i didnt know how to give them each a unique name every iteration, because you cannot use the i of the iteration inside a name.

    and the fissure projectile i thought was necesary because there is no way to make it so that every enemy inside the fissure radius gets stunned except for using a projectile, and then using onprojectilehitunit.

    ik these solutions are ugly , but these were the only ones i could come up with , with my knowledge.

  • add the entities to a table and then iterate over the table when you want to remove them

    local dummyTable = {}

    table.insert(dummyTable, entity)

  • edited November 2015 Posts: 213

    While, as far as I know, you can't use a string to name a variable, you can use one to name the index of a table:

    local storage  = {}
    for i=1,3 do
        storage["dummy_"..i] = "this is variable number: "..i
    end
    

    To take a look at what that did:

    for k,v in pairs(storage) do
        print( k.." "..v )
    end
    

    Which outputs this:

     dummy_1  this is variable number: 1
     dummy_2  this is variable number: 2
     dummy_3  this is variable number: 3
    

    You can also access these from the table like this: local value = storage.dummy_2

  • Posts: 329

    thanks, this will make my code a lot cleaner,

    any ideas about the original question as well?

    namely : that fissure works as it should the first time but not all the times behind that, unless i close the mod and reopen it. its a really weird bug that i can't get my head arund

  • Posts: 213

    The only reason I can think of for that is if it threw an error which stopped it from running on all subsequent uses, but since it's datadriven that shouldn't happen. Best advice I can come up with is to put a print() function after almost every line of lua to see when it stops.

  • Posts: 858

    To further what above said, add a print when the spell fires and post the console log after two casts (one good and one failed)

    MAKE CUSTOM GAMES GREAT AGAIN

    Finished-
    kv checker - https://arhowk.github.io
    panorama video series - https://moddota.com/forums/discussion/2021/inclusive-panorama-tutorial-quest-box

    My pet project This Cursed World/Crestfallen (name pending)
    https://moddota.com/forums/discussion/986/this-cursed-world-rpg#latest

  • Posts: 329

    after using print() i found out that the whole code gets run, its stops nowhere.

    so it must be that some function works but not like its suposed to.

    i also found out that the dummy units do get created, after using print(dummy_name)

    i think there are 2 possibilities

    1) the timer function

    2) the dummy units characteristics

    http://pastebin.com/Wz0kQrjn

  • Posts: 329

    ok i cut out the dummy remove timer function and it still worked the same, no dummy units appear, so that must mean it isnt the removal thats the problem, it has to be a problem in the creation of the dummys, but when i typed in print(dummy_name) earlier it gave me this

    [ VScript ]: table: 0x00284310

    so that local name points to this table, and after the 1th fissure i use removeself() to remove the dummy unit, am i correct in assuming that when i woudl use print(removed_unit) it would give me nul? if so then the above print line means i must have created a new dummy_unit

  • Posts: 329

    hmm i tested this and after removing the dummy_unit with removeself() it still prints exactly the same thing when i use print(dummy_unit_name).

    so that means the problem is likely to be my 2nd batch of dummy units not being created.

    It could also be that my removeself function doesnt work, but because my 1th usage of fissure always deletes the dummy units after the duration ends, that proves it works.

    the console teached me that when i use createunitbyname it apparently creates a table for that unit. But when i use removeself() it deletes the dummy unit, but it doesnt delete the table that the local variable that was assigned to the dummy unit created.

    so in my second batch of dummy units they all get created with the same name, does that mean that the tables get overwritten with the information of the second bacth of dummy units (which is exactly the same as the previous batch, just at a different point in time)

  • Posts: 213

    I haven't messed with datadriven stuff yet, but try changing the modifier name so it's not the same as the ability name (someone correct me there if it's not an issue). Also you really need to start using tables, since it will shrink your code a lot. The smaller your code, the lesser chance of an error sneaking in, and most importantly, the easier it is to debug/view.

  • Posts: 329

    ik ik , will do once it is finished,

  • Posts: 329

    u were spot on vyrus, well not 100%, the problem was that my modifier didnt start with modifier_....

    such a basic thing, that i overlooked it :s

    thanks for your fresh input, i would have probably never found it alone