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

Undead Summoning training method 1.2

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: [DELTA]
To start with, this is my first spell.

Looking at how the undead have what is essentially an identical training method to the other races; I decided to create one that better suits them. This spell selects a number of nearby corpses and consumes them to create a unit, checking if there are enough resources and nearby corpses available to summon the unit in question (as of now, no sound plays when there is insufficient resources unit in question, however, a message does display.) Furthermore, if the unit responsible for the summoned unit's creation has a waypoint, the new unit will automatically move to the targeted location (note, if the waypoint is targeted towards a unit, such as a hero, this will not cause the new unit to follow them if they move).

This spell has a number of configurables such as the number of resources required, the area from which corpses are gathered, How many units are summoned, and whether the unit should be summoned from the corpse (as is the case with the Ghoul and crypt fiend) or whether it is summoned near the caster (the necromancer). The Meat wagon is trained normally.

Please give me any feedback you can as I would possibly like to use this spell in the future.

To make use of this trigger, do the following:
1. Remove the Initialization folder- you do not need it
2. Export and import the triggers
3. Create Dummy spells with no target and Set the variable AbilityCast(X) as the spell.
To create more Spells using this system:
1. Copy and paste all the actions under a unit in INT Spawn Undead under a new headline.
2. Change all the array index numbers to one that is unused. Make sure the index for the new unit is the same for the whole ability.
3. Change what the new variables equal to how you desire them.
4. once you are done creating new spells, set the Variable Index Count equal to the highest index you are using for this ability
5. Finally in the Spawn undead trigger, add the designations of your spells to the conditions section of the Spawn undead Trigger. Make sure they are a part of the Or multiple conditions





  • Int Spawn Undead
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- For a starting example we'll use the Ghoul --------
      • -------- Most of the comments will be devoted to this unit --------
      • -------- The others will mostly lack them --------
      • -------- Ghoul --------
      • Set AbilityCast[0] = Summon Ghoul
      • Set UndeadSummonUnitType[0] = Ghoul
      • -------- Sets the number of undead spawned by this spell --------
      • Set NumberofUndeadSpawned[0] = 1
      • -------- Resources needed --------
      • Set CorpsesNeeded[0] = 3
      • Set FoodNeeded[0] = 2
      • Set GoldNeeded[0] = 120
      • Set LumberNeeded[0] = 0
      • -------- Use this to ensure the summon is from a corpse --------
      • Set SpawnFromCaster[0] = False
      • -------- This selects the area which corpses are used to summon. It is a Real. --------
      • Set CorpseArea[0] = 650.00
      • -------- This action sets up whether the player pays resources in the Trigger or the spell. --------
      • -------- If this variable is set to true, you will pay using this trigger --------
      • -------- If it is set to false, you will be refunded resources if the spell fails to work --------
      • -------- If you wish to use the spell, Charge Gold and lumber as your base, set to false --------
      • Set PayResourcesInTrigger[0] = True
      • -------- Count index --------
      • -------- Make sure this integer is equal to the highest index used in this trigger --------
      • Set IndexCount = 0



  • Spawn undead
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to AbilityCast[0]
    • Actions
      • Actions
    • -------- This selecs the ability based on the integer it is used --------
    • For each (Integer A) from 0 to IndexCount, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Ability being cast) Equal to AbilityCast[(Integer A)]
          • Then - Actions
            • Set AbilitIndex = (Integer A)
          • Else - Actions
    • Set CasterUnit = (Triggering unit)
    • Set CastingPlayer = (Triggering player)
    • Player Group - Add CastingPlayer to TriggeringPlayergroup
    • -------- Now to check if the Resources Needed are available to the player --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((CastingPlayer Food used) + FoodNeeded[AbilitIndex]) Less than or equal to (CastingPlayer Food max)
      • Then - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or - Any (Conditions) are true
              • Conditions
                • PayResourcesInTrigger[AbilitIndex] Equal to False
                • (CastingPlayer Current gold) Greater than or equal to GoldNeeded[AbilitIndex]
          • Then - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Or - Any (Conditions) are true
                  • Conditions
                    • PayResourcesInTrigger[AbilitIndex] Equal to False
                    • (CastingPlayer Current lumber) Greater than or equal to LumberNeeded[AbilitIndex]
              • Then - Actions
                • -------- Ok... Here is where the real Meat starts. --------
                • -------- First we set the location of where we gather our corpses from --------
                • Set CasterLoc = (Position of CasterUnit)
                • -------- Then we set up which ones we gather from --------
                • -------- THe comparison here selects Dead units --------
                • -------- And makes sure those Dead units are neither heroes nor structures --------
                • Set Sapwnundeadgroup = (Units within CorpseArea[AbilitIndex] of CasterLoc matching ((((Matching unit) is dead) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is A Hero) Equal to False))))
                • -------- After that we check how many corpses we consume --------
                • -------- If there are not enough, we cancel the spell --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Number of units in Sapwnundeadgroup) Greater than or equal to CorpsesNeeded[AbilitIndex]
                  • Then - Actions
                    • -------- Remove Resources --------
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • PayResourcesInTrigger[AbilitIndex] Equal to True
                      • Then - Actions
                        • Player - Set CastingPlayer Current gold to ((CastingPlayer Current gold) - GoldNeeded[AbilitIndex])
                        • Player - Set CastingPlayer Current lumber to ((CastingPlayer Current lumber) - LumberNeeded[AbilitIndex])
                      • Else - Actions
                    • -------- And now we create a new unit group based on how many units we wish to consume --------
                    • Set SpawnUndeadGroupTiny = (Random CorpsesNeeded[AbilitIndex] units from Sapwnundeadgroup)
                    • Set SpwanUndeadCorpseTarget = (Random unit from SpawnUndeadGroupTiny)
                    • Set SpawnUndeadTargetPoint = (Position of SpwanUndeadCorpseTarget)
                    • Set SpwanUndeadCorpseTarget = No unit
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • SpawnFromCaster[AbilitIndex] Equal to True
                      • Then - Actions
                        • Unit - Create NumberofUndeadSpawned[AbilitIndex] UndeadSummonUnitType[AbilitIndex] for CastingPlayer at CasterLoc facing Default building facing degrees
                      • Else - Actions
                        • Unit - Create NumberofUndeadSpawned[AbilitIndex] UndeadSummonUnitType[AbilitIndex] for CastingPlayer at SpawnUndeadTargetPoint facing Default building facing degrees
                    • Custom script: call RemoveLocation(udg_SpawnUndeadTargetPoint)
                    • -------- This stets the rally point up as a location so that the unit may be ordered to go there --------
                    • Set SummonRallyPoint = (Rally-Point of CasterUnit as a point)
                    • Unit - Order (Last created unit) to Move To SummonRallyPoint
                    • Custom script: call RemoveLocation(udg_SummonRallyPoint)
                    • Set CasterUnit = (Triggering unit)
                    • Unit Group - Pick every unit in SpawnUndeadGroupTiny and do (Actions)
                      • Loop - Actions
                        • Set SpawnundeadspecialEffectPoint = (Position of (Picked unit))
                        • -------- Create special effect then instantly destroy it. --------
                        • Special Effect - Create a special effect at SpawnundeadspecialEffectPoint using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdl
                        • Special Effect - Destroy (Last created special effect)
                        • -------- Remove Point --------
                        • Custom script: call RemoveLocation(udg_SpawnundeadspecialEffectPoint)
                        • Unit - Remove (Picked unit) from the game
                    • Custom script: call DestroyGroup(udg_SpawnUndeadGroupTiny)
                  • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • PayResourcesInTrigger[AbilitIndex] Equal to False
                      • Then - Actions
                        • Player - Set CastingPlayer Current gold to ((CastingPlayer Current gold) + GoldNeeded[AbilitIndex])
                        • Player - Set CastingPlayer Current lumber to ((CastingPlayer Current lumber) + LumberNeeded[AbilitIndex])
                      • Else - Actions
                    • Unit - Remove AbilityCast[AbilitIndex] from CasterUnit
                    • Unit - Add AbilityCast[AbilitIndex] to CasterUnit
                    • Game - Display to TriggeringPlayergroup the text: There are not enoug...
                • -------- And now since we don't need this location or group anymore, we remove it to patch up leaks --------
                • Custom script: call DestroyGroup(udg_Sapwnundeadgroup)
                • Custom script: call RemoveLocation(udg_CasterLoc)
              • Else - Actions
                • Unit - Remove AbilityCast[AbilitIndex] from CasterUnit
                • Unit - Add AbilityCast[AbilitIndex] to CasterUnit
                • Game - Display to TriggeringPlayergroup the text: Not Enough Lumber
          • Else - Actions
            • Unit - Remove AbilityCast[AbilitIndex] from CasterUnit
            • Unit - Add AbilityCast[AbilitIndex] to CasterUnit
            • Game - Display to TriggeringPlayergroup the text: Not Enough Gold
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • PayResourcesInTrigger[AbilitIndex] Equal to False
          • Then - Actions
            • Player - Set CastingPlayer Current gold to ((CastingPlayer Current gold) + GoldNeeded[AbilitIndex])
            • Player - Set CastingPlayer Current lumber to ((CastingPlayer Current lumber) + LumberNeeded[AbilitIndex])
          • Else - Actions
        • Unit - Remove AbilityCast[AbilitIndex] from CasterUnit
        • Unit - Add AbilityCast[AbilitIndex] to CasterUnit
        • Game - Display to TriggeringPlayergroup the text: Not Enough Food
    • Set CasterUnit = No unit
    • Player Group - Remove CastingPlayer from TriggeringPlayergroup



