| 07-16-2008, 03:26 AM | #1 |
After seeing the awexomeness that was the Diablo 3 trailer, I felt impassioned into remaking the Witch Doctor's "Zombie Wall" ability for Wc3; it would fit perfectly on one of my custom Troll heroes. However, I am (still) only using GUI. I was just going to go with a modified Serpent Ward that places ~20 of these attacking, non-moving zombies, effectively blocking an area. Yet, that's not a literal "wall". So basically, does anyone know if it's possible to make a wall of units (like, perpendicular to the target point from the casting hero) in GUI? (Or really simple JASS, although I'd prefer to keep my maps clean.) |
| 07-16-2008, 09:35 AM | #3 | |
Quote:
Alexander244, that looks good, except you don't get any zombies at the end points of the wall, I'm not sure if that's intended or not, but to get zombies there you'd need to use x/(n-1) instead of x/(n+1) and move the CreateUnit function two lines up. By the way, there's nothing wrong with using TriggerRegisterAnyUnitEventBJ. There are a few BJs out there that are actually useful. |
| 07-16-2008, 09:44 AM | #4 | ||
Quote:
Quote:
|
| 07-16-2008, 10:33 AM | #5 |
I have a wall spell at TheHelper.net. It does the same you want, you may want to look at it ^^ It's JASS. Maybe you'll need only the creation of the units, the rest you can delete. Link: http://www.thehelper.net/forums/showthread.php?t=85113 |
| 07-16-2008, 06:58 PM | #6 | |
So given the stream of JASS stuff coming from you guys, I take it that doing it in GUI would be immensely ungainly and/or impossible... Curses. Quote:
@azwraith_ftl: Thanks, but since it's not on this site, I can't access it as easily. I'll probably just go with Alex's provided example. Thank you, though. @Alex: So... I copy/paste this into a completely-blank, Custom Text trigger, then run Test Map? Probably not. What do I need to change in the code; where are the parts that say "order code of ability being cast, code of unit being summoned, etc...? |
| 07-16-2008, 07:01 PM | #7 | |
Quote:
|
| 07-16-2008, 07:16 PM | #8 |
Arg! Would it be difficult to make it not require the JNGP? This is exactly what I wanted to avoid with JASS. |
| 07-16-2008, 07:16 PM | #9 |
Yes, you need NewGen, but note that you need to do the fix in the new patch announcement thread. JASS:
globals
private constant integer ABILITY_ID = 'AOsh'
private constant integer UNIT_TYPE_ID = 'hpea'
endglobals
This looks to be the only part you need to change. Change the AOsh to the ability ID of the ability. (Ctrl + D in the Object Editor to show the IDs) Then go to the unit that you want to make (serpent ward or whatever) and replace hpea with that code, which you can see by toggling the ctrl+D. New Gen is just like the normal World Editor but with enhanced Jass features. You can use it just like the normal editor, and you can do GUI in it just like you normally would. |
| 07-16-2008, 07:24 PM | #10 |
Argh (again). So what do I change/remove to make it not require JNGP? |
| 07-16-2008, 07:30 PM | #11 |
What's wrong with JGNP? It adds some other handy functionality to the WE that doesn't hurt development in anyway. |
| 07-16-2008, 07:31 PM | #12 | |
I suggest you amend this section: JASS:call CreateUnit(p, UNIT_TYPE_ID, tx, ty, angle*bj_RADTODEG) JASS:set u = CreateUnit(p, UNIT_TYPE_ID, tx, ty, angle*bj_RADTODEG) call UnitApplyTimedLife(u, 'BTLF', Duration(lvl)) JASS:private constant function Duration takes integer lvl returns real return 30. endfunction Quote:
If you're adament not to use vJass: JASS:constant function ABILITY_ID takes nothing returns integer return 'AOsh' endfunction constant function UNIT_TYPE_ID takes nothing returns integer return 'hpea' endfunction constant function WallLength takes integer lvl returns real return 600.+lvl*100. endfunction constant function NumberOfZombies takes integer lvl returns integer return 5+lvl endfunction constant function Duration takes integer lvl returns real return 30. endfunction //=========================================================================== function Conditions takes nothing returns boolean return GetSpellAbilityId() == ABILITY_ID() endfunction function Actions takes nothing returns nothing local location l = GetSpellTargetLoc() local unit u = GetSpellAbilityUnit() local player p = GetOwningPlayer(u) local integer i = 0 local integer lvl = GetUnitAbilityLevel(u, ABILITY_ID()) local integer n = NumberOfZombies(lvl) local real x = GetUnitX(u) local real y = GetUnitY(u) local real tx = GetLocationX(l) local real ty = GetLocationY(l) local real angle = Atan2(ty-y, tx-x) local real d = WallLength(lvl) set x = Cos(angle+bj_PI/2)*d set y = Sin(angle+bj_PI/2)*d set tx = tx+x/2 set ty = ty+y/2 set x = x/(n-1) set y = y/(n-1) loop exitwhen i >= n set u = CreateUnit(p, UNIT_TYPE_ID(), tx, ty, angle*bj_RADTODEG) call UnitApplyTimedLife(u, 'BTLF', Duration(lvl)) set tx = tx-x set ty = ty-y set i = i + 1 endloop call RemoveLocation(l) set l = null set u = null endfunction //=========================================================================== function InitTrig_XXXXXX takes nothing returns nothing local trigger t = CreateTrigger() local integer i = 0 loop call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, null) set i = i+1 exitwhen i > 15 endloop call TriggerAddCondition(t, Condition(function Conditions)) call TriggerAddAction(t, function Actions) endfunction That should work. Where XXXXX is the name of the trigger block. You'll want to prefix all the functions with something though. |
| 07-16-2008, 07:37 PM | #13 | |
Wow, thanks; I didn't think you'd actually re-write it for me. Heh, now I'd feel amiss if I didn't use a Zombie Wall ability! :P Quote:
Oh, and what do you mean by "trigger block", or "name of the trigger block"? Like, the name of the trigger itself, as if it were GUI (i.e. InitTrig_Wall_of_Zombies)? |
| 07-16-2008, 07:43 PM | #14 | ||
Quote:
Quote:
|
| 07-16-2008, 07:46 PM | #15 |
Wait, if it's JASS NewGen Pack, how it is useful for GUI? |
