HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Fissure and Endgame Conditions

03-31-2006, 10:24 PM#1
Karawasa
Hey Guys,


First off, could someone please post the code for Fissure from DotA? I am wanting to implement this spell into my map.


Secondly, does the following trigger work? What it is supposed to do, is hand victory to one side if the other side is completly gone.

Trigger:
Player Leaves
Collapse Events
Player - Player 1 (Red) leaves the game
Player - Player 2 (Blue) leaves the game
Player - Player 3 (Teal) leaves the game
Player - Player 4 (Purple) leaves the game
Player - Player 5 (Yellow) leaves the game
Player - Player 6 (Orange) leaves the game
Player - Player 7 (Green) leaves the game
Player - Player 8 (Pink) leaves the game
Player - Player 9 (Gray) leaves the game
Player - Player 10 (Light Blue) leaves the game
Player - Player 11 (Dark Green) leaves the game
Player - Player 12 (Brown) leaves the game
Conditions
Collapse Actions
Game - Display to (All players) for 10.00 seconds the text: (Multi_PlayerColour[(Player number of (Triggering player))] + ((Name of (Triggering player)) + |r|c009B9B00 has left the game.|r))
Collapse Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
Collapse Loop - Actions
Unit - Remove (Picked unit) from the game
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Player 1 (Red) slot status) Equal to Is unused) or ((Player 1 (Red) slot status) Equal to Has left the game)
((Player 2 (Blue) slot status) Equal to Is unused) or ((Player 2 (Blue) slot status) Equal to Has left the game)
((Player 3 (Teal) slot status) Equal to Is unused) or ((Player 3 (Teal) slot status) Equal to Has left the game)
((Player 4 (Purple) slot status) Equal to Is unused) or ((Player 4 (Purple) slot status) Equal to Has left the game)
((Player 5 (Yellow) slot status) Equal to Is unused) or ((Player 5 (Yellow) slot status) Equal to Has left the game)
((Player 6 (Orange) slot status) Equal to Is unused) or ((Player 6 (Orange) slot status) Equal to Has left the game)
((Player 7 (Green) slot status) Equal to Is unused) or ((Player 7 (Green) slot status) Equal to Has left the game)
((Player 8 (Pink) slot status) Equal to Is unused) or ((Player 8 (Pink) slot status) Equal to Has left the game)
Collapse Then - Actions
Collapse Player Group - Pick every player in (All allies of Player 9 (Gray)) and do (Actions)
Collapse Loop - Actions
Game - Victory (Picked player) (Show dialogs, Show scores)
Else - Actions
Wait 2.50 game-time seconds
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Player 9 (Gray) slot status) Equal to Is unused) or ((Player 9 (Gray) slot status) Equal to Has left the game)
((Player 10 (Light Blue) slot status) Equal to Is unused) or ((Player 10 (Light Blue) slot status) Equal to Has left the game)
((Player 11 (Dark Green) slot status) Equal to Is unused) or ((Player 11 (Dark Green) slot status) Equal to Has left the game)
((Player 12 (Brown) slot status) Equal to Is unused) or ((Player 12 (Brown) slot status) Equal to Has left the game)
Collapse Then - Actions
Collapse Player Group - Pick every player in (All allies of Player 1 (Red)) and do (Actions)
Collapse Loop - Actions
Game - Victory (Picked player) (Show dialogs, Show scores)
Else - Actions

