• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

[JASS] AoE banshee

Status
Not open for further replies.
Level 5
Joined
May 23, 2008
Messages
123
Its ment to create a unit for every alive unit in the area and cast banish on them.


JASS:
function Trig_choatic_banish_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A00S' 
endfunction

function Trig_choatic_banish_Actions takes nothing returns nothing
  local unit u = GetTriggerUnit()
  local unit u2
  local location l = GetSpellTargetLoc()
  local group g = CreateGroup()
  local integer i = GetUnitAbilityLevel(u,'A00S')

  set g = GetUnitsInRangeOfLocAll(50+i*50, l)
  loop
    set u = FirstOfGroup(g)
    exitwhen u == null
    if(IsUnitAliveBJ(u) == true) then
      set u2 = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE),'h00F',l,0)
      call IssueTargetOrderBJ( u2, "banish", u )
      call UnitApplyTimedLife(u2,'BTLF', 15)
    endif
    call GroupRemoveUnit(g,u)
  endloop

call RemoveLocation(l)
call DestroyGroup(g)
set u = null
set u2 = null
endfunction

//===========================================================================
function InitTrig_choatic_banish takes nothing returns nothing
    set gg_trg_choatic_banish = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_choatic_banish, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_choatic_banish, Condition( function Trig_choatic_banish_Conditions ) )
    call TriggerAddAction( gg_trg_choatic_banish, function Trig_choatic_banish_Actions )
endfunction

Extra Info: A00S = a modified blizzard spell to show AoE
h00F = my summy unit, all ready has banish (spell costs 0 mana 2 cast)
 
The only thing i can think of is that you have the call GroupRemoveUnit inside the loop ~ Actually, why do you remove it? :S
Wait, you need a second location, where you create the unit to cast banish:
JASS:
set l2 = GetUnitLoc (u) //This goes inside the loop of course
set u2 = CreateUnitAtLoc (Player(PLAYER_NEUTRAL_AGGRESSIVE), 'h00F', l2,0)
//------------------
call RemoveLocation (l2)
 
You are definitely right :) But! If a guy with Jass knowledge comes over and checks the whole script, he will realize if there is any problem. By default, making a thread with a trigger or a script within this forum, it means that you have problems with it. Anyway, i won't discuss something with someone who is a forum's expert, you (community moderator) :)
 
Level 5
Joined
May 23, 2008
Messages
123
ya the trigger does not work, if it worked y would i bother 2 post it? What happens when i cast the spell? nothing that you can see (the units that cast banish have no model so you can see them)

It should not need a new location because the casting rang of banish is 800, and the fatherest a unit from the GetSpellTargetLoc() should be 350.
 
Level 5
Joined
May 23, 2008
Messages
123
Squiggy: I dont see how that would make it work, altho it would be better to add a filter.
That does the same thing as
JASS:
if(IsUnitAliveBJ(u) == true)

But your way looks like it should be harder on the computer.
2 methods called
JASS:
GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) <= 0
and comparing ints

1 method called
JASS:
return IsUnitAliveBJ(u)

pharaoh: calling "GetUnitLoc (u)" 100 times could create lag for the poor people with bad computers on warcraft. So just using location l and not l2 is better. Which there is alot of poor people on warcraft because 20ish dollars = years of intertanment

Even if it alown does not create a lag it could with the addition of other things.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Squiggy: I dont see how that would make it work, altho it would be better to add a filter.
That does the same thing as
JASS:
if(IsUnitAliveBJ(u) == true)

But your way looks like it should be harder on the computer.
2 methods called
JASS:
GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) <= 0
and comparing ints

1 method called
JASS:
return IsUnitAliveBJ(u)

pharaoh: calling "GetUnitLoc (u)" 100 times could create lag for the poor people with bad computers on warcraft. So just using location l and not l2 is better. Which there is alot of poor people on warcraft because 20ish dollars = years of intertanment

Even if it alown does not create a lag it could with the addition of other things.

Cute, you have just refilled the quota of "most retarded posts ever".

As to the thread-starter, it has nothing to do with "most people that open a thread here need help so why are you asking if I need help".
If you are too damn lazy to even write what your problem is, what you've tried to solve it, and what happens, then give me one reason why anyone here should be less lazy and do everything for you.
 
To explain GhostWolf's post...

IsUnitAliveBJ(u) calls IsUnitDeadBJ(u) which calls GetUnitState(u, UNIT_STATE_LIFE) <= 0. Doing it in a filter when you are enumerating is faster than comparing in a loop. GetFilterUnit() is almost the same speed as using a variable, it might even be exactly the same. The extra speed of the filter makes up for any speed loss there anyway.
 
You just quoted the thread starter.

Allow me to explain shocker, there are functions wc3 uses called 'BJ' functions. If you have TESH (JNGP) they will be colored red. 99.999% of the time they are worse than an alternate native. That BJ function spends time calling natives that you could just have easily called yourself, so although the bj function takes less arguments and is written shorter, in reality calling the native directly would be easier on the computer.

The reason why squiggy made it a big deal in the problem, is not because he didn't know if you had a problem (you obviously do), but that he doesn't know what the problem is.

If I posted a 150 line system and said it doesn't work, the obvious next post would be "what doesn't work?"

Hope that helped.

Edit: woops, element of water beat me to it
 
Level 5
Joined
May 23, 2008
Messages
123
ok thanks for the info, any way 2 find out what it calls for future triggers?

Also y the hell would blizzard do this "IsUnitAliveBJ(u) calls IsUnitDeadBJ(u) which calls GetUnitState(u, UNIT_STATE_LIFE) <= 0." Seems completly unreasable.

But back to the main problem, it seems like the dummy units wont cast banish on the target unit.
 
Level 5
Joined
May 23, 2008
Messages
123
ok well i found the problem, it was that the units were spawned for NEUTRAL_AGGRESSIVE. Possable because the units had 2 spells making a glich with the NEUTRAL_AGGRESSIVE AI.

So were do i find the code for BJ?
 
Last edited:
Level 7
Joined
Dec 30, 2008
Messages
72
i did have a similer problem with casting an ability, I don't know what h00F is but if it has a casting time, you need to account for that... preferably set it to a unit without a cast time. Also the ability should cost no mana and have 0 cooldown and infinite range...

If you have done all that already then it's in the code, but those are the "physical" things that could be causing the problem.

-EDIT-
Oops, didn't realise there was a second page XD
 
Status
Not open for further replies.
Top