Ride System... Anyway to do this without creating dummy units?

Lightstalker

New Member
Reaction score
55
I want to make a ride system. Basically, when a unit enters another unit... say a zeppelin or a tank, then the entered unit will be able to move and attack and cast spells, etc. However, when the unit gets out of the tank/etc., then the tank cannot attack, move, or cast spells.

Pausing it doesn't work, as units canot be loaded. The only way I can think of is to create a dummy unit with no attack, no movement, just the load ability, then replace it, but I don't think it iwll work.

Anyway to disable movement and attack? custom script maybe?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
First at Map Init, do this:
Trigger:
  • No Attack
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Temp_Group = (Units of type (Your Transport))
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Custom script: call UnitRemoveAbility(GetEnumUnit(),'Aatk')
          • Custom script: call UnitRemoveAbility(GetEnumUnit(),'Amov')
      • Custom script: call DestroyGroup(udg_Temp_Group)


This will remove the ability to move or attack at map Init :D
And this will make it able to move and attack when it gets loaded:
Trigger:
  • Load
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
    • Actions
      • Custom script: call UnitAddAbility(GetTransportUnit(),'Aatk')
      • Custom script: call UnitAddAbility(GetTransportUnit(),'Amov')
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, then you'll have to detect the order instead.

Like:

JASS:
Unload
    Events
        Unit - A unit Is issued an order with no target
        Unit - A unit Is issued an order targeting a point
        Unit - A unit Is issued an order targeting an object
    Conditions
        (Issued order) Equal to (Order(unload))
    Actions
        Custom script:   call UnitRemoveAbility(GetTriggerUnit(),'Aatk')
        Custom script:   call UnitRemoveAbility(GetTriggerUnit(),'Amov')
 

Lightstalker

New Member
Reaction score
55
This isn't working... this is what I have right now:

Trigger:
  • Ride Sold
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Rides 'R' Us
    • Actions
      • Custom script: call UnitRemoveAbility(GetSoldUnit(),'Aatk')
      • Custom script: call UnitRemoveAbility(GetSoldUnit(),'Amov')


Trigger:
  • Ride Start
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
    • Actions
      • Custom script: call UnitAddAbility(GetTransportUnit(),'Aatk')
      • Custom script: call UnitAddAbility(GetTransportUnit(),'Amov')


Trigger:
  • Ride End
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(unload))
    • Actions
      • Custom script: call UnitRemoveAbility(GetTriggerUnit(),'Aatk')
      • Custom script: call UnitRemoveAbility(GetTriggerUnit(),'Amov')


The problem is that once a unit is loaded, it won't add the move and attack abilities :(
 

squorpion

New Member
Reaction score
12
This isn't working... this is what I have right now:

Trigger:
  • Ride Sold
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Rides 'R' Us
    • Actions
      • Custom script: call UnitRemoveAbility(GetSoldUnit(),'Aatk')
      • Custom script: call UnitRemoveAbility(GetSoldUnit(),'Amov')


Trigger:
  • Ride Start
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
    • Actions
      • Custom script: call UnitAddAbility(GetTransportUnit(),'Aatk')
      • Custom script: call UnitAddAbility(GetTransportUnit(),'Amov')


Trigger:
  • Ride End
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(unload))
    • Actions
      • Custom script: call UnitRemoveAbility(GetTriggerUnit(),'Aatk')
      • Custom script: call UnitRemoveAbility(GetTriggerUnit(),'Amov')


The problem is that once a unit is loaded, it won't add the move and attack abilities :(

you can remove abilities with out useing custom script(works better if you arent familiar with jass)

Trigger:
  • Unit - Remove Darkness from (Picked unit)


Darkness being the ability name.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
The Attack and Move "abilities" aren't in the GUI actions, and therefore you need JASS :D
 

HydraRancher

Truth begins in lies
Reaction score
197
Your above triggers dont work because the actual unload isnt a targetting a point abillity. If you click a unit in the cargo it automatically drops out, what u do is make an abillity like...
Trigger:
  • Test
    • Events
      • A unit is issued an order targeting a point
      • A unit is issued an order targeting an object
      • A unit is issued an order with no target
    • Conditions
    • Actions
      • Game - Display to (All Players) the text (Issued Order) for 2 seconds.

then use the code u receive when u unload a unit
 

Lightstalker

New Member
Reaction score
55
"Ride Start" is the one that does not work.

Trigger:
  • Ride Start
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
    • Actions
      • Custom script: call UnitAddAbility(GetTransportUnit(),'Aatk')
      • Custom script: call UnitAddAbility(GetTransportUnit(),'Amov')
 

Komaqtion

You can change this now in User CP.
Reaction score
469
First, do what HydraRancher said too, and secnd maybe try using an order there too:

Trigger:
  • Load
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(load))
    • Actions
      • Custom script: call UnitAddAbility(GetOrderTargetUnit(),'Aatk')
      • Custom script: call UnitAddAbility(GetOrderTargetUnit(),'Amov')
 

Lightstalker

New Member
Reaction score
55
Why wouldn't this trigger work tho:

Trigger:
  • Ride Start
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
    • Actions
      • Custom script: call UnitAddAbility(GetTransportUnit(),'Aatk')
      • Custom script: call UnitAddAbility(GetTransportUnit(),'Amov')
 

BRUTAL

I'm working
Reaction score
118
once you remove those basic abilities from a unit, i dont think you add them back.
maybe you have like like hide the unit then show it, im not sure
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Well you could set its movement speed to 0 and disable its attack with a trigger
Trigger:
  • Ride Start
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
    • Actions
      • Unit Group - Add Transporting Unit to LoadGroup
      • Unit - Set Transporting Unit Movement speed to 0

Trigger:
  • AntiAttack
    • Events -
      • Unit - A Unit is attacked
    • Conditions -
      • Attacking Unit is in LoadGroup
    • Actions
      • Unit - Order Attacked Unit to Stop
 

Lightstalker

New Member
Reaction score
55
Well you could set its movement speed to 0 and disable its attack with a trigger
Trigger:
  • Ride Start
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
    • Actions
      • Unit Group - Add Transporting Unit to LoadGroup
      • Unit - Set Transporting Unit Movement speed to 0

Trigger:
  • AntiAttack
    • Events -
      • Unit - A Unit is attacked
    • Conditions -
      • Attacking Unit is in LoadGroup
    • Actions
      • Unit - Order Attacked Unit to Stop

Nope. already tried it. If you set its movement speed to 0, it will still be able to move, just really slowly. It's like the spell slow basically.
 

dragonhord

Knowledge is true opinion. - Plato
Reaction score
82
You could always entangling root it with like a 999999 duration, and then remove the buff when a unit is loaded 0.o...
 

dragonhord

Knowledge is true opinion. - Plato
Reaction score
82
Make it an ancient and make these spells not target ancients 0.o? Or something of that nature. I assume it's intended to be powerful so a lot of spells shouldn't target it anyways. Not to mention I believe there are ways to make certain spells unable to be removed, not that I know what they are :p.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top