Keywords:
Undead, necromancy, corpses, corpse, summon, summoning, Resource cost, training, building, Alternate, Raise Dead, Animate, sadly no sound, multiple sp
Contents

Summon Undead Test (Map)

Reviews
22.10.2015 IcemanBo: Read reply in thread. 21:32, 14th Oct 2015 Bribe: Review
You can forgo the setting up of Gold and Lumber cost in the variables by using the ability Charge Gold and Lumber, found under Neutral Hostile > Units. I'd personally use this instead of channel because it will only fire if you have the appropriate resources, and will show the icons for gold and lumber. The only downside is that is doesn't show food, but I guess that's too bad. Also, try using coloured text for certain words like Corpses and Food in your tooltips. If they stand out the tooltip becomes easier to read.
 
Level 4
Joined
Jun 5, 2012
Messages
54
You can forgo the setting up of Gold and Lumber cost in the variables by using the ability Charge Gold and Lumber, found under Neutral Hostile > Units. I'd personally use this instead of channel because it will only fire if you have the appropriate resources, and will show the icons for gold and lumber. The only downside is that is doesn't show food, but I guess that's too bad. Also, try using coloured text for certain words like Corpses and Food in your tooltips. If they stand out the tooltip becomes easier to read.

Thanks again. I actually didn't know that spell existed. However, I will keep the Gold and lumber variables in the code in case someone desires their use.

