• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Ability / trigger code request - help me :)

Status
Not open for further replies.
Level 9
Joined
Sep 8, 2004
Messages
633
Heya, i'm trying to make an ability which when fired sends out a projectile straight forward from the view of the unit, until the projectile reaches an obstacle and explodes.

To be more specific,

It's an ability, lets call it 'missile'.
When missile is cast, a missile should be sent forth from the unit casting it, in the direction the unit is currently facing.
This projectile is to keep moving forward until it reaches anything it cannot pass, a unit, or a wall.
When reaching a unit, it must (obviously) explode to do damage.

Thanks in advance.
- angelusz
 
Level 9
Joined
Sep 8, 2004
Messages
633
Oh, and another thing, how can i do the following:
You do not have a mousecursor ingame, but a unit is selected, so you can control the unit's abilities, but can't move the mouse around and such.

Something like disable user control for player, but then with a unit selected which you can still control.

help me? :D
 
Level 7
Joined
Apr 25, 2004
Messages
241
This would go under Spells section I believe..

Anyways, this is how it would go... I think...

Base the "Missle" ability off of War Stomp or Thunder Clap and put damage and duration to 0. (This will be your dummy spell)

Make a unit ability called "Missle Projectile" and base it off of Cluster Rockets. Set the number of rockets to 1 and edit it the way you see fit.

Make a dummy caster

Code:
Events -
A unit begins casting/channeling the ability

Conditions -
Spell being casted equal to "Missle"

Events -
~ Create 1 "dummy" at position of casting unit
~ Wait "x" seconds
~ Order "last created unit" to "Missle Projectile" at "region (fix this part up to match where you want the missle to land"
~ Wait "x" seconds
~ Order "last created unit" to "stop"
~ Remove last created unit.

I think thats how it would go. Let me know if it works.[/code]
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Leissak... That WON"T work at all. In order to make that work you will need to have a region and a dummy unit indeed. Make hte unit go to a certain point and also enable a trigger which moves evert 0.01 seconds the region at the position of the unit. If an enemy unit is in that portion it is damaged and the dummy unit is destroyed. Hope it helps you.
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Leissak... That WON"T work at all. In order to make that work you will need to have a region and a dummy unit indeed. Make hte unit go to a certain point and also enable a trigger which moves evert 0.01 seconds the region at the position of the unit. If an enemy unit is in that portion it is damaged and the dummy unit is destroyed. Hope it helps you.
 
Level 6
Joined
Aug 29, 2004
Messages
159
So, you're trying to make a First Person Shooter, eh?

Me too! And i've run in to exactly the same problem u have. Even more, because for one of the shoot abilities, its supposed to home in on its target (friendly or hostile) but if someone gets in the way it hits them aswell..

My advice is to try to base it off the Stampede ability: this will keep going until it hits something and explodes. Might be a bit difficult tho, as i dont think that you can get the first (lizard) to start where u want it to (at the position of the caster)

The other way to do it would be to make triggers which:
a) Creates a Missile unit
b) Moves the missile unit forwards (in the direction the caster is facing)
c) If an enemy comes within range (say 50?) of the missile, deal 50 damage to the other unit and remove the missile. (Maybe Kaboom)
d) If possible, do (c) but with doodads and terrain.

Hope that helps

Bort
 
Level 2
Joined
Jan 15, 2004
Messages
14
This is easy, Stampede is the way it works, first make a dummy unit(with Locust ability, etc.) then make a custom ability based off stampede, change the missile´art to the one you want, to 1 and duration to 0.01, set the area of effect of the spell to 0 or 1 and the explode damage/explode area/explode activation to what you want, just play around with that. Then make the following trigger:
Code:
Trigger
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Your_Ability
    Actions
        Custom script: local unit udg_dummy
        Custom script: local location udg_local_loc
        Set local_loc = (Position of (Triggering unit))
        Unit - Create 1 Dummy_Unit for (Owner of (Triggering unit)) at local_loc facing (Facing of (Triggering unit)) degrees
        Set Dummy = (Last created unit)
        Unit - Order Dummy to Neutral Beastmaster - Stampede (local_loc offset by 1.00 towards (Facing of (Triggering unit)) degrees)
        Wait 0.00 seconds
        Unit - Remove Dummy from the game
        Set Dummy = No unit
        Custom script: call RemoveLoc(udg_local_loc)
        Custom script: set udg_local_loc = null
Dummy_Unit is the unit type of your dummy unit!
Dummy is a unit variable!
Your_Ability is your base ability!
Local_Loc is a point variable!
 
Status
Not open for further replies.
Top