HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help me make an ability pliz

05-19-2004, 02:31 PM#1
TheReaper
Hello all.

I want to make an ability that does this:
When the unit uses the ability on some one, the casting unit should die and the unit that is the target must die in about 30-40 seconds, and when he dies from hes body should come out a unit.
Ok first this sounds like the parasite ability, BUT what i need is that, for example: when the ability is used on a viliger, from hes boddy should come out a zombie but when the ability is used on a footman from hes body should come out a ghoul. Well in other words i want to make an "Alien Facehuger" ability, well you know, the lil spider from the Alien movie.
I tried some thing but it just wont work :( im just out of ideas can someone help me PEASE!!!
05-19-2004, 02:46 PM#2
ThyFlame
Ehh, if this is going to have multiplayability you'll need custom script for local variables, but basically


unit casts a spell

spell == x

parasiteTarget = target of ability being cast
kill casting unit
wait 30 seconds
kill parasiteTarget
create X whatever unit at position of parasiteTarget


If more than spell can be used by more than one unit then you will need to make parasiteTarget a local variable.
05-19-2004, 02:52 PM#3
johnfn
ThyFlame: That wont work because, I think, you didnt read his post carefully enough. He wants different units to spawn each time, where you have a constant unit. My code's basically the same, the only difference being where I use different units.

Well, the trigger itself might take a bit of work. You could just post this in the Spell Creation thread. But anyway.

What you need is first a dummy ability that you can cast. Then you need a trigger that activates when the unit casts the spell. Youll need to wait 40 seconds or howeverlong and then kill the unit and replace it with another unit. The other unit will be designated by 2 arrays. The 1st array has the unit type of the dying unit with an array index number, and the other has the unit type of the spawning unit, with the same index number.

Ok. If that made no sense, you can ask what you need clarification on, or (providing you'll give me a rep ;) )(I dunno, I just like rep) I can make the map as a demonstration.
05-19-2004, 03:24 PM#4
Aelita Lyoko
Actually, i think i know how to do it. I have something similar to that in my map, but not skill edited. I think this is the proper trigger:

Event: Generic - A unit begins casting an ability
Condition: Ability being casted equal to (spell name here)
Action: If (All Conditions are True) then do (Then Actions) else, do (Else Actions)
if - Conditions: (Unit-type of (Target unit of ability being cast)) Equal to Footman
Then - Actions
Unit - Kill (triggering unit)
Wait 30.00 seconds
Unit - Kill (Target unit of ability being cast)
Unit - Create 1 Ghoul for (insert desired player here) at (Position of (Target unit of ability being cast)) facing (place degree facing angle here)
Else - Actions
Do nothing

You may have to repeat the If/Then/Else multiple actions action a few time, each time replacing the unit being targeted with the unit you want, etc.

If this help, please give me a reputation point. If not, then you might want to ask someone with a lot more trigger experience than me :-).

Either way, i hope you get done what you want to get done!

EDIT: Sorry, forgot to add the kill triggering unit action :-)
05-19-2004, 03:27 PM#5
TheReaper
Quote:
Originally Posted by johnfn
ThyFlame: That wont work because, I think, you didnt read his post carefully enough. He wants different units to spawn each time, where you have a constant unit. My code's basically the same, the only difference being where I use different units.

Well, the trigger itself might take a bit of work. You could just post this in the Spell Creation thread. But anyway.

What you need is first a dummy ability that you can cast. Then you need a trigger that activates when the unit casts the spell. Youll need to wait 40 seconds or howeverlong and then kill the unit and replace it with another unit. The other unit will be designated by 2 arrays. The 1st array has the unit type of the dying unit with an array index number, and the other has the unit type of the spawning unit, with the same index number.

Ok. If that made no sense, you can ask what you need clarification on, or (providing you'll give me a rep ;) )(I dunno, I just like rep) I can make the map as a demonstration.
Oooook, i didnt quite understood what you sad.
Well (if it will help) if you played Aliens vs Predator 2 it would be easier to understand. To make it more clear, il make it like this:
when the Facehuger(the lil speder) casts the spell on a Predator(a character from the game and the film) wait 30 secinds and create an Predalien Chestbuster(it's the lil worm that come out from the unit, like in the movei "Aliens") and that "chestbuster" has the ability to mutate into the predalien (half predator half alien) BUT when the Facehuger casts the spell on a Marine (you know who is that) there should come out a Drone Chestbuster(a chestbuster that can mutate into an ardenery alien from the movie "aliens" again ;) ) i know how to make thos things that "a unit casts a spell blablabla but i just cant make it so that a spasific unit is a target and a spasific unit will spawn.
05-19-2004, 03:46 PM#6
JJ912
Luckily I have AvP2. Ok now the easiest way I can think of is to make a Parasite ability that summons a unit with no model and dies right away. Also make a trigger like this:
Code:
ChestbursterSpawn
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) has buff Implanted Alien) Equal to True
    Actions
        set ShouldveTorchedHim = Position of (Dying unit)
        If ((Unit-type of (Dying unit)) Equal to Predator) then do (Unit - Create 1 Predalien for (Owner of (SomePresetCaster)) at (ShouldveTorchedHim)) facing Default building facing degrees) else do (If etc. etc.)
        Custom script:   call RemoveLocation( udg_ShouldveTorchedHim )
05-19-2004, 04:16 PM#7
TheReaper
How i see it, you mean that when the infested unit dies create a predalien chesbuster? BUT the problem is that i just don't understand thos scripts ^_^
05-19-2004, 05:43 PM#8
Anitarf
Nothing special, the last script in JJ912's post is there to remove a memory leak, you can skip it if you want, but you can also just copy it, it's not that hard.