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

Voodoo Puppet Remake v1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Voodoo Puppet

Description:
Channels a puppet in accordance to voodoo, a puppet has a life span and a distance limit of 1000 range, yet can do anything exluding the span and distance limit.

Level 1 - Weak puppet, has a life span of 10 seconds.
Level 2 - Moderate puppet, has a life span of 20 seconds.
Level 3 - Strong puppet, has a life span of 30 seconds.

Cooldown: 10/20/30 seconds


[trigger="Voodoo Puppet INIT"]
Voodoo Puppet INIT
Events
Map initialization
Conditions
Actions
-------- ---------------------- --------
-------- creates a hashtable --------
-------- //this will be used to store variables// for MUI --------
-------- ---------------------- --------
Hashtable - Create a hashtable
Set Vdp_Hashtable = (Last created hashtable)
-------- ---------------------- --------
-------- the types of the puppet --------
-------- ---------------------- --------
Set Vdp_PuppetType[1] = Puppet (Weak)
Set Vdp_PuppetType[2] = Puppet (Moderate)
Set Vdp_PuppetType[3] = Puppet (Strong)
-------- ---------------------- --------
-------- the lifespan of the puppet --------
-------- //these will be arrays to make it more --------
-------- readable for other users// --------
-------- ---------------------- --------
Set Vdp_Lifespan[1] = 10
Set Vdp_Lifespan[2] = 20
Set Vdp_Lifespan[3] = 30
-------- ---------------------- --------
-------- the max distance of the puppet --------
-------- ---------------------- --------
Set Vdp_Maxdistance = 1000.00
-------- ---------------------- --------
-------- spawn distance --------
-------- ---------------------- --------
Set Vdp_Spawndistance = 250.00
-------- ---------------------- --------
-------- the lightning effect --------
-------- // the lightning shows the CASTER and the PUPPET are bind together // --------
-------- // what kind of lightning effect do you want // --------
-------- ---------------------- --------
Set Vdp_Lightningtype = Drain Mana
-------- ---------------------- --------
-------- lightning color --------
-------- // choose the color of your lightning // --------
-------- // note: each of the real numbers will be readed as percentage // --------
-------- // note: for example 0.75 as 75% // --------
-------- // note: the range of the numbers will be 0.00 to 1.00 // --------
-------- ---------------------- --------
Set Vdp_LightningR = 1.00
Set Vdp_LightningG = 1.00
Set Vdp_LightningB = 1.00
[/trigger]


[trigger="Voodoo Puppet"]
Voodoo Puppet
Events
Unit - A unit Begins channeling an ability
Conditions
(Ability being cast) Equal to Voodoo Puppet
Actions
-------- ---------------------- --------
-------- channeller of the ability --------
-------- ---------------------- --------
Set Vdp_Channeller = (Triggering unit)
-------- ---------------------- --------
-------- level of the ability --------
-------- ---------------------- --------
Set Vdp_Level = (Level of Voodoo Puppet for (Triggering unit))
-------- ---------------------- --------
-------- sets the points --------
-------- ---------------------- --------
Set Vdp_Casterpoint = (Position of (Triggering unit))
-------- ---------------------- --------
-------- sets the channeller's facing degrees --------
-------- ---------------------- --------
Set Vdp_Angle = (Facing of (Triggering unit))
-------- ---------------------- --------
-------- creates the puppet --------
-------- ---------------------- --------
-------- =---creates a temporary point---= --------
Set Vdp_Temppoint = (Vdp_Casterpoint offset by Vdp_Spawndistance towards Vdp_Angle degrees)
-------- =---creating the puppet---= --------
Unit - Create 1 Vdp_PuppetType[Vdp_Level] for (Triggering player) at Vdp_Temppoint facing Vdp_Angle degrees
Set Vdp_Puppet = (Last created unit)
-------- =---sets the position of the puppet---= --------
Set Vdp_Puppetpoint = (Position of (Last created unit))
-------- =---addds lifespan---= --------
Unit - Add a (Real(Vdp_Lifespan[Vdp_Level])) second Generic expiration timer to (Last created unit)
-------- ---------------------- --------
-------- selects the created puppet --------
-------- ---------------------- --------
Selection - Select Vdp_Puppet for (Triggering player)
-------- ---------------------- --------
-------- creates the lightning --------
-------- ---------------------- --------
Lightning - Create a Vdp_Lightningtype lightning effect from source Vdp_Casterpoint to target Vdp_Puppetpoint
Set Vdp_Lightning = (Last created lightning effect)
-------- =---changes the color of the lightning as configured---= --------
Lightning - Change color of (Last created lightning effect) to (Vdp_LightningR Vdp_LightningG Vdp_LightningB) with 1.00 alpha
-------- ---------------------- --------
-------- stores variables --------
-------- // i know this is kind of slow but as i said to be more readable // --------
-------- ---------------------- --------
Hashtable - Save Handle OfVdp_Channeller as (Key channeller) of (Key (Triggering unit)) in Vdp_Hashtable
Hashtable - Save Handle OfVdp_Puppet as (Key puppet) of (Key (Triggering unit)) in Vdp_Hashtable
Hashtable - Save Handle OfVdp_Lightning as (Key lightning) of (Key (Triggering unit)) in Vdp_Hashtable
-------- ---------------------- --------
-------- adds the channeller to the group channellers, this is for the MUI --------
-------- ---------------------- --------
Unit Group - Add (Triggering unit) to Vdp_Channellers
-------- ---------------------- --------
-------- avoiding leaks --------
-------- ---------------------- --------
Custom script: call RemoveLocation(udg_Vdp_Temppoint)
Custom script: call RemoveLocation(udg_Vdp_Casterpoint)
Custom script: call RemoveLocation(udg_Vdp_Puppetpoint)
[/trigger]


[trigger="Voodoo Puppet Looping"]
Voodoo Puppet Looping
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in Vdp_Channellers and do (Actions)
Loop - Actions
-------- -------------------- --------
-------- loads channeller --------
-------- -------------------- --------
Set Vdp_Channeller = (Load (Key channeller) of (Key (Picked unit)) in Vdp_Hashtable)
-------- -------------------- --------
-------- loads puppet --------
-------- -------------------- --------
Set Vdp_Puppet = (Load (Key puppet) of (Key (Picked unit)) in Vdp_Hashtable)
-------- -------------------- --------
-------- sets the caster point --------
-------- -------------------- --------
Set Vdp_Casterpoint = (Position of Vdp_Channeller)
-------- -------------------- --------
-------- sets the puppet point --------
-------- -------------------- --------
Set Vdp_Puppetpoint = (Position of Vdp_Puppet)
-------- -------------------- --------
-------- loads the last lightning effect created --------
-------- -------------------- --------
Set Vdp_Lightning = (Load (Key lightning) of (Key (Picked unit)) in Vdp_Hashtable)
-------- -------------------- --------
-------- counts the distance between the channeller and the puppet --------
-------- -------------------- --------
Set Vdp_currentdistance = (Distance between Vdp_Casterpoint and Vdp_Puppetpoint)
-------- -------------------- --------
-------- sticks the lightning to the channeller and the puppet --------
-------- -------------------- --------
Lightning - Move Vdp_Lightning to source Vdp_Casterpoint and target Vdp_Puppetpoint
-------- -------------------- --------
-------- checks if the puppet is dead or limits the distance or breaks the channel --------
-------- // do not touch/configure this if you are not familiar to these triggers// --------
-------- -------------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Current order of Vdp_Channeller) Equal to (Order(channel))
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Vdp_currentdistance Greater than or equal to Vdp_Maxdistance
Then - Actions
Lightning - Destroy Vdp_Lightning
Unit - Order Vdp_Channeller to Stop
Unit - Kill Vdp_Puppet
Unit Group - Remove Vdp_Channeller from Vdp_Channellers
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Vdp_Hashtable
Custom script: call RemoveLocation(udg_Vdp_Casterpoint)
Custom script: call RemoveLocation(udg_Vdp_Puppetpoint)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Vdp_Puppet is dead) Equal to True
Then - Actions
Lightning - Destroy Vdp_Lightning
Unit - Order Vdp_Channeller to Stop
Unit Group - Remove Vdp_Channeller from Vdp_Channellers
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Vdp_Hashtable
Custom script: call RemoveLocation(udg_Vdp_Casterpoint)
Custom script: call RemoveLocation(udg_Vdp_Puppetpoint)
Else - Actions
Unit - Make Vdp_Channeller face Vdp_Puppet over 0.00 seconds
Else - Actions
Lightning - Destroy Vdp_Lightning
Unit - Kill Vdp_Puppet
Unit Group - Remove Vdp_Channeller from Vdp_Channellers
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Vdp_Hashtable
Custom script: call RemoveLocation(udg_Vdp_Casterpoint)
Custom script: call RemoveLocation(udg_Vdp_Puppetpoint)
-------- -------------------- --------
-------- avoiding leaks --------
-------- -------------------- --------
Custom script: call RemoveLocation(udg_Vdp_Casterpoint)
Custom script: call RemoveLocation(udg_Vdp_Puppetpoint)
[/trigger]


[trigger="Voodoo Puppet Remove"]
Voodoo Puppet Remove
Events
Unit - A unit Dies
Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to Puppet (Weak)
(Unit-type of (Triggering unit)) Equal to Puppet (Moderate)
(Unit-type of (Triggering unit)) Equal to Puppet (Strong)
Actions
Set Vdp_Temppoint = (Position of (Triggering unit))
Special Effect - Create a special effect at Vdp_Temppoint using Abilities\Spells\Items\AIso\AIsoTarget.mdl
Special Effect - Destroy (Last created special effect)
Unit - Remove (Triggering unit) from the game
Custom script: call RemoveLocation(udg_Vdp_Temppoint)
[/trigger]


- GUI and MUI Spell
- Feel free to edit as long as you give credits

A creation of dark_sparrow

Keywords:
voodoo puppet,voodoo,puppet,dark,sparrow
Contents

VoodooPuppet Remake v1.0 (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. Voodoo Puppet Remake v1.0 | Reviewed by Maker | 28th Apr 2013 NEEDS FIX The looping trigger should be initially off and turned off when the group becomes empty Voodoo...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.


Voodoo Puppet Remake v1.0 | Reviewed by Maker | 28th Apr 2013
NEEDS FIX


126248-albums6177-picture66522.png


  • The looping trigger should be initially off and turned off when
    the group becomes empty
  • Voodoo Puppet Remove should be initially off and turned off when
    there are no units of that type in the map
  • Add importing instructions. People might have to configure
    the ability condition and the current order line
  • You have extra RemoveLocation calls in the looping trigger,
    you only need them at the end of the trigger
  • The Puppets should have can't raise, does not decay death type
126248-albums6177-picture66524.png
[tr]
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Improve the tooltip - what does the puppet do?
You leak a lot.
Don't use waits.
The spell is not MUI.
0.01 is too low of an interval.
You could use AddLightningEx() and MoveLightningEx() to gain some z-offset for the lightning.
Replace the three if/then/else thingies for unit ability level check with this:
  • Unit - Create 1 Voodoo Puppet for (Owner of Casting_Unit) at ((Position of Casting_Unit) offset by 200.00 towards 0.00 degrees) facing (Facing of Casting_Unit) degrees
  • Set VP_Puppet = (Last created unit)
  • Unit - Add a (20.00 + (10.00 x (Real((Level of Voodoo Puppet for (Triggering unit)))))) second Generic expiration timer to VP_Puppet
but fix the leaks.
 
Level 14
Joined
Nov 2, 2008
Messages
579
wow this spell is awesome!! 5/5 :thumbs_up:

You shouldn't just randomly hand out 5/5's.

ONTOPIC:

Don't use (Casting Unit). Use (Triggering Unit).

Your indexing is completely wrong and your code is a mess\not efficient at all.
I'm not trying to discourage you, but you should read This tutorial before submitting another spell.

You also need a spell pic and post the triggers in the description.

Anyway, this will be rejected.
 
Now thats some funky indexing... I'll look more into this
Oh this
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • Then - Actions
  • Unit - Create 1 Voodoo Puppet for (Owner of VP_Caster[VP_Index[1]]) at ((Position of VP_Caster[VP_Index[1]]) offset by 200.00 towards (Facing of VP_Caster[VP_Index[1]]) degrees) facing (Facing of VP_Caster[VP_Index[1]]) degrees
  • Set VP_Puppet[VP_Index[1]] = (Last created unit)
  • Unit - Add a (20.00 + (10.00 x (Real((Level of Voodoo Puppet (Channeling) for VP_Caster[VP_Index[1]]))))) second Generic expiration timer to VP_Puppet[VP_Index[1]]
  • Else - Actions
the if/then/else is useless here, remove it.
For lightning effects
  • Events
  • Time - Every 0.01 seconds of game time
is much too fast of a periodic now something <.02 would be much better.
this
  • Lightning - Move VP_String[(Integer A)] to source (Position of VP_Caster[(Integer A)]) and target (Position of VP_Puppet[(Integer A)])
leaks every 0.01 seconds 2 times
  • Unit - Create 1 Voodoo Puppet for (Owner of VP_Caster[VP_Index[1]]) at ((Position of VP_Caster[VP_Index[1]]) offset by 200.00 towards (Facing of VP_Caster[VP_Index[1]]) degrees) facing (Facing of VP_Caster[VP_Index[1]]) degrees
this leaks too.
and this
  • Special Effect - Create a special effect at (Position of VP_Puppet[(Integer A)]) using Abilities\Spells\Items\AIso\AIsoTarget.mdl
  • Unit - Move VP_Puppet[(Integer A)] instantly to ((Position of VP_Puppet[(Integer A)]) offset by -10.00 towards (Angle from (Position of VP_Caster[(Integer A)]) to (Position of VP_Puppet[(Integer A)])) degrees)
ok enough said this has too many leaks and like shit, if this were used in a rpg the game would last less than 30 mins. everyone would crash and no one would play that game again. LEAKS ARE BAD. FIX IT >.<
 
Top