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

[Spell] Creating Carrier like SC1-2 for wc3.

Status
Not open for further replies.
Level 6
Joined
Apr 23, 2011
Messages
182
Hi, i was like two days thinking how to make the Carrier unit from starcraft in wc3.

I know many of you will say that the ability of Crypt Lord is good.... But not. The problem is that with Locust Swarm the swarm units are always there.

I want to be like stracraft where the interceptors get out of the Carrier only when the Carrier is near the enemys.

AND only if is posible make the Interceptors attack like in starcraft ( I mean attack while moving ).

Please tell me what you think and if is posible to make a trigger. Because i cant stand that a game of 1999 has some things other of the same company in 2002 doesnt have.

Thanks for you time.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Lordsent, to make it exactly like starcraft you'll have to trigger everything. It's not that hard but requires some time and testing.

1- You can make the interceptors attack automatically random targets around adding the Phoenix Fire ability, but in Starcraft you can command them, so you basically have to order every interceptor in the group to attack the target of the Carrier, and if there is no specific target, just let them attack anyone automatically. This part is somehow easy.

2- You have to specify several math movement patterns and call them randomly for each interceptor to make them fly away as they do in Starcraft. Another way (a lot easier) would be just ordering the interceptor to move towards the Carrier after attacking. Then hiding it for 1 second, then unhiding and if the carrier has a target, attack that target, else just unhide it and let it attack anyone.

3- You have to periodically check distance between Carrier and Interceptor to prevent them going too far away. If they do, return them to the ship or order them to move to a random point around the ship.

I'll may get into this in the upcoming days. No Promise involved.
 
Level 6
Joined
Apr 23, 2011
Messages
182
Spartipilo thanks for your fast replay. The problem is as you say is easy to make it with trigger.
The problem is that it would only be for one Carrier. And i need it for many many.

I have an idea but maybe it would bug wc3.

1- Set variable for each carrier that enters the game.
2- Check every (3) sec with a MUI trigger if there are enemys near ( lets say 1000 ) of each carrier. If they are then add swan locust ability and activate it. If no enemys then remove tha ability.

Then if they are in battle it looks like if every 3 seconds the interceptor ( all ) go to each carrier and then get out again.

And yes the phoenix fire is okey. ^^

But the problem is i dont know how to make this MUI trigger in a good way:)

Thanks for your time.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
There's no problem. Hash's makes really easy to make things MUI. The "hard" part is this involves too many stuff, and handling about 800 units (asuming you have 100 carriers with 8 interceptors each) may prove to be too heavy. This is, however, doable.
 
Level 6
Joined
Apr 23, 2011
Messages
182
There's no problem. Hash's makes really easy to make things MUI. The "hard" part is this involves too many stuff, and handling about 800 units (asuming you have 100 carriers with 8 interceptors each) may prove to be too heavy. This is, however, doable.

dont know how to trigger that with hashatables.

Can you trigger for me a basic example so i see the basics for the carriers.

Thanks.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
You need a global CarrierGroup and local InterceptorsGroup.

When a carrier enters playable map area you add it to CarrierGroup and you create a local group and store it into it's ID. When the carrier "casts" an interceptor (builds, buys) you add it to the local group stored within the carrier that "casted" the ability.

Another way is indexing the Carriers and Interceptors

Carriers go with 1, 2, 3, 4, 5... but each Carrier reserves 8 array slots for interceptors so

Carrier[1] handles Interceptors[1-8]
Carrier[2] handles Interceptors[9-16]

You can save the index of the carrier on It's ID. So you just pick the carriers in the group, check it's index, then look for the interceptors stored on CarrierID * 8 + 1, 2, 3, 4, 5, 6, 7, 8. The upside of this is avoiding the local group handling which is slower than arrays, but indexing still requires math to check for free indexes and stuff making it heavy too :/

NOTE: In starcraft Carriers doesn't self defend. If you order them to move the interceptors will stop anything and move with the carriers even under attack. They only keep keep attacking when you order the carriers to attack some point while having nearby targets around. Once the main target dies, the interceptors attack randomly.

I'm already working on this, but so far I just have some basic scripts to register carriers and Interceptors. I'm still a bit far from simulating the carriers and interceptors behavior.
 
Last edited:
Level 6
Joined
Apr 23, 2011
Messages
182
Spartipilo interesting way of doing it. But i think my way is better for this reasons.


1 - only one trigger. You just use this:


------Every 1 second-------------
set variable _ carriers : Pick every carrier alive.
If there are enemys in ( lets say 800 ) then do ::
add- ability to picked unit
cast ability. ´´ ´´
And for example add special effect.
If no enemys in 900 then do::
Remove Ability for picked unit.
Remove special effect.
--------------------------------------

you just set the duration of the ability to 3600 and then just config you r ability.

the good thing is that the interceptors will still fight even the carrier is moving if there are enemys near.

The bag thing is that when the carriers see a enemy unit at first they will stop and cast the locust.

Try it and tell me. But i already did and works good.

For building interceptors the only way is to change the lvl of the ability. But it will be for all the carriers.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
That doesn't simulate Sc1 carriers. In Sc1 you can command interceptors, you can kill interceptors, you have to buy the interceptors, they fly following a group of patterns, attack, go back, dissapear, and repeat. Today i'll work on the movement trayectory (which is the "hardest").

Having 1 trigger doesn't makes this better or worse. There are a lot of things to handle if you want this to work efficiently (making the best use of PC and Wc3, process, and memory resources).

I will not test your idea just because you think it's better. If you think is better and so easy, feel free to test it yourself. I'll stick to mine, since this is a common request and i may share it as a usefull resource.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I've spent about 6 hours just to achieve an Eliptic Interceptor Trayectory coming from the Carrier, attacking the target, and back to the carrier. I think I still require 6 more hours to achieve it xD

@Wrathion: is it sarcasm? I don't get it xD
 
Level 6
Joined
Apr 23, 2011
Messages
182
I've spent about 6 hours just to achieve an Eliptic Interceptor Trayectory coming from the Carrier, attacking the target, and back to the carrier. I think I still require 6 more hours to achieve it xD

@Wrathion: is it sarcasm? I don't get it xD

Why attack the target ? You are not using phoenix fire ?

In wc3 is not posible to attack while moving. You will need to create dummy units for each interceptor....

Even do i hope you achieve and share:) Good luck.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Warcraft does allow moving an attacking ;) I'm not using Phoenix Fire because it doesn't allow to focus attacks.

I'm still working on the eliptic trayectory. It's not exactly as Starcraft, but at least simulates some kind of swarm thing if you're attacking several targets. Maybe i'll try later to create other trayectories and use them randomly on each interceptor attack. The "Magic" of all this resides in the swarm effect.

EDIT: I just achieved the eliptic trayectory :) Now i can move on to the attack and hide the interceptor.
 
Last edited:
Level 6
Joined
Apr 23, 2011
Messages
182
Warcraft does allow moving an attacking ;) I'm not using Phoenix Fire because it doesn't allow to focus attacks.

Really? Um how you make that?

And eliptic trayectory i dont know really what it means, but if is that the interceptors turn to the sides i tested and with the locust ability they do.

Anyway forward your progress^^
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
The eliptic trayectory is a "narrow circle", it's like an oval.

Right now

Achieved a random Elipse "Width" Means some interceptors makes bigger curves while moving from source to target.
Achieves Random direction, some goes left->right other goes right->left
Achieved small speed variations that makes some interceptors lightly faster than others.

Al these values vary from target to target. Everytime the interceptor gets a new target, a new direction, speed, and "curve width" is set for that interceptor. (A bit of this is still yet to be done)

I tested with 4 targets and 1 carrier and hundreds of Interceptors and it works really smooth :)
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
No. You cant :D Wait untill it's finished. I got the movement, but I still have to do life check, target check, distance check, refreshing check, and etc... I was handling everything with local timers but it's a lot heavier than having a single group and a single periodic trigger. Now I have to move everything to work that way :p
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Did you notice I was the one answering in that post with those ideas using locust and stuff?

That isn't even close to simulating SC Carriers behavior. That's why I want to make one more similar, which saddly requires tons of stuff to take care of with triggers. Thankfully i'm getting closer and closer each time.
 
Level 6
Joined
Apr 23, 2011
Messages
182
Spartipilo you will also copy from sc1 the issue with the interceptors?

I mean that at least what i remenber is that zergs and protoss could some how attack interceptors and destroy them.


Also if you set up an ability to create interceptors how you show how many of them are in each carrier?? You will flotating text like ( l l l ... ) near the carrier when clicked or other way??

Also an idea is to use the transport vision of the units to show the interceptors but that way is limited to 8.

Anyway looking forward your proyect if i can help or give ideas just say.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Of course, interceptors will be attackable, not order-able though. All the interceptor actions are commanded by the Carrier.

I though about an ability with 9 levels with Icons displaying te number of Interceptors from 0 to 8. The gold cost is triggered. Right now i'm just using a Game Text Display Message, but i was planning to change it. I think i can use "Charge gold and lumber" ability to make it cost money.

In starcraft one just don't know the amount of interceptors the carrier has. You just know you don't have the max amount when it enables you to keep buying.

Sadly I have a busy weekend. There's not much left to do, but what's left is a challenge.

When a carrier orders to attack a unit all the interceptors attack that unit. This is easy.
When the carrier doesn't have an specific target, the interceptors attack a random target. This is a bit harder.
The interceptors remain a bit of time inside the carrier between each attack. This is easy.
The interceptors look to where the're going. This is hard. They're following the trayectory but facing the target (making it look weird when they fly in reverse to the carrier)

EDIT: I ussually work on this untill I reach a road-end. I get stuck with something i just can't solve and I leave it as it's. The matter remains somewhere in my mind and suddenly the solution cames up. Until now I had no idea about what to do... but a minute ago I was taking a bath and *pum*, a solution pops up.

EDIT: Omg this is so amazing. It's starting to become reaally interesting. There are so many things involved... I feel like Rosell Crowe in A Beautifull Mind. So many numbers and symbols in the air xD I managed to handle Interceptors Inside and Outside the Carrier with a Periodic Trigger rather than with local timers :D

EDIT: Managed to successfully make interceptors adquire random targets :D This is so amazing, i feel like a child in christmass getting tons of toys. Sadly I have to go out now, but I'm getting really near to accomplish a Sc1 carrier simulation :p
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
It's getting better with time. You can't imagine how many missfunctions you have untill you use Debug Messages xD It helps a lot to improve stuff. I've done some pretty small improvements, but several of those will surely make significant changes.

I left the script a bit aside to work on unit data (range, missiles, icons, models, size, etc.) Thankfully I didn't had to do some stuff i had planned for this weekend so I had more time to work on this (BTW; My dance academy won the 1st place in a local competition today :yay:)
 

Kyrbi0

Arena Moderator
Level 45
Joined
Jul 29, 2008
Messages
9,504
EDIT: I ussually work on this untill I reach a road-end. I get stuck with something i just can't solve and I leave it as it's. The matter remains somewhere in my mind and suddenly the solution cames up. Until now I had no idea about what to do... but a minute ago I was taking a bath and *pum*, a solution pops up.

EDIT: Omg this is so amazing. It's starting to become reaally interesting. There are so many things involved... I feel like Rosell Crowe in A Beautifull Mind. So many numbers and symbols in the air xD I managed to handle Interceptors Inside and Outside the Carrier with a Periodic Trigger rather than with local timers :D

EDIT: Managed to successfully make interceptors adquire random targets :D This is so amazing, i feel like a child in christmass getting tons of toys. Sadly I have to go out now, but I'm getting really near to accomplish a Sc1 carrier simulation :p
This is so fun to read.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Thanks ;)

I spent some hours this morning to achieve... *ta ta ta taaaannn* *Suspense sound* Interceptors attack with random Trayectory Width, Random Speed, Random Launch Direction (left/Right). They show as moving towards target, once they attack, they turn and move towards the carrier (Facing it). They remain inside for the refreshing time, then launch again towards the same target as long as it's near and alive, else, it looks for new random target, else it remains in the ship. All this works with a single periodic trigger :D

So far the "attack" command is triggered with Esc key, I havent implemented the group behavior based on Carrier commands; and I still have some stuff to improve (the are so much things to handle that making it efficient is a bit hard). There is a lot of garbage i though I would need and I never used so I have to re-look at the code constantly to keep it clean :p

This it lookin great! I Think i'll have this finished up this week!

EDIT: Damn president and whole government. They're restricting electric energy usage in my community. I lost about 30 mins of work because of unwarned lectric energy cut -.-

EDIT: Asthetics (Models, tooltips, icons) are great ;) Script is turning beautifull and really easy to read.

EDIT: I think i'll get this done in less time that I tough. Maybe tomorrow night or Wednesday morning. It's not as fancy as I would like it to be :( But I hope it gets better with time and community reviews and suggestions.
 
Last edited:
Level 16
Joined
Dec 15, 2011
Messages
1,423
Thanks ;)

I spent some hours this morning to achieve... *ta ta ta taaaannn* *Suspense sound* Interceptors attack with random Trayectory Width, Random Speed, Random Launch Direction (left/Right). They show as moving towards target, once they attack, they turn and move towards the carrier (Facing it). They remain inside for the refreshing time, then launch again towards the same target as long as it's near and alive, else, it looks for new random target, else it remains in the ship. All this works with a single periodic trigger :D

So far the "attack" command is triggered with Esc key, I havent implemented the group behavior based on Carrier commands; and I still have some stuff to improve (the are so much things to handle that making it efficient is a bit hard). There is a lot of garbage i though I would need and I never used so I have to re-look at the code constantly to keep it clean :p

This it lookin great! I Think i'll have this finished up this week!

EDIT: Damn president and whole government. They're restricting electric energy usage in my community. I lost about 30 mins of work because of unwarned lectric energy cut -.-

EDIT: Asthetics (Models, tooltips, icons) are great ;) Script is turning beautifull and really easy to read.

EDIT: I think i'll get this done in less time that I tough. Maybe tomorrow night or Wednesday morning. It's not as fancy as I would like it to be :( But I hope it gets better with time and community reviews and suggestions.

Nice work on this :)

Do you intend to publish this as a public resource? I am sure it can yield a high rating =))
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
This is the part where I get frustrated because something is not working properly :ogre_rage:

Every time the interceptor is going to attack it's supposed to check if the target is alive, is visible, and is within range. In any case it looks for a new target, and if that target is null, the interceptor remains inside the carrier... as least it should. Now, for some reason the Interceptors are acquiring targets that are not visible and are not within range.

EDIT: Solved that a bit... however, this sucks -.- I'll have to look the whole system and re-made part of it... One of those damn things that happen when you do things part by part, and each new-part requires you to modify all the previous parts...

I gues target priorities are Carrier Target > Interceptor Target > Random Target...
 
Last edited:
Status
Not open for further replies.
Top