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

Need help creating data-based unit systems

Status
Not open for further replies.
Level 27
Joined
Jul 6, 2008
Messages
11,325
Okay, so the deal is that for my map, Nation Builder ALPHA, I'm going to need few systems. since I'm not exactly very advanced with data and don't want to use trrigers, I may need your help with these two:
1. Zombiefication system. Kinda similar to Empires & Nations one, only I want to make mine Data-based. So I was thinking to do it this way:
all the units have abilities to Morph into zombies, and their actors have events to modelswap when that happens, and there is also a dummy unit owned by neutral-hostile in middle of the map, and so the dummy has a passive aura that gives a control of specific units to hostile trough an aura that effects an entire map. By the way, zombies are unselctable and have timed life.
So I figured how I do this myself, but I just need some questions to be answered:
-Will an "aura" that will pick psionic organic units in an entire map (Max map size) be very inneficient thing to do and impact FPS and I should better concentrate on doing the give-to-hostile thing with trrigers? If yes, I'd be greateful if someone would show me the trriger I could use so it wouldn't cause leaks.
-How can you make weapon's attack trriger the attacked unit to activate some kind of ability it has?
2. Aircraft system. Firstly, I need help with an ability for structure so that the structure would "release" a bomber that would be uncontrolable and would fly to area where the ability targeted and would drop a nuke there, but could be destroyed by enemy on the way, which would lead to no nukes beeing dropped.
Also, how do I make aircraft spin around in circles when not doing anything, or make it return to airbase from which it was released after not recieving any orders? I want to make a more realistic aircraft system, mostly like the one from Rise of Nations. Could you help me figuting out how can I achieve that?
 
Eh. Here we go.
I'm going to let you know ahead of time, data-based is long, tiring, and a massive pain in the ass when dealing with bugs.

The best way to do zombies is make the unit you want, then have one created when a unit is killed. Example being;

Event -> (Any unit) dies
Condition -> (Triggering Unit - [unit type])
Action -> Create 1 (zombie) at (position of [triggering unit])

That eliminates 10 hours of data work dealing with all kinds of crap. If you want to stick an aura type thing, have the trigger only fire when the unit has the behaviour.
If you want the whole map to work that way, you can have a condition that checks unit flags.
However the best way to create a zombie scenario is just to have a trigger fire off when you want the zombies to start being made (example being an event happens.. like a zombie bomb or something). Use integers to verify the event happend. Example:

Event -> Zombie nuke..
Condition ->
Action -> Set (Zombie Integer Variable) = 1

Event -> (Any unit) dies
Condition -> (Triggering Unit - [unit type])
(Abs(Value[zombie integer variable]) = 1
Action -> Create 1 (zombie) at (position of [triggering unit])

As for weapons attacking the attacking unit, very simple trigger.

Event -> (Any Unit) is attacked
Condition ->
Action -> Issue Order to (triggering unit) to (Attack) *targetting unit* (Attacking Unit) *event response*

The aircraft nuke thing is rather simple. Create an aircraft bomber unit that is unselectable, but make sure it is targetable. Create an ability that creates the aircraft bomb on Finish. Have the trigger send the unit in the direction that the ability was used. Create a region in the area that was clicked by the ability. When the (last created unit) reaches the region, create a nuke effect. If the unit dies on the way there (thus the unit never reaches the region) for obvious reasons nothing will happen. You can even get creative and have a trigger that tells everyone when the bomber dies, or have some other action happen.

As for spinning in circles, I'm sure you could do one if you spent a very very long time creating an engine. I can't really think of any cheap efficient ways to do it.. Maybe if you had say a region that the unit is issued to move to, and when he enters it, move it again, rinse wash repeat. I have a similar GUI design for this. I'll attach the map and you can take a look at the triggers. Note that in my map they do not fly in circles or any directed path.. they just fly around the home ship and attack attacking units and also attack nearby hostiles.

As for the return to airbase thing, also very easy. Create a trigger that monitors the energy level of allied units. Use energy as fuel.. or use a custom resource. Either way.. when the energy level reaches say 10.. issue an order to return to base. If the energy level reaches 0, have the unit die. An easy way to make a fuel system is to create a fairly large region, then move it to the unit in question at the start of the map. When the unit leaves the region, subtract 1 energy, then move the region to it again. The effect is the unit will be constantly leaving the region and losing energy. The only problem with that system is if the unit simply hovers, it will not lose energy. There are of course ways around that as well, which I'll go into detail briefly.

Create an integer variable, and set it to 5. Have a seperate trigger subtracting 1 from the integer every second. Everytime the unit leaves the region (described above) set the variable back to 5. If the integer becomes 0 or less, have one energy subtracted. Once it becomes -1, set it back to 5. The effect is either going off at a slower rate if the unit is idol, or a faster rate if it is moving. Or you could just do the cheap thing and set it's energy level to -1, having it losing the same amount of fuel at all times.

Hope this helped. If you need anymore help, PM me. I've got a few maps from awhile back with systems similar to this. They may help.
 

Attachments

  • FleetCraft.SC2Map
    5.5 MB · Views: 345
Last edited:
Level 27
Joined
Jul 6, 2008
Messages
11,325
Actually, I've managed to create the zombie system already, I just fiorgot to mention it.
It, pretty much, contains morph to zombie abilities for all infestable units, zombie's weapon giving an order to use the ability, and a trriger that makes a newborn zombie go hostile.

Well, thanks for your suggestions, but, I'm pretty much opposite to you when it comes to trriger/data dilema, trigerring is pain to me while I'm pretty good with data editor.

I kinda like evolved my nuke bomber idea into nuke silo creating a beacon at target location, which would cancel the nuke drop once destroyed, and then I managed to do this with data editor.
Also, I pretty much scrapped the realistic aircraft idea...

Still, thank you for your suggestions.
 
Status
Not open for further replies.
Top