• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Unit, clickable and not controlable

Status
Not open for further replies.
Level 4
Joined
Jan 30, 2012
Messages
61
Hello ^^
I have a small problem, its so:

In my map you can call a helicopter which is flying around the battlefield and attacks all enemies but nobody can click on it because i gave the unit Locust...
but it shall be clickable...but then can i control my helicopter and i dont want this...

So if i call a heli, it shall be clickable, and fly around the map, and i shall not be able to control it (Order to move)....

Best Regards
I_Master_I
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
give it to neutral pasive and u can store to variable what player called him, example this
if u have unit indexer then when u call the heli (Heli integer variable array)
Heli[custom value of helicopter]=player who called the heli so player number of triggering player/ or if Heli unit array then just simple set the caster

so when u want check who called the heli u can check from variable
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
ok basically something like this

  • cast ur ability for heli
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to *ur ability*
    • Actions
      • Set p = (Position of (Triggering unit))
      • Unit - Create 1 Flying Machine for Neutral Passive at p facing Default building facing degrees
      • Set HeliOwner[(Custom value of (Last created unit))] = (Triggering unit)
    • Unit Group - Pick every unit in (Units within 600.00 of p matching (((Matching unit) belongs to an enemy of (Owner of HeliOwner[(Custom value of (Last created unit))])) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit - Order (Last created unit) to Attack (Picked unit)
        • Custom script: call RemoveLocation(udg_p)
ok the pick is useless here, just i show how can u control the heli with trigger but players cant control it if he is neutral pasive player and with trigger u can attack the caster enemies in that area

or heli must attack everybody in that range? than u can create to neutral hostile or u can do this too

  • cast ur ability for heli
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Set p = (Position of (Triggering unit))
      • Unit - Create 1 Flying Machine for Neutral Hostile at p facing Default building facing degrees
      • Set HeliOwner[(Custom value of (Last created unit))] = (Triggering unit)
      • Custom script: call RemoveLocation(udg_p)
and stop heli if he want attack the caster and order the heli attack a enemy

  • Stop heli if he want attack ur caster
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Flying Machine
      • (Attacked unit) Equal to HeliOwner[(Custom value of (Attacking unit))]
    • Actions
      • Unit - Order (Attacking unit) to Stop
      • Set p = (Position of (Attacking unit))
      • Unit - Order (Attacking unit) to Attack (Random unit from (Units within 512.00 of p matching (((Matching unit) belongs to an enemy of (Owner of HeliOwner[(Custom value of (Attacked unit))])) Equal to True)))
      • Custom script: call RemoveLocation(udg_p)
 
Level 4
Joined
Jan 30, 2012
Messages
61
He doenst attack... he attacks with his passive skill like Phoenix fire...



And i did a trigger which is making a text
<Name of owner of killing unit> has just killed <Name of owner of dying unit>

So i cant change the owner to neutral passive like you has said...
And the owner shall not be able to give the heli an order (move, hold position etc.) but it shall be clickable (so no locust) for an Ability which is destroying a helicopter...
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
He doenst attack... he attacks with his passive skill like Phoenix fire...



And i did a trigger which is making a text
<Name of owner of killing unit> has just killed <Name of owner of dying unit>

So i cant change the owner to neutral passive like you has said...
And the owner shall not be able to give the heli an order (move, hold position etc.) but it shall be clickable (so no locust) for an Ability which is destroying a helicopter...

this is a message in game?
then why problem is this?

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Killing unit)) Equal to Flying Machine
    • Then - Actions
      • Game - Display to (All players) the text: (((Name of (Owner of Heli[(Custom value of (Killing unit))])) + killed ) + (Name of (Owner of (Dying unit))))
    • Else - Actions
      • Game - Display to (All players) the text: (((Name of (Owner of (Killing unit))) + killed ) + (Name of (Owner of (Dying unit))))
its show the heli summoner unit owner player not heli owner this is why need indexer and unit array like i said above because u allways can detect who was the heli owner/summoner :p
 
Level 4
Joined
Jan 30, 2012
Messages
61
ok i'll try to do the completly trigger now...
but the heli attacks with the skill Phoenix Fire, so if the owner is neutral passive...it attacks nothing...neutral passive is how called "neutral" to all players...but if neutral hostile it attacks everthing...
 
Status
Not open for further replies.
Top