Edited by Blade.dk. Reason: Use trigger tags!
03-31-2006, 10:33 PM#2
Jazradel
Looks like it should work, but maybe you have to defeat the other team as well. Or there's a third condition slow status that is pretty much the same thing. Maybe a computer player is stuffing it up?
03-31-2006, 10:35 PM#3
Immoralis
what the hell is fissure from dota, nto everyone plays dota and memorizes all the abilities, i dont even think thats an ability
03-31-2006, 11:48 PM#4
PipeDream
Unless I've mixed up names, I believe this is fissure, from DotA Allstars 6.29b:
Collapse JASS:
function kH takes nothing returns nothing
    local location J9=GetSpellTargetLoc()
    local location ki=GetUnitLoc(GetTriggerUnit())
    local location gF
    local effect fx
    local destructable array kI
    local player FD=GetOwningPlayer(GetTriggerUnit())
    local real kj=AngleBetweenPoints(ki,J9)
    local integer jb=20
    local integer kJ=R2I(1200/jb)
    local integer FH=1
    local integer Fi=jb

    loop
        exitwhen FH>Fi
        set gF=PolarProjectionBJ(ki,FH*kJ,kj)
        set kI[FH]=CreateDestructableLoc('B000',gF,GetRandomReal(0,360),.5,GetRandomInt(0,2))
        set fx=AddSpecialEffectLoc("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",gF)
        call RemoveLocation(gF)
        call DestroyEffect(fx)
        set FH=FH+1
    endloop
    call PolledWait(8.)
    set FH=1

    loop
        exitwhen FH>Fi
        call RemoveDestructable(kI[FH])
        set kI[FH] = null
        set FH=FH+1
    endloop
    call RemoveLocation(J9)
    call RemoveLocation(ki)
    set J9 = null
    set ki = null
    set fx = null
    set gF = null
endfunction

I took the liberty of fixing a few minor memory leaks.
The damage and stun must be dealt by an impale.
I recommend replacing polledwait with a timer expiration and some game cache to have a precise duration. Post if you want that.
03-31-2006, 11:58 PM#5
shadow1500
reformatted PipeDream's script so its easier to understand, guessed the names for the variables kinda, came out good though.
Collapse JASS:
function Trig_Fissure_Actions takes nothing returns nothing
    local location t=GetSpellTargetLoc()
    local location ki=GetUnitLoc(GetTriggerUnit())
    local location nextloc
    local effect fx
    local destructable array dest
    local player p=GetOwningPlayer(GetTriggerUnit())
    local real angle=AngleBetweenPoints(nextloc,t)
    local integer times=20
    local integer dist=R2I(1200/times)
    local integer x=1
    local integer steps=times

    loop
        exitwhen x>steps
        set nextloc=PolarProjectionBJ(nextloc,x*dist,angle)
        set dest[x]=CreateDestructableLoc('B000',nextloc,GetRandomReal(0,360),0.5,GetRandomInt(0,2))
        set fx=AddSpecialEffectLoc("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",nextloc)
        call RemoveLocation(nextloc)
        call DestroyEffect(fx)
        set x=x+1
    endloop
    call PolledWait(8.0)
    set x=1

    loop
        exitwhen x>steps
        call RemoveDestructable(dest[x])
        set x=x+1
    endloop
    call RemoveLocation(t)
    call RemoveLocation(nextloc)
endfunction
04-01-2006, 12:17 AM#6
PipeDream
Your units are a little off. jb/Fi is the number of steps or destructables to make, not a duration. kJ is the distance between each destructable, not a speed
04-01-2006, 12:32 AM#7
shadow1500
okay fixed
04-01-2006, 06:29 AM#8
Karawasa
Thanks guys. I have a question though, I am kind of noob with JASS so I am not seeing where to put in the dummy impale ability rawcode. If its not in there, can you guys edit everything in that I would need?
04-01-2006, 07:15 AM#9
PipeDream
I believe the spell is a normal impale, with the model removed. The trigger's event is that spell being cast. So the damage and stun is part of the normal spell.
04-01-2006, 07:25 AM#10
Karawasa
I understand that, but how exactly do I implement this spell into the map? I don't know how to write it in JASS so that it goes off then that ability is cast. I also don't see how to do this in GUI since the code is in JASS. Can someone post everything I need to copy and paste or tell me how to put this into map?
04-01-2006, 10:30 AM#11
blu_da_noob
Collapse JASS:
function Trig_Fissure_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000' //change this rawcode to that of your impale ability
endfunction

function Trig_Fissure_Actions takes nothing returns nothing
    local location t=GetSpellTargetLoc()
    local location ki=GetUnitLoc(GetTriggerUnit())
    local location nextloc
    local effect fx
    local destructable array dest
    local player p=GetOwningPlayer(GetTriggerUnit())
    local real angle=AngleBetweenPoints(nextloc,t)
    local integer times=20
    local integer dist=R2I(1200/times)
    local integer x=1
    local integer steps=times

    loop
        exitwhen x>steps
        set nextloc=PolarProjectionBJ(nextloc,x*dist,angle)
        set dest[x]=CreateDestructableLoc('B000',nextloc,GetRandomReal(0,360),0.5,GetRandomInt(0,2)) 
        //change the raw code in the line above to that of the destructable you want to create
        set fx=AddSpecialEffectLoc("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",nextloc)
        call RemoveLocation(nextloc)
        call DestroyEffect(fx)
        set x=x+1
    endloop
    call PolledWait(8.0)
    set x=1

    loop
        exitwhen x>steps
        call RemoveDestructable(dest[x])
        set x=x+1
    endloop
    call RemoveLocation(t)
    call RemoveLocation(nextloc)
endfunction

function InitTrig_Fissure takes nothing returns nothing
    set gg_trg_Fissure = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Fissure, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Fissure, Condition( function Trig_Fissure_Conditions ) )
    call TriggerAddAction( gg_trg_Fissure, function Trig_Fissure_Actions )
endfunction

Create a trigger named 'Fissure', convert it to custom text and copy and paste that in. Change the rawcodes where the comments are and it should work.
04-01-2006, 06:20 PM#12
Karawasa
Thanks for the code. I have a few problems with the spell though. I changed the rawcodes and double checked them, and nothing happens when the spell is cast.

Also, what rawcode is the one used by DotA's fissure?
04-01-2006, 06:36 PM#13
blu_da_noob
I don't have the DotA map on hand, so I can't tell you what the rawcode they use is.

As for the spell in your map, I suggest you try debug messages.

Collapse JASS:
call BJDebugMsg("1")

Insert that line into the trigger in various places (including the condition) and change the number between the quotation marks each time. When you cast the spell it should display some of them and not others, telling you where the spell is failing.

You could also try commenting out the following line:
Collapse JASS:
    call TriggerAddCondition( gg_trg_Fissure, Condition( function Trig_Fissure_Conditions ) )
by adding double forward slashes ('//') in front of it. If the spell then works, then your rawcode is the problem.
04-01-2006, 09:11 PM#14
Karawasa
I replaced:
Code:
local location nextloc
with
Code:
local location nextloc = ki
and now the spell does something when cast.

However, when I cast it, it creates the special effects and the fissures in random places. Essentially, lets say I cast it in front of me, it sometimes create part of the fissure in front of me, and the rest somewhere else leading toward center of map. Its really weird lol.
04-01-2006, 09:42 PM#15
blu_da_noob
Eh, I missed that one :P This one should work correctly:

Collapse JASS:
function Trig_Fissure_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000' //change this rawcode to that of your impale ability
endfunction

function Trig_Fissure_Actions takes nothing returns nothing
    local location t=GetSpellTargetLoc()
    local location ki=GetUnitLoc(GetTriggerUnit())
    local location nextloc
    local effect fx
    local destructable array dest
    local player p=GetOwningPlayer(GetTriggerUnit())
    local real angle=AngleBetweenPoints(nextloc,t)
    local integer times=20
    local integer dist=R2I(1200/times)
    local integer x=1
    local integer steps=times

    loop
        exitwhen x>steps
        set nextloc=PolarProjectionBJ(ki,x*dist,angle)
        set dest[x]=CreateDestructableLoc('B000',nextloc,GetRandomReal(0,360),0.5,GetRandomInt(0,2)) 
        //change the raw code in the line above to that of the destructable you want to create
        set fx=AddSpecialEffectLoc("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",nextloc)
        call RemoveLocation(ki)
        set ki = nextloc
        call DestroyEffect(fx)
        set x=x+1
    endloop
    call RemoveLocation(ki)
    call PolledWait(8.0)
    set x=1

    loop
        exitwhen x>steps
        call RemoveDestructable(dest[x])
        set x=x+1
    endloop
    call RemoveLocation(t)
    call RemoveLocation(nextloc)
endfunction

function InitTrig_Fissure takes nothing returns nothing
    set gg_trg_Fissure = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Fissure, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Fissure, Condition( function Trig_Fissure_Conditions ) )
    call TriggerAddAction( gg_trg_Fissure, function Trig_Fissure_Actions )
endfunction