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

Airplanes

Status
Not open for further replies.
Level 4
Joined
Apr 27, 2009
Messages
94
Hello folks

I have a nearly finished altered melee map and its lacking only 1 thing.
An airplaine model is already implemented however I am not quite satisfied with the way it functions.
Currently the airplane is obviously just floating.

What I want to achieve is that the airplane flies around in circles when I am not ordering it to do anything, and otherwise act as normal when I order it to attack for example or to move somewhere.

Would anyone have a clue how to accomplish this.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
What happens if the air-plane is in the middle of one of its "circles" and it is ordered to move some-where? Would it just "snap" to where it is supposed to be and proceed to move where it was ordered?
 
Level 4
Joined
Apr 27, 2009
Messages
94
What happens if the air-plane is in the middle of one of its "circles" and it is ordered to move some-where? Would it just "snap" to where it is supposed to be and proceed to move where it was ordered?

For the sake of keeping it simple I would not find it a major issue, however making a gentle turn toward the direction its headed would of course be a bonus. Either way its fine with me as long as it does actually make those circles.
 
Level 4
Joined
Apr 27, 2009
Messages
94
Okay well what you'd want to do first is devise a plan on how you're going to detect when the airplane is "idle".


Well that is where I get stuck, how can I let the system know that my plane is idle and not en route to a position.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
What you're trying to do is quite complicated, especially in GUI. If you were to use JASS (vJass, to be specific) then I would be able to assist you better, but since I am not much of a GUI user I really don't know what the best way for you to do this would be. I'm sure that someone more savvy with GUI will be able to assist you.
 
Level 4
Joined
Apr 27, 2009
Messages
94
Well to be very direct, if i knew how to get this done I wouldnt have come here in the first place asking that question.

I suppose nobody else would like to share their thoughts on how to deal with this situation?

Frankly I do not care whether its gui or jass, I am a programmer myself but I am not going to spend time on learning the syntax for a scripting language thats only used for wc3.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Well in order to make it MUI you're going to need to use hash-tables, if that's what you mean. You're going to need to associate a few values with each air-plane unit. These values will be used to control the air-plane's movement during the time that it is not being ordered anywhere. Basically what I meant before is that I am not really interested in explaining the step-by-step process in GUI because it is over complicated and boring; if all you need is for me to verbally walk you through the process then I can help.

I regret what I said before; you probably wouldn't need to calculate the distance that each air-plane has moved instead you could quite easily check to see whether or not the air-plane's current order is "stop" - this would indicate that the air-plane is being told to not move (and this order is also issued once a unit reaches it's designated path.

I am not going to spend time on learning the syntax for a scripting language thats only used for wc3.

The syntax for JASS is incredibly basic, and if you really are a programmer I do not understand how it could cost an access amount of time. Due to JNGP converting from GUI to JASS is also incredibly easy, because your function names are accessible in a large list (something that old school JASS did not even have).
 
Level 4
Joined
Apr 27, 2009
Messages
94
Well in order to make it MUI you're going to need to use hash-tables, if that's what you mean. You're going to need to associate a few values with each air-plane unit. These values will be used to control the air-plane's movement during the time that it is not being ordered anywhere. Basically what I meant before is that I am not really interested in explaining the step-by-step process in GUI because it is over complicated and boring; if all you need is for me to verbally walk you through the process then I can help.

I regret what I said before; you probably wouldn't need to calculate the distance that each air-plane has moved instead you could quite easily check to see whether or not the air-plane's current order is "stop" - this would indicate that the air-plane is being told to not move (and this order is also issued once a unit reaches it's designated path.



The syntax for JASS is incredibly basic, and if you really are a programmer I do not understand how it could cost an access amount of time. Due to JNGP converting from GUI to JASS is also incredibly easy, because your function names are accessible in a large list (something that old school JASS did not even have).
That makes the whole situation easier, in fact I think I know how to accomplish this then, cheers.
 
Level 4
Joined
Apr 27, 2009
Messages
94
Ok so everything is initialised i just need to make it actually fly circles.

What i got so far.

Time - every 0.5 seconds of game time.

Unit group - Pick every unit in airmovement and do actions

Unit - order picked unit to move to (position of picked unit - offset by 256 towards 90 degrees)
wait 0.3 seconds
Unit - order picked unit to move to (position of picked unit - offset by 256 towards 180 degrees)

However, this way only the first command is carried out, so how can I get this done?
 

Deleted member 177737

D

Deleted member 177737

Simplest answer your gonna get...
Animate the airplane so it's stand animation is going in circles xP
 
Level 4
Joined
Apr 27, 2009
Messages
94
Simplest answer your gonna get...
Animate the airplane so it's stand animation is going in circles xP

I dont want to mess with the model unless i really have to, that is partially because the only 3d software I have is cinema 4d and c4d cant export to wc3 compatitable files.
So unless anyone else has the software and will to do that feel free to lend me a hand otherwise Its a nono for now.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Animate the airplane so it's stand animation is going in circles xP

Yea that would definitely be the most simple way of doing it; but this is the Triggers & Scripts section :smile:

So unless anyone else has the software and will to do that feel free to lend me a hand otherwise Its a nono for now.

You could try to do animations in War3 Model Editor by Magos but I think that it is quite a challenge to do in such a basic modeling program.

However, this way only the first command is carried out, so how can I get this done?

You can't put Wait actions inside unit-group enumerations; it just doesn't work. Besides, the Wait action is incredibly inaccurate and for something that requires precise timer intervals it is best to use a timer or a periodic event. This is why I said that hashtables would probably be necessary (though I suppose you could just as easily use an array).

By the way, when you're posting GUI triggers just right-click on the trigger and select Copy as Text - this will give you a text copy of the entire trigger (if you were typing it out before, which it looks like). From there you can paste the copied text into
  • tags.
 
Level 4
Joined
Apr 27, 2009
Messages
94
Yea that would definitely be the most simple way of doing it; but this is the Triggers & Scripts section :smile:



You could try to do animations in War3 Model Editor by Magos but I think that it is quite a challenge to do in such a basic modeling program.



You can't put Wait actions inside unit-group enumerations; it just doesn't work. Besides, the Wait action is incredibly inaccurate and for something that requires precise timer intervals it is best to use a timer or a periodic event. This is why I said that hashtables would probably be necessary (though I suppose you could just as easily use an array).

By the way, when you're posting GUI triggers just right-click on the trigger and select Copy as Text - this will give you a text copy of the entire trigger (if you were typing it out before, which it looks like). From there you can paste the copied text into
  • tags.[/QUOTE]
  • Thanks for the copy pasting tip i never knew it worked that way.
  • if using the wait function is not recommended then how can I order a sequence of movement commands?
 
Level 10
Joined
May 26, 2005
Messages
194
Ordering a sequence of commands is impossible.

Besides that, you need to distinguish whether your airplane was moved by the user or by your own circling-script. You could do this by creating a trigger which fires when a unit gets a command, and check for a variable to be set, like USER_COMMAND == true, then each time your circling trigger runs, you set USER_COMMAND = false, order the commands, and afterwards set it to true again. I think you got the idea.

However, let me ask you some important questions:
- How many airplanes will be on your map?
- Are command sequences required? (Holding shift)

if there are only about 20-40 airplanes, it would be quite easy to move them by hand, but that would cancel command sequences. That would definitely be the nicest-looking way, but by far the most difficult.

Another interesting thing is to set the unit turn-rate to a negative number I think, or a very low one, I am not sure... The effect will be that the unit won't turn around instantly, but move in quite smooth circles. This combined with some circling while being idle could look good, too.

By the way, it is wrong that checking the command for "stop" will tell you whether the unit is moving or not, because it could also be holding position...

Anyways, there is one problem you will always have to face: As soon as the airplane is attacking, you can no longer tell whether it is moving by checking the command, AND if you give it another order it will forget the unit it was attacking before. I think the only way to handle this is to use SetUnitX/Y instead, as it does not cancel the current order. But this needs a fast timer, good coding, and comes with some other annoying problems.

Well, I tried this before and I ended up doing nothing about the movement of idle airplanes:
http://www.hiveworkshop.com/forums/maps-564/supcom-icy-oasis-v21-94985/
And things like this will get a bit laggy with more airplanes :p :
http://www.hiveworkshop.com/forums/maps-564/flightsim-1-5-a-150036/

You better forget about it and stick to helicopters. ;)

And by the way, if you set your movement speed to a very low number and simply move the airplane into its facing direction a few units every 0.0x seconds, it could miss some waypoints (at least with a speed higher than 522). I am not sure whether this works for lower speeds, however, you will definitely need to monitor the ordered commands with target locations/units and so on, because otherwise a airplane being "stopped" will just run straight forward, you would need to make it return to its original position ("target position" of "stop") as soon as it leaves a certain range of that point. Same for "hold position", but luckily not for "attack", as the unit will check the range on its own and return as soon as its out of range.
Man, this sounds like it would work, maybe I should give it a try in my SupCom map (on which I am not working for like 10 months now). Probably too much airplanes in the sky though.
 
Status
Not open for further replies.
Top