I was playing around with the data editor when I wanted to take a Command & Conquer look as resource creation and more importantly at how they were created without using any triggers, So I set to work.
What I found was quite satisfying.
I have discovered that with only the data editor it is 100% possible to create a working Ore/Tiberium-like field with a working spawner.
Here's how I did it:
With the map in quest we first have to make a few copies of items that we'll need;
1. A copy of the Mineral Field
And the Mineral Field and Carry Mineral Field Minerals Models
2. A copy of the building you want to use as your spawn "tree." Remember to copy**
3. This step is optional but if you want to copy a unit for harvesting feel free
Now that we have our unit copies feel free to assign them and name them as you wish so they can be placed in editor without being spheres.
Next we'll make the effect that will allow our Ore to spread.
1A. Under the "Effects" tab create a new effect and set the Effect Type to Create Unit. (Remember to name it and suggest an ID for it!!!)
1B. Now under our new effect we need to change how the units are placed, set the Effect - Creation Options to Placement, change Target - Location - Value and Target - Origin - Value to Caster Point.
1C. Set Unit - Spawn Owner - Value to Neutral Player, set Unit - Spawn Range and Unit - Spawn Count to whatever you like, but set Unit- Spawn Unit to the Mineral Copy we created earlier.
Now for the effect that will allow our Ore to grow, this is optional if you don't want to use it
2A. Under the "Effects" tab create a new effect and set the Effect Type to Modify Unit. (Remember to name it and suggest an ID for it!!!)
2B. Change the Effect - Resources to whatever number you wish, this will control how many ore is replenished per tick of our behavior.
With those in place it's time for the Behaviors themselves that will control these effects, we'll start with the Ore creation Behavior first:
1.1 Under the "Behaviors" tab crate a new Behavior and set the Behavior Type to Buff (Remember to name and ID it!!!)
1.2 Set the Effect - Effect - Periodic to the Ore creation effect we made in 1A
1.3 Now set the Stats - Period to the time you'd like between Ore spawns and if it isn't already set Stats - Period Count to -1 to ensure the effect runs constantly
1.4 One last thing, set Stats - Flags to Hidden
Now for the Behavior that will allow our Ore to grow with the effect we made:
2.1 Under the "Behaviors" tab crate a new Behavior and set the Behavior Type to Buff (Remember to name and ID it!!!)
2.2 Set the Effect - Effect - Periodic to the Ore Growing effect we made in 2A
2.3 Now set the Stats - Period to the time you'd like between Ore spawns and if it isn't already set Stats - Period Count to -1 to ensure the effect runs constantly
2.4 You guessed it, set Stats - Flags to Hidden
There now we have our completed Behaviors that, with the effects we made, spawn and grow our ore!
Now lets apply it to our Ore:
A. Find the Minerals Unit copy we made way back at the beginning
B. Set the Behavior - Behaviors - Behavior to the copy of the Mineral Field behavior that we copied way back when and the Ore growth behavior we finished in 2.1-4
Now for our Ore Spawner...
A1. Find the unit you chose to use as your ore spawner
A2. Set the Behavior - Behaviors - Behavior to the Ore creation behavior that we made in 1.1-4
Now place the Ore Spawner down in the Terrain and test the map to see if it's working!
Your Ore should spawn from your Ore spawner every few seconds and accumulate around it!
If you have any questions or feedback on this tutorial feel free to drop a line below or PM me.
From my side only one addition: When you want to change name of new minerals - don't do this via right clicking menu with modify command (Ctrl+M shortcut) - this somehow have tendency* to create new models and in result kills proper animations of mineral field and workers carrying resources... Instead go to table view and manually change name and/or ID under "Unit - Name".
- it happens heavily when you have more types of duplicated not renamed minerals related models
Oh and it is also interesting if you add this spawn field behavior within that mineral field. This gives that feeling of infinite grow and reminds old times when tiberium wasn't limited to spawning point neighborhood :>
Also it can be nice if you edit behavior 'minerals field mineral' and set its amount (statistics tab) to sth around 100 - 200... with this you can pretty easily simulate visual tiberium growth as this amount is used whenever new mineral field is spawned :)
One thing which I noticed is that by default minerals do not spawn on terrain covered with creep... and here by removing flags and or pathing options responsible for collisions we could achieve 2 goals: - no spawn blockade on creep & ability to move over our mineral fields...
It would be also interesting if to these mineral fields add kind of aura which would hurt passing by units and if they die in result of that minerals exposure they would be turned into some kind mutants/zombies ;>
I've done it for my map and i'm using it since the launch and it work good. i've tried to make crystal spawn crystal but the game crash, so i want for a Tree like you did. i've also create a AOE that damage Biological unit and Creature that are immune to the radiation. it's very cool. and it's also walkable