• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Embark (ship) doesn't work without movement speed value

Level 3
Joined
Sep 2, 2024
Messages
9
Hi,
I would like modify a boat so that it cannot move without a sailor on board.
I reduced "Movement speed - base" to 0.
But when I do this, my unit can't load on board, she stay close to the boat.

I tried to modify embark ability to increase the value of "stats-area effect" and "stats-cast range" but nothing happen.


I don't understand,

thanks in advance
 
As Rheiko mentioned, you'll probably need to resort to triggers.

I've attached a sample map that might help you get started. There are two main aspects:
  1. Tracking how many units are loaded into a ship (you can use GUI Unit Event, but I just included a simpler version based off Uncle's version in this thread)
  2. Preventing movement of the ship when no units are loaded
For #1, you just need to detect the transport event, store a number for the ship, and then detect when a unit is unloaded and decrement that number.

For #2, I put a sample trigger that will detect if a unit is issued "move", "patrol", "attack", or "smart" and cancels that order if the ship has no units inside it.

The one thing to keep in mind is that the "load" order has very specific behavior--normally the boat will first move as far as it can and then the unit will move. That might be why the loading was messing up when you set the boat's movement speed to 0. Technically a player could abuse the ship restriction by doing a "load" towards a unit and then cancelling it. If you want to prevent that, I would probably doing something simple like checking the distance between the two units and allowing the order if they are close enough. You could do this by:
  1. Adding a condition "(Issue order) Equal to (Order(load))" in the "Or - Conditions" for "Prevent Boat Movement"
  2. Then before cancelling the order, you can do an If-Then-Else. If the issue order is equal to "load", then check the distance between the triggering unit and the target unit--and cancel the order if it is above some threshold (e.g. 300 units of distance).

Let me know if you have any questions!
 

Attachments

  • BoatSample.w3m
    22.6 KB · Views: 4
Level 3
Joined
Sep 2, 2024
Messages
9
As Rheiko mentioned, you'll probably need to resort to triggers.

I've attached a sample map that might help you get started. There are two main aspects:
  1. Tracking how many units are loaded into a ship (you can use GUI Unit Event, but I just included a simpler version based off Uncle's version in this thread)
  2. Preventing movement of the ship when no units are loaded
For #1, you just need to detect the transport event, store a number for the ship, and then detect when a unit is unloaded and decrement that number.

For #2, I put a sample trigger that will detect if a unit is issued "move", "patrol", "attack", or "smart" and cancels that order if the ship has no units inside it.

The one thing to keep in mind is that the "load" order has very specific behavior--normally the boat will first move as far as it can and then the unit will move. That might be why the loading was messing up when you set the boat's movement speed to 0. Technically a player could abuse the ship restriction by doing a "load" towards a unit and then cancelling it. If you want to prevent that, I would probably doing something simple like checking the distance between the two units and allowing the order if they are close enough. You could do this by:
  1. Adding a condition "(Issue order) Equal to (Order(load))" in the "Or - Conditions" for "Prevent Boat Movement"
  2. Then before cancelling the order, you can do an If-Then-Else. If the issue order is equal to "load", then check the distance between the triggering unit and the target unit--and cancel the order if it is above some threshold (e.g. 300 units of distance).

Let me know if you have any questions!
Thank's, now i will read all this and try to understand
I'm french and a beginner with editor and i never use variables and script.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Well that's what I mean, he can give it a movespeed once it's loaded but the issue with not loading because of no movement speed shouldn't be an issue if he uses the burrow's load ability?

Since burrow's don't move but have no issue loading.
A Burrow cannot move because it's Movement Type is set to None and it's Speed Base is set to 0. Any unit with these settings cannot move or turn.

You cannot adjust a unit's Movement speed when it has these settings (afaik) and I don't think there's any working method to adjust Movement Type at runtime. But maybe there's some trick that I don't know about.
 
I don't think you're understanding what I'm meaning, I'm saying the Burrow's Load ability works just fine even with the movement set to None and Movement Speed set to 0 so perhaps the issue is the person is using the wrong ability/abilities and if they try the ones the Burrow uses with their ship it might work fine. Whilst some abilities in the WE look almost identical I think there are a few that have different things going on under the hood. I'm just saying it's worth testing.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
I don't think you're understanding what I'm meaning, I'm saying the Burrow's Load ability works just fine even with the movement set to None and Movement Speed set to 0 so perhaps the issue is the person is using the wrong ability/abilities and if they try the ones the Burrow uses with their ship it might work fine. Whilst some abilities in the WE look almost identical I think there are a few that have different things going on under the hood. I'm just saying it's worth testing.
I see what you're saying now.

I tested it and the Burrow's load ability does only order the Peons to move, however, the issue is that the ability only allows you to load one type of unit -> Peons. You can change it to some other type of unit but that's pretty limiting. Anyway, I think Purge's solution is pretty simple and gets the job done. The only edge case I can think of is the "Can Flee" setting on the Ship needs to be turned off.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
What would happen if you gave the burrow a 2nd burrow ability that can load troll headhunters?
It will still have the original burrow ability that can load peons
Well now we're just entering crazy territory. Is he going to create a new ability for all 200 unit types :p

But I don't know what would happen, it likely wouldn't work.
 
Top