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

[Trigger] Help with Parachute System

Status
Not open for further replies.
Level 4
Joined
Dec 19, 2015
Messages
52
I didn't have any luck searching for a system. All of the threads are either dead ends, old, or the resource is no longer available. I decided to give it a try myself with the triggering and didn't get very far. If anyone could help it'd be very helpful :D

  • SPAWNUNIT Paradrop
    • Events
      • Unit - A unit owned by Player 1 (Red) Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to (==) Paradrop (Neutral Hostile)
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Unit - Create 2 Paratrooper In Air (Storm Crow Form) for (Owner of (Casting unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees
          • Wait 0.75 seconds
          • Unit - Create 2 Paratrooper In Air (Storm Crow Form) for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing (270.0) degrees
          • Wait 0.75 seconds
          • Unit - Create 2 Paratrooper In Air (Storm Crow Form) for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing (270.0) degrees
I want to either edit or add another trigger to turn off the Storm Crow form for the paratroopers as they come out of the plane.

  • Unit - Order (Last created unit) to Night Elf Druid Of The Talon - Night Elf Form
 
Level 4
Joined
Dec 19, 2015
Messages
52
I have next to no experience with triggering and don't know what I am doing to put it bluntly. That should answer all 3.

1) The waits were one of the few things that worked

2) It is going to be a trigger for all players in the actual map and I had events for 1-12 before my most recent edits and turning to hive for help.

3) I noticed I was having some trouble with that but I thought it was because I had them casting the druid of the talon form and it changed the casting unit
 
Level 4
Joined
Dec 19, 2015
Messages
52
Ideally I want the plane that uses the ability to spawn a total of 6 paratroops. Groups of two would be preferred but I was trying one at a time to see if I could get it to work that way. I would like for there to be a short delay between the units that drop.

As soon as the paratrooper unit is created, I want the storm crow ability to trigger sending them back to ground form so they can "land". After all of the paratroops have dropped, I want to remove the plane from the game that dropped the units.

Every player in the game will have this ability and will be able to use paratrooper planes.


Edit: I just played a game of World in Flames and that's pretty much exactly how I want the trigger to work.
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,657
You should understand a little about how triggers work.

Fist of all, you could change the event to a generic unit event, making it work for all players in one event instead of adding it for each player separately.

Once that event fires, this trigger will run.
And if the ability being cast is equal to the paradrop, then the actions will run.
(So far so good.)

Code runs for all clients (all players), so the units are created without problems.
The action "Player Group - Pick every player in (All players) and do (Actions)" is something different.
It loops the code (running it multiple times with (ussually) slightly different input), and changing the (Picked Player) to a player from the player group you chose (in this case "(All players)") so it runs for each of those players.

There is a way to run things "locally" (as in, your computer will run this code, but mine wont).
In that case, lets say, you create a special effect.
Then this special effect is not visible for me because afaik, it is never created.
This is in almost every case a result of GetLocalPlayer() which is unavailable in GUI though so you shouldnt worry too much about it.
In any case, you are not allowed to create certain stuff in a local block (a block of code that possibly doesnt run for all clients), such as units as it creates 2 different states of the game. (Imagine another unit aggro'ing the newly created unit and running towards it... where is that unit running to on my screen?)
In the case of units, but mostly anything (except floating texts and maybe a few more), the game will run out of sync and disconnect the players that have a different game state as the host.

But back to your code.
In theory, your code is fine.
Just place everything outside the loop and remove the loop.

There are two problems with it though.
1, leaks.
Imagine creating objects and putting it in your bag.
What happens if you keep creating objects, but dont remove those objects from your bag?
Simple, your bag becomes heavy and hard to carry with you.
That is the same with this. You create objects (in this case locations that contain data of a point in a 2d world... yes 2d), but you dont remove them.
So every time this ability is cast, you put some locations in your bag, but never remove them.
After a while, your computer will start to run slower and slower and slower until it is unbearable to continue playing.
(Ofcourse, this ability has to be cast over a thousand times, but imagine if all your abilities were like this.)
You can search some stuff about cleaning leaks, but they are not included in GUI, so you require some custom scripts.

2, inaccuracy issues of wait.
Waits are pretty bad as they are inaccurate up to 0.2s in single player and about 2 to 10 seconds in multiplayer (or even higher depending on connection speed).
They are also a pain with variables, as mentioned before that casting unit cannot be (safely) used after a wait.
If you plan on making your map multiplayer, then you should try to change it to a timer.
 
Status
Not open for further replies.
Top