• 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.

How 2 Prevent Move Orders temporarily?

Status
Not open for further replies.
Level 15
Joined
Nov 30, 2007
Messages
1,202
I have a unit that uses the ability to Ram it's configured to increase movement speed by 11% every 0.07 second x 8. I want to turn off the units move.

Yeye, I know "Make it slide instead" - okey I'll do that if there is no other way.

Adding it to a unit group and just correcting it crashes the game for me. More specifically, when I right-click. ;( Well, atleast I can exit my testmap faster now. ;D

I would pause it, but then it stands still.

Any other options?

  • TEST
    • 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
      • ((Triggering unit) is in UG) Equal to True
    • Actions
      • Unit - Order (Triggering unit) to Move To t_Point
 
Last edited:
Level 15
Joined
Nov 30, 2007
Messages
1,202
Use channel as the base spell and have "Disable Other Abilities" checked. It disables the Order abilities as well. (Move, Stop, Hold, Patrol, Attack)

That is, if I think I'm understanding you correctly.

I don't think you can channel a spell and move at the same time. I want it to move. Just not change direction. I apologize for being unclear.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
Perhaps you should use Knockback 3d to move your character?

I think so too. To bad, it was looking so nice the way it was. Oh well, one can always fall back on one of Bribe many resources. ^^

http://www.hiveworkshop.com/forums/...03180/?prev=search=Knockback%202D&d=list&r=20

On a related topic do I have to use permanent immolation / phenoix fire to detect collision because those spells sadly show up on the command card.

I'm thinking of the Ram just being "Increase to ramming speed" and the knockback being when the ships hit each other. Depending on angle.

I don't get how they made the movement so smooth.

if i create a loop with a wait of 0.01 and move it 10.00 every time it looks retarded. ;>
 
Last edited:
Level 21
Joined
Mar 27, 2012
Messages
3,232
The original trigger crashes because you create an infinite loop(the trigger relaunches itself).

In order to stop move orders I would add "Root" to the unit in a disabled spellbook. This removes the ability to move. Then I would trigger the ramming.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
You can fix the crashing by adding the following actions to your existing trigger:
  • Trigger - Turn off (this trigger)
at the start, and
  • Trigger - Turn on (this trigger)
at the end.

The problem here, as mentioned above, is that when you order the unit to move, it immediately triggers this trigger again, causing it to trigger again, and again.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
The original trigger crashes because you create an infinite loop(the trigger relaunches itself).

In order to stop move orders I would add "Root" to the unit in a disabled spellbook. This removes the ability to move. Then I would trigger the ramming.

How do you mean. It casts root on itself? then I disable the spell book?

Will the root ability disable the movement or just the movement ability, it's a decent pause method though.

Perhaps a spell that you cant cancel that forces it to run toward your target?

You can fix the crashing by adding the following actions to your existing trigger:
  • Trigger - Turn off (this trigger)
at the start, and
  • Trigger - Turn on (this trigger)
at the end.

The problem here, as mentioned above, is that when you order the unit to move, it immediately triggers this trigger again, causing it to trigger again, and again.

BRILLIANT IT WORKS! THANK YOU!!!

The unit "slides forward" in an increasing speed and orders are effectively ignored. I think this also could be used in a ship movement mechanic for turning and slowing down after "stop" - but I'm not even gonna attempt to do that. ^^


Btw, is it better to turn on/off the trigger or remove/add the unit to the unit group?
 
Last edited:
KB3D allows the player much configurability, such as allowing your unit to move around or not while being knocked.

It also allows a target unit and gives you the option to stop the knockback if you hit the target unit. That would work perfectly with the solution to angles I gave you (if it works, lol. If it doesn't, tell me).
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
BRILLIANT IT WORKS! THANK YOU!!!

The unit "slides forward" in an increasing speed and orders are effectively ignored. I think this also could be used in a ship movement mechanic for turning and slowing down after "stop" - but I'm not even gonna attempt to do that. ^^

Btw, is it better to turn on/off the trigger or remove/add the unit to the unit group?

np, np

I can't think of either method having any inherent advantages. I think turning off/on is probably the best, since it doesn't affect anything else and lets you do other things with the unit group, if needed.

PS: Sliding is always more fun ;) You've actually given me a very nice idea, since this linked spell I made could be modified to be a very nice ship movement system.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
np, np

I can't think of either method having any inherent advantages. I think turning off/on is probably the best, since it doesn't affect anything else and lets you do other things with the unit group, if needed.

PS: Sliding is always more fun ;) You've actually given me a very nice idea, since this linked spell I made could be modified to be a very nice ship movement system.

Damn, I was looking for something like that. My ships start at 35 movement speed and have max speed of 140, didn't know what to do about those damned turns.

About a ship moving system you would incorporate your march spell and for turning you would make the unit walk a longer route by forcing it with the method you helped me solve. Would need a way to allows spells to be fired while moving. When a player orders to stop, the ships starts slowing down. If you order to move to X it starts to slow down some distance before or after the destination has been reached.

Ideally I would use your march spell combined with detecting when ships collide. Then ramming occurs naturally by just walking into enemy ships. But that would maybe not be suited for wc3 nor be intuitive for your average BNet strategy map.

I'm just afraid it would start to lagg when you are sliding 60 or more units.

In the map you provided how did you detect if the unit was turning? Perhaps easiest way would be to store previous order and compare it to the new one.

Can't recall if there is a spell that has a attack range between 700-1200, meaning units before and after that are out of range.
 
Last edited:
Level 21
Joined
Mar 27, 2012
Messages
3,232
Root is the ability that night elf ancients have.
If you add it in a disabled spellbook, then it won't show an icon, so the only visible effect is that the unit can't move.

I don't know of any ability that disallows changing orders, but does keep you moving, so you'll just have to trigger the moving part.

For a simple moving system you need:
A periodic trigger than runs every 0.03125 or 0.03 seconds.
The angle between points and polar projection function
Setting unit position.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
The way my system detects turning is by comparing a previous facing angle to a new facing angle.

For a smoother ship-like turning, just set a very low turn rate for units.


I got the ships at a very low turning rate. Something like this:


The red line being the normal movement, and the green line being the wanted movement.

Could queeing up move orders combined with comparing to previous move locationXY do the trick?

For a simple moving system you need:
A periodic trigger than runs every 0.03125 or 0.03 seconds.
The angle between points and polar projection function
Setting unit position.

Ok, but would that be a good idea if 50-150 units would be moving like this?
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Could queeing up move orders combined with comparing to previous move locationXY do the trick?

No, that would be horrid. Hand on a sec, let me whip up a test map for you.

Ok, but would that be a good idea if 50-150 units would be moving like this?

Yes. Using more intensive projectile systems, I've had 300+ units without lag.

EDIT: Test map attached. Code is from my march system, with most of it deleted. Units move about in nice big turning circles. They accelerate and decelerate. Speed values are hardcoded, so you'll probably want to customise those.

EDIT2: Had a look with 160 units all moving at the same time, no noticeable lag. I was zoomed out and did notice an FPS drop, but when I removed health bars FPS was immediately at maximum again.
 

Attachments

  • ShipMovement001.w3x
    26.1 KB · Views: 33
Last edited:
Level 25
Joined
Jul 10, 2006
Messages
3,315
Yeah, the system doesn't do any checking :p

In its previous purpose (the marching aura), this wasn't necessary since the system would only fire while a unit was moving, and the unit's natural movement would take care of collision and pathfinding.

I might just repackage this as a full system, complete with collision and loads of configurables [EDIT: thanks to sleep problems, this might even be tonight]. The movement reminds me very much of the Star Battles map in SC2, which I was quite fond of.

For now, though, you should be able to fix the cliff collision with a simple check at the start of the loop.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
You should consider:

Collisions in different speeds and the impact depending on angles if you move into a enemy ship. (Probably ignore friendly or own impact since they tend to group together.)

A wind that gives bonus speed and attack range Depending if you are riding it or against it. Dunno if it would work globally or if u would create local weather conditions. And/or current which increasing speed in that direction.

The buff could simply be a self aura that changes - it would also be good to give it some effect so players fighting each other could see who has the advantage.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Attached is a quick and dirty fix for cliff collision. No unit collision system yet.

Collisions in different speeds and the impact depending on angles if you move into a enemy ship. (Probably ignore friendly or own impact since they tend to group together.)

All that will be configurable, so that you can set different values for each ship type :)

A wind that gives bonus speed and attack range Depending if you are riding it or against it. Dunno if it would work globally or if u would create local weather conditions. And/or current which increasing speed in that direction.

Very nice idea! Will be especially useful since I recently learned how to create custom weather effects, so it will be possible to make a visual gust of wind in whatever direction required.

Heck, this is getting me all amped up to make a naval combat map, along with cannons that only shoot out the side of you ship.
 

Attachments

  • ShipMovement002.w3x
    27.9 KB · Views: 23
Level 15
Joined
Nov 30, 2007
Messages
1,202
Booo! No Cannons - Ancient Naval Battles! :D

Also, should they move slower if they are damaged? -5%, -10%, -15% -20%?

Last idea, then I'm out of ammunition. Ships can catch on fire and spread to other ships if the fire is extremely heavy (It should be hard to set a ship ablaze).

Basically some unit has a fire attack. The attack creates a fire. The longer it attacks the stronger the fire gets, or the higher the chanse is that the fire gets out of control and disables the ship. It burns for a while and then if ships are nearby it could spread.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202


The units have a item called: "Crew" and Number of Charges. If a ship is standing still. (its been rammed and disabled temporarily. Another ship can use a ability to board it. It would create crewmen like the screenshot (air units with no movement speed) who would duke it out. If you win, you take over the ship. (But it can't move unless you send over crew (3 at a time). If you don't take it over it dies eventually.

You can board a maximum of 2 ships on 1 target.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
Moving Speed increases chances of missiles to miss, although this would be done using bribes damage system.

Crewman could be recruited at a harbor, you can select some different types.
- Fire Thrower
- Attacker
- Tanker (just a heavier unit to soak up damage to force micro?) idk... perhaps a bad idea.

Different ships can hold different amount of men. Either you make it so they just spawn ontop of eachother and don't care about the visuals, or you make them fight in waves. Or you limit it depending on how many actually fit on the ship.

Or actually perhaps keeping it simple is better. One type.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Could be done more easily by setting an evasion ability level based on speed.

A projectile system would be much more fun, though. Imagine a cannon that fires 20 arrows at the same time :D

EDIT:
Crewman could be recruited at a harbor, you can select some different types.
- Fire Thrower
- Attacker
- Tanker (just a heavier unit to soak up damage to force micro?) idk... perhaps a bad idea.

Archer - gives the ship a phoenix fire based ability that automatically hits enemy attackers
Fire thrower - pheonix fire ability that automatically hits enemy ships
Attacker - as described

I think that having them fight in waves as you suggested would be the best.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
Could be done more easily by setting an evasion ability level based on speed.

A projectile system would be much more fun, though. Imagine a cannon that fires 20 arrows at the same time :D

EDIT:


Archer - gives the ship a phoenix fire based ability that automatically hits enemy attackers
Fire thrower - pheonix fire ability that automatically hits enemy ships
Attacker - as described

I think that having them fight in waves as you suggested would be the best.

The unit idea you gave is brilliant. Basically the ships damage would depend on the crew.
How many archers is loaded into the inventory.
If it has a artillery piece.

And the different types of ship would only change its health, speed and carrying capacity etc.

You would counter ships depending on what its loaded with. So a archer heavy ship would be fresh meat for melee heavy ship (if boarded). The question is, would the inventory be enough of a visual aid to spot and keep track of which ship has what.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Engineer - repairs you ship.
Captain - damage/armour buff to attackers
Navigator - increases sight range, stackable

Pimp my ship indeed :)

You would counter ships depending on what its loaded with. So a archer heavy ship would be fresh meat for melee heavy ship. The question is, would the inventory be enough of a visual aid to spot and keep track of which ship has what.

Custom buff SFX or floating text.
Using floating text, we can use different coloured characters to indicate units.

e.g.
s = soldier/attacker
f = fire thrower
a = archer

These characters would concatenate into one text per ship, so e.g. you'll have a ship with this above its head:

s s s s a a f f

Next, we can hide enemy floating texts by default, and give some ship or items the ability to see enemy compositions.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
I think that having them fight in waves as you suggested would be the best.

That or the units created are stronger depending on how many charges.

I don't think the crew should be a secret. It should be about maneuvering your ships and protecting the weak units with strong attack. Or if it is a secret a unit that gives detection could be added to the crew. (Should give a eye above the ship, don't know the name for "sighters".)

For instance the archer example again, it does significantly more damage while moving around, the same goes for the artillery piece. But once it gets boggled down to boarding they are near useless.

The colored floating text could work: depends on how many unit variations there will be.
 
Last edited:
Level 15
Joined
Nov 30, 2007
Messages
1,202
I'm not sure if using your ship movement, if ramming should be a ability or basically just a passive that informs the player that after a certain speed you can ram. I'm leaning towards an ability that is disabled if you are traveling below ramming speed - what do you think?

Also, on the crew thing I'm not gonna make the units move alongside the ship or above. But one could do that by grouping them to every ship on the map and moving them the same way you move your boat.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
A passive will probably be the simplest, since the ramming will passively be part of the movement system.

Yea, but then a "speed scroll" (ramming speed). I don't think you travel in ramming speed even if collisions will be a part of battle passively? The benefit with a ram ability, is that you lock the target, once cast you can't turn away. (The die is cast so to speak ^^)
 
Last edited:
Level 25
Joined
Jul 10, 2006
Messages
3,315
Redid the base method of the system.

  • New cliff collision - ships accelerate away from the cliff when nearby.
  • Added ship-ship collision. Ships accelerate away from each other when nearby, basically "bumping" into each other. We can add some bump damage here if wanted.
  • Customisable stats per ship type.

Had a quick test with 100 ships bumping into each other and into cliffs, surprisingly no lag. If it ends up lagging when used along with the rest of the triggers in your map, there are things we can do to make it less process intensive.
 

Attachments

  • ShipMovement003.w3x
    33.3 KB · Views: 30
It was really interesting to read this thread, i made a map much like this myself earlier (link), and you usually require a very extensive system to support all these things.

As for wind, i recommend you learn some about linear algebra. The wolfire blog made a great post on this here. What you can do is basically, use cos and sin to get a unit vector out of the ships facing. Then use the dot product of this vector and the wind vector to get a factor between (-1) and 1, which you can use to scale your bonus speed value. Example:

JASS:
x = Cos(facing *bj_DEGTORAD)
y = Sin(facing *bj_DEGTORAD)

wind_x = 1 //wind pointing straight to the right
wind_y = 0 

dot = x*wind_x + y*wind_y //This gives a value between -1 and 1, as long as both vectors have a length of 1 (which is true in our case - otherwise, read the tutorial about normalization).

Now, this is not really code that you can use, just kinda showing you how the math behind it looks. If you want, i can send you some vector and quaternion libraries and teach you how to use them, they could make your life SO much easier. It could also help you solve the issue of unit collision using relative coordinates.
 
Status
Not open for further replies.
Top