• 🏆 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!

[Solved] Load on a transport

Status
Not open for further replies.
Level 17
Joined
Mar 21, 2011
Messages
1,597
Hi,
i have neutral transports on my map (Neutral passive). Heroes have a target ability (based on channel) which instantly changes the the owner of the transport to the owner of the hero. right after that, the transport gets the order to load the hero. (it changes back to neutral passive on unload)

Short said, its an ability to enter the transport (because you cannot enter it while it is neutral).

It works perfectly fine, well... actually it doesnt, you can abuse it. If you use your ability on the transport and use Stop or Hold Position in the right time frame (its hard to hit, but still..), you control the transport without the hero inside.

Any idea how to get rid of it?
Thanks
 
Level 17
Joined
Mar 21, 2011
Messages
1,597
i'm using RegisterPlayerUnitEvent/SpellEffectEvent

JASS:
private function OnCast takes nothing returns boolean
        local unit target = GetSpellTargetUnit()
        call SetUnitOwner(target, GetTriggerPlayer(), true)
        call IssueTargetOrder(target, "load", GetTriggerUnit())
        set target = null
        return false
endfunction

....................
..............................


call RegisterSpellEffectEvent('A02A', function OnCast)
 
Last edited:
because you cannot enter it while it is neutral
False. There are two ways to enter neutral units.

1. Use devour cargo and load/unload cargo for your transporter. Change the "targets allowed" for the abilities to allow target units that belong to other players.

Issues: The transporter will move towards a selected unit when you right click on the transporter when you want to climb in. This can be countered by setting the transporter's movement speed to 0 while emty.

2. Use Devour Natural and devour cargo for your transporter. Have your transporter devour a desired target when that target moves to the transporter to be transported (can't say it better, sorry)

As a side note - it might be better practice to use "unload cargo" to exit instead of going passive to unload. The make-unit-passive approach is unreliable If your hero didn't unload successfully and is not visible in the cargo unit, the game will crash when the transporter is killed

This system offers handy features to help you make this possible

I made a tank system and encountered that same problem, but managed to fix it after a few tweaks here and there. I can't remember all the detail but I will make a demo map tomorrow and post it here if needed.
 
Level 11
Joined
May 16, 2016
Messages
730
Hi,
i have neutral transports on my map (Neutral passive). Heroes have a target ability (based on channel) which instantly changes the the owner of the transport to the owner of the hero. right after that, the transport gets the order to load the hero. (it changes back to neutral passive on unload)

Short said, its an ability to enter the transport (because you cannot enter it while it is neutral).

It works perfectly fine, well... actually it doesnt, you can abuse it. If you use your ability on the transport and use Stop or Hold Position in the right time frame (its hard to hit, but still..), you control the transport without the hero inside.

Any idea how to get rid of it?
Thanks
There is a simple template
 

Attachments

  • TRANSPORT.w3x
    16.1 KB · Views: 47
Status
Not open for further replies.
Top