• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Flying system like in WoW

Status
Not open for further replies.
Level 13
Joined
Feb 18, 2009
Messages
1,381
Hi, im Etzer, someone may have seen me before, some may not.
I am working on a WoW map (I KNOW PEOPLE HATE THEM BUT LETS SEE OK??) and i have encountered a problem : I can't create the flying system, so they can fly from somewhere to somewhere else on like a minute... The alternate is to teleport... That just ain't "WoW'ish".... Hope you understand, and is able to help..
 
You need a flying unit to "mount" on, so you'd create either your unit as a special effect on the "mounts" (although these transporters aren't mounts) back, or you get a custom model so it looks realistic (one model for each race). Afterwards you need to create some sort of "path" system, to tell your flying mount where to move, like in tower defenses. Then you need manual height correction, and the detection of landing/starting. This would be a lot of work I think, but should be possible.
 
Level 13
Joined
Feb 18, 2009
Messages
1,381
Lol woot, what do you mean?? (Apparently) people hate WoW maps, i didn't now but they do...
 
Level 9
Joined
May 28, 2007
Messages
365
Here is what you do.

Create a unit, with the model you desire. (has to be owned by someone else besides player)
Add a special effect of the model of the hero to that model at point origin.
Then Lock the camera for the player to the unit created.
Hide the hero.
Order the created unit to move to your point.
When the mount enters a region of your point, then move the hero to that point.
Show the hero.
Remove the created unit.

I was interested in this so I made a quick test map for it.

JASS:
scope WowFly initializer Init

private function Action takes nothing returns nothing 
    local unit u = GetTriggerUnit()
    local real dx = PolarProjectionX(GetUnitX(u), 1250, GetUnitFacing(u))
    local real dy = PolarProjectionY(GetUnitY(u), 1250, GetUnitFacing(u))
    local unit mount = CreateUnit(Player(15), 'hgry', GetUnitX(u), GetUnitY(u), 270)
    local effect e = AddSpecialEffectTarget("units\\human\\HeroMountainKing\\HeroMountainKing", mount, "overhead")
    call IssuePointOrder(mount, "move", dx, dy)
    call ShowUnit(u, false)
    call SetPlayerAlliance(Player(15), GetOwningPlayer(u), ALLIANCE_SHARED_VISION, true)
    call SelectUnitForPlayerSingle(mount, GetOwningPlayer(u))
    call SetCameraTargetControllerNoZForPlayer( GetOwningPlayer(u), mount, 0, 0, false )
    // The next line leaks, was done quickly. Fix it. Should also use a timer here instead.
    call TriggerSleepAction( DistanceBetweenPoints(Location(GetUnitX(u),GetUnitY(u)),Location(dx, dy))/GetUnitMoveSpeed(mount) )
    call ShowUnit(u, true)    
    call SetPlayerAlliance(Player(15), GetOwningPlayer(u), ALLIANCE_SHARED_VISION, FALSE)
    call SetUnitPosition(u, dx, dy)
    call DestroyEffect(e)
    call RemoveUnit(mount)   
    call SelectUnitForPlayerSingle(u, GetOwningPlayer(u))
endfunction

private function Conditions takes nothing returns boolean   
    return GetSpellAbilityId() == 'AHtc'
endfunction

private function Init takes nothing returns nothing 
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition(t, Condition(function Conditions))
    call TriggerAddAction(t, function Action)   
endfunction

endscope

How to use: (REQUIRES JNGP) In a blank map, place a Mountain King in the center of the map. Then press Test Map. In the Test Map, learn Thunderclap and cast it.

You'll see the effect you're going for.
 
Last edited:
Status
Not open for further replies.
Top