EDIT: I've found that Charge Gold and Lumber doesn't work for activating this spell for some reason
 
Last edited:

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
- The event should be when the unit starts the effect of the ability. The event you have is unreliable.
- Two lines in here leak locations. The rally point is one, the other you meant to use your variable but leaked a location instead.
- The trigger currently fires for any ability. It should only fire for that one ability itself. ie. don't do anything with that triggering player group unless it's the correct ability.
- If the ability doesn't work, it shouldn't go on cooldown nor cost mana.
- The ability conparison should be done on an integer loop instead of requiring the user to manually code everything into that loop. The only things the user should have to change should be in the config function
- Your config function should have an allocated indices count.
- Store the owner of triggering unit in a variable
 
This seems more like a system than a spell.

So... this should work like a recyler-training system? Instead of training units
you use corpses around the building to reproduce the unit?
I don't like it that you use spells for it.
If you used default orders of training units you would not use any spells,
but only catch order events and do appropriate reactions.

I think it would be better as advancing system of the default training system,
than a replacement of it. I mean if there are no corpses around it could just train it normaly, not?

At start there are no corpses around - how is it supposed to work?
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
This seems more like a system than a spell.

So... this should work like a recyler-training system? Instead of training units
you use corpses around the building to reproduce the unit?
I don't like it that you use spells for it.
If you used default orders of training units you would not use any spells,
but only catch order events and do appropriate reactions.

I think it would be better as advancing system of the default training system,
than a replacement of it. I mean if there are no corpses around it could just train it normaly, not?

At start there are no corpses around - how is it supposed to work?

Better feed it some acolytes!
 
Level 4
Joined
Jun 5, 2012
Messages
54
This seems more like a system than a spell.

So... this should work like a recyler-training system? Instead of training units
you use corpses around the building to reproduce the unit?
I don't like it that you use spells for it.
If you used default orders of training units you would not use any spells,
but only catch order events and do appropriate reactions.

I think it would be better as advancing system of the default training system,
than a replacement of it. I mean if there are no corpses around it could just train it normaly, not?

At start there are no corpses around - how is it supposed to work?

As to the System thing, You have a point, I really didn't know what to classify it as.

The corpses are supposed to be generated by the graveyards surrounding the crypts, though having a few ready to start with would be good.

As for the rest? I'm sorry, but that was never the intent of the system. While I may not have chosen the right unit to convey it, (a wandering necromancer maybe would be better) the intent of the system is simply to provide an alternate means for the undead to produce units, not supplement the existing one.
 
Level 13
Joined
Jun 20, 2014
Messages
479
It would be nice for abominations as it is composed of multiple corpses. However, if you are gonna make it on one unit why not make it available to all unit. With that this can become a very nice system as mentioned by others. To think of it, it works like sacrificial pit but with more corpse. So brutal!!!
 
In the demo map it completly replaces the actual building.
Now the big limitation for me is that from author's argumentation it's intended not to replace it.
So I need 2 same buildings then? One can recylce coprses, and one can train normaly?
No, sorry.. this seems as a too big specification for me.

I made suggestions in my reply, I think it would be more useful if was not specified too much.
 
Level 4
Joined
Jun 5, 2012
Messages
54
In the demo map it completly replaces the actual building.
Now the big limitation for me is that from author's argumentation it's intended not to replace it.
So I need 2 same buildings then? One can recylce coprses, and one can train normaly?
No, sorry.. this seems as a too big specification for me.

I made suggestions in my reply, I think it would be more useful if was not specified too much.

You can put them both on the same building (You might either need to remove some of the upgrades for room if you want to do it that way or use a spell book). If you want evidence of this, the Meat wagon is trained the normal way. What I am not doing is making it so that it will trigger in response to units being trained which is what I thought you wanted.
 
Last edited:
Top