• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Help - Making Eggs hatch At full mana.

Status
Not open for further replies.
Level 2
Joined
Nov 21, 2010
Messages
22
Hello, yes ive been trying to figure out this question for a while now, with no luck, the current method of hatching eggs, and aging the spiders is currently scrapped, as it cause lag due the large amount of spider that end up in the map at late game, ive tried google and found nothing, so i was wondering if some kind soul will help me finish my current map project.
 
Level 2
Joined
Nov 21, 2010
Messages
22
do you mean "Spawn Spiders" ability?

No i mean like the The egg spawn a "baby" spider once it hits 100 mana, then once the baby spider hits 100 mana it will become a "Young" spider with increases stats and so on. i was trying to do a trigger to do so, however i have not found the correct method as of yet
 
Level 2
Joined
Nov 21, 2010
Messages
22
You can add the units into a unit group. Periodically (once per second) pick all units in the group and check their mana.

Yes but i dont want all of them at the same time changing since late game there can be large masses of eggs or spiders that have max mana, I want them to individually change/grow once they hit max mana(100), so as to less lag abit, or maybe someone can think of a better way to make them age/grow after a certain period of time.
 
Level 2
Joined
Nov 21, 2010
Messages
22
So do you want them to hatch/grow into something when they reach 100 mana or do any other conditions need to be met?

Yes that is what i need, once they reach 100 mana, they need to grow/hatch.
 
Last edited:
Level 14
Joined
Oct 6, 2008
Messages
759
How about making a dummy spell that the AI will cast once it reaches 100 mana? In my experience it works with a negative health regeneration like -0.1 or something and a self healing dummy spell.
When it's cast kill the egg, spawn a spider with 0/100 mana with mana regeneration. When the spider reaches 100 mana a dummy unit casts a buff on it giving it health,damage,armor etc. and seting his mana to 0/100 again. When it reaches it again check if the spider has the previous buff (to avoid giving the same buff again) and give it another buff and so on and so on for as much levels as you want your spider to 'grow'.
Even more interesting would be to give it a random buff from 4-5 instead of a boring grow-like one.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Make a condition if the baby spider ( egg ) is reached a desired mana value then kill the baby spider ( egg ) that has a 100 mana then spawn a younger spider ( egg ) that has a 0 mana with regeneration of mana in 1 mp every second then if the younger spider ( egg ) has reached the 100 mana then kill the younger spider ( egg ) then create a big spider ( already spawned in eggs ) in the position of the died unit - younger spider ( egg )
 
Level 14
Joined
Oct 6, 2008
Messages
759
Make a condition if the baby spider ( egg ) is reached a desired mana value then kill the baby spider ( egg ) that has a 100 mana then spawn a younger spider ( egg ) that has a 0 mana with regeneration of mana in 1 mp every second then if the younger spider ( egg ) has reached the 100 mana then kill the younger spider ( egg ) then create a big spider ( already spawned in eggs ) in the position of the died unit - younger spider ( egg )

That would only spawn new healthy spiders. What if he damaged the first one, that lost health will have to be transfered to the second. And that would not really look like it grows, killing a small spider to spawn a bigger one would look like a chest buster from Aliens on reverse.(sort of) :wink:
Editing the original spider with buffs and skills, or even resizing - recoloring it would be more fitting in my opinion.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
That would only spawn new healthy spiders. What if he damaged the first one, that lost health will have to be transfered to the second. And that would not really look like it grows, killing a small spider to spawn a bigger one would look like a chest buster from Aliens on reverse.(sort of) :wink:
Editing the original spider with buffs and skills, or even resizing - recoloring it would be more fitting in my opinion.

What do you mean by resizing and recoloring??? instant or per seconds ( like 0.03 seconds until reached the desired size and color )
 
Level 14
Joined
Oct 6, 2008
Messages
759
Well that's more like a cosmetic buff that is up to the author of the topic. I personally prefer to resize the unit with small percentage like 10-15% and make it darker with color tinting. The periodic one takes another trigger if meant to be properly made and I am lazy as hell.
 
Level 10
Joined
Jun 6, 2007
Messages
392
Do eggs/spiders always spawn with 0 mana? In that case, you could store them into a queue (array), and periodically check only the first unit's mana. This method only works if units can't gain/lose mana, and they gain mana at the same rate.
 
Level 2
Joined
Nov 21, 2010
Messages
22
What about the Event for the trigger? do i even need one?

Ice Egg Age
Events
Time - Every 20.00 seconds of game time
Conditions
Actions
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units of type Ice Spider Egg) and do (Actions)
Loop - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of (Picked unit)) Not equal to (!=) 0.00
(Mana of (Picked unit)) Equal to (==) 100.00
Then - Actions
Unit - Replace (Picked unit) with a Ice Spider using The new unit's default life and mana
Else - Actions
Do nothing

Example of how i was doing it before.
Also the Spider/eggs do start with 0 mana.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
a unit with less than (and maybe "equal to", not sure atm) 0,46 health is considered dead.

Also, why don't you run the trigger more often if the issue is that you want them to hatch individually? Of course if you check their mana once per 20 seconds, then there is a lot higher chance that many of the will have full mana, than when you check it for example once every 1 seconds.
 
Level 2
Joined
Nov 21, 2010
Messages
22
Ive noticed once eggs start spawning that the game progressivly start lagging more and more as the game goes on, and i know its the egg spawning triggers becasue thats the only new thing that starts running at that point.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Just put them in a Unit Group and check their mana every 1 second or so (0.50 is acceptable too), and if the checked units has reached 100 Mana, kill the egg and create the "Young" Spider at the location, don't forget to remove location leak.

Also, you can just use Replace function.

I don't know how your eggs are spawned, but this should be the base trigger;
  • Eggs Spawn
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Egg
    • Actions
      • Unit Group - Add (Triggering unit) to HatchingEggGroup
      • Trigger - Turn on Hatching Check <gen>
  • Hatching Check
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in HatchingEggGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in HatchingEggGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Mana of (Picked unit)) Greater than or equal to 100.00
                • Then - Actions
                  • Unit - Replace (Picked unit) with a Young Spider using The new unit's max life and mana
                  • Unit Group - Remove (Last replaced unit) from HatchingEggGroup
                • Else - Actions
The Hatching Check is turned off initially.
But if you want "dramatic effect", I'd say kill the eggs and create the Young Spider at the same location.
Because the spider eggs in Warcraft III looks good when killed, as if, they were just spawned.
 
Status
Not open for further replies.
Top