• Check out the results of the Techtree Contest #19!
  • 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 void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Need Help with scripting a custom unit

Status
Not open for further replies.

Lt

L

Lt

On my custom unit, i have a ability that switches between 2 formss (i coped the Raven ability from the driud dude and changed models). It is a hero ability and both models are technically 2 heros.

What i wanna do is so i can have seperate skills on each hero, and when they lvl up and choose skil points (in which ever form) the skill sticks and you dont have to rechoose.

I saw this in a modded Enfos map called Everquest Team Survival and the ranger can go between person with bow, and a wolf. however its protected so i cant see the trigger to help me
 
I have a similar problem. I want a spell that switches my unit with another unit (The other unit can be in the corner of the map if its easier). So far all I have is replace but that makes a whole new unit so the skills and spells are reset. Or maybe this is the same problem... :?
 
I had an idea for it last night. Someone created a displacement spell with Jass. If we could someone make the cool down zero and no animations and no casting time, then we could have the trigger

Joe starts channeling an ability (Dummy Abiliy)

Kate use displacement on triggering unit.

This would only work if our JASS scripting friends would help us out.
 
hi!

if u have WinMPQ u may extract the original ROC maps in which Blizzard replaced a hero into another unit and saved the exact spell there were learned--TWICE (human campaign: Arthas => Arthas with Frostmourne and orc campaign: Grom => Chaos Grom)

non of Blizz maps (in ROC at least) are made with JASS and that could maybe ease a few thing for u.

hope ive helped.

GOOD NIGHT!!
 
:idea: I think this might have to do with the Hide unit action because if u hide the unit then whenever u can unhide that unit and put that unit somewhere. I'm not to sure though... :wink:
I want the spell too it adds a big twist to any hero map.
 
:oops: Wow sry about posting again but i totally messed up... i got this to work though
I edited the other posts too after but i didn't think u could edit the posts untill i saw the button... sry

code:
Event:
A unit starts casting an ability
Condition:
Ability= to ....
Actions:
Hide triggering unit
add triggering unit to Group 1
Create one whatever guy u want the hero to morph into
hide last created unit
If number of units in Group 2=0 then add last created unit to Unit Group 2.
wait like .01 seconds
If number of units in Group 2=2 then unit remove last created unit from Group 2.
If number of units in Group 2=2 then remove last created unit from game.
Unhide random unit from Group 2

Next one:

Code:
Event:
A unit begins casting a ability.
Condition:
Ability= to unit changing back
Actions:
hide triggering unit
Selection-select Group 1
Unhide random unit from Group 1
 
i have the same problem, i think it could be solved with the game cache actions, bur i havn't tied it yet
 
ok, i solved it with using game caches, so u haven't to hide the units :
first : create 2 different units (the normal form and the alternate form)
and place them on your map, then create variables: a unit variable
(named unit 1 or sth. like that), a second unit variable (for the alternate form)
and a game-cache variable; then create some triggers :

1. Trigger :
event - map initializing
action - varible: set "firstunitvariable" = "unit placed on your map"
- variable: set "altenateunitvariable" = altenate form
(u have to place the alternate form also on your map)
- game cache: create a game cache from yourmapname.w3v
- variable: set "thegamecachevariable" = last created game cache
- game cache: store "alternateunitvariable" (placed on your map)
as Alternateunit of test in last created game cache
- unit: remove "alternateunitformonyourmap"
- gamecache: save last created game cache

then u have to create two untargeted dummy spells
and a region called "unitchange" or sth. like that (the size isn't importent)

2. Trigger :
event - generic unit event: unit casts an ability
condition - ability comparison: ability being cast equal to "first dummy spell"
action - region: move center of "unitchange" to position of "firstunitvariable"
- store "firstunitvariable" as Firstunit of test in "gamecachevariable"
- remove "firstunitvariable" from the game
- game cache: restore Alternateunit of test for player1 at center of "unitchange"
- set last replaced unit = "alternateunitvariable"
- game cache: save "gamecachevariable"

3. Trigger
event - generic unit event: unit casts an ability
condition - ability comparison: ability being cast equal to "second dummy spell"
action - region: move center of "unitchange" to position of "alternateunitvariable"
- store "alternateunitvariable" as Alternateunit of test in "gamecachevariable"
- remove "alternatetunitvariable" from the game
- game cache: restore Firstunit of test for player1 at center of "unitchange"
- set last replaced unit = "firstunitvariable"
- game cache: save "gamecachevariable"
 
Status
Not open for further replies.
Back
Top