HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need some help with the Object Editor

04-15-2007, 10:32 AM#1
Archean
I made a non-hero unit with the object editor, and my aim is to make it so that only one of those units can be trained throughout the game. It's something where you have a choice over several units to train, but can only pick one for the rest of the game. Sort of like the hero system which only allows you to have three heroes in a game, except I want it to be with a specific unit, and to only have one. But I can't figure out how to do it. Is it even possible? If anyone knows or has an idea I'd really appreciate it.
04-15-2007, 10:52 PM#2
Falitian
I've come up with a few solutions for you.

1. The way you can do this is by using the Units Sold field in the object editor. Go to the object editor, and open up the building you want these unique units to come from. Then scroll down the the "Units Sold" field and put the units you want there. I'm not quite sure how it will be able to sell the units without a hero, I'll try and come up with a system for that later. Anyways, after you've done that, you can go to your unit that is being sold in the Object editor, and limit the stock to 1, and make the restock timer to be either 0 or 99999. I think both will make it not restock, thus allowing only one of that unit to be sold.

The only problem with this is if you have multiple buildings that are built of the same time, each will be able to sell one of these units.
After rereading your post, I don't think that is the kind of system you are looking for, so another way to do is this:


2.
For this system, we';ll be using some simple triggers. All you'll need is this follo0wing trigger, and it should work.
The first will be something similar to the following:
Trigger:
Initialization
Collapse Events
Unit - A unit enters (Entire map)
Collapse Conditions
Player[(Player number of (Owner of (Triggering unit)))] Equal to 0
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Unit-type of (Triggering unit)) Equal to Unit1
(Unit-type of (Triggering unit)) Equal to Unit2
(Unit-type of (Triggering unit)) Equal to Unit3
(Unit-type of (Triggering unit)) Equal to Unit4
(Unit-type of (Triggering unit)) Equal to Unit5
Collapse Actions
Player - Make Unit1 Unavailable for training/construction by (Owner of (Triggering unit))
Player - Make Unit2 Unavailable for training/construction by (Owner of (Triggering unit))
Player - Make Unit3 Unavailable for training/construction by (Owner of (Triggering unit))
Player - Make Unit4 Unavailable for training/construction by (Owner of (Triggering unit))
Player - Make Unit5 Unavailable for training/construction by (Owner of (Triggering unit))
Set Player[(Player number of (Owner of (Triggering unit)))] = 1
04-16-2007, 08:10 AM#3
Archean
All right that should work. I'll test it and tell you. Thanks a lot.