Spell Shadowmeld during day

Exide

I am amazingly focused right now!
Reaction score
448
Shadowmeld during day


  • Pre-words.
  • How to.
  • Final words.


*Pre-words.

Welcome to my Shadowmeld System.
As the threadname says, this is a system on how to make shadowmeld work during day. I've noticed that a lot of people has been asking this question, but I never found a proper answer to it. The idea is pretty simple, and there isn't much to it, so this System will be a short one.

*How to.

First of all, the whole concept of making your shadowmeld work during day is to check if the unit has moved or not. If the unit didn't move, add permanent invisibility to the unit, else remove permanent invisibility from the unit.

What do we need for this?
Well, first of all the unit, obviously, then the custom spell (based on shadowmeld).
If you want to, you can also add a new ability, based on the permanent invisibility ability, for good measures.
This is the easy part, just create a new custom ability, base it on Shadowmeld and change the fields to suit the way you want it.
I suggest you set the 'Data - Fade Duration' field to 0.50 (a half second).
-This is nothing important, as it will only act during night time.
I also suggest that you make it so that your custom made Permanent Invisibility ability (if you choose to make one) doesn't show on your unit. (The standard Permanent Invisibility (Neutral Hostile) does not show.)

Once you've set your abilities correctly, you will need two triggers.
The first one will register if your unit learns your "shadowmeld" spell:

Code:
*Trigger1*
    Events
        Unit - A unit Learns a skill
    Conditions
        (Learned Hero Skill) Equal to [B]*Your_Skill*[/B] 
    Actions
        Set MeldUnit = (Triggering unit)
        Trigger - Turn on *Trigger2* <gen>

Nothing special about this, except, the spell can't be MUI (It will only work on one unit per map and game).
MeldUnit is a Unit variable.

After that you will need the actual invisibility trigger:

Code:
Trigger2
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Set TempPoint = (Position of MeldUnit)
        Wait 0.50 seconds
        Set [B]TempPoint2[/B] = (Position of MeldUnit)
        If ((Distance between TempPoint and [B]TempPoint2[/B]) Greater than or equal to 1.00) then do (Unit - Remove Permanent Invisibility from MeldUnit) else do (Unit - Add Permanent Invisibility to MeldUnit)
        Custom script:   call RemoveLocation(udg_TempPoint)
        Custom script:   call RemoveLocation(udg_TempPoint2)

This is simple. The first trigger turns on the second, which checks, every 0.50 (half second) where your unit with your ability is. If the unit has moved since the last check, the trigger will remove Permanent Invisibility from the unit, if not the trigger will add Permanent Invisibility to your unit.
Also, Permanent Invisibility will break if your unit is attacking another, so technically your unit should be invisible whenever it's not moving, at both day and night, except during combat.
The event and the wait function sets your fade duration time. (If you have the same event with every 0.8 second instead, and put a 0.4 second wait, the fade time SHOULD be 0.4 seconds. -Notice how I suggested that you should set a 0.50 Fade Duration on your shadowmeld ability, earlier.)
TempPoint, and TempPoint2 are point variables.
Distance between ... is a real comparison. 'Real Comparison -> Math - Distance between Points'.


*Final words.

I realize this isn't much of a System, but I hope it can help someone with their ability in the future.
Also, I couldn't find a way of making this ability MUI. If anyone else knows a way, please share. :)
Thank you for reading this, I hope it helps.
/Exide.
 

Attachments

  • [System] Shadowmeld during day.w3x
    14.2 KB · Views: 278

Sim

Forum Administrator
Staff member
Reaction score
534
> (Distance between TempPoint and (Position of MeldUnit)

Bolded text leaks.
 

Exide

I am amazingly focused right now!
Reaction score
448
I'll fix that right away, thanks for noticing.
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
Also, I couldn't find a way of making this ability MUI. If anyone else knows a way, please share. :)


Make a unit array MeldUnit[]
Make an integer variable Integer
Make 2 Point arrays Point[] Point2[]

Code:
Unit learns ability ->
- MeldUnit[Integer] = learning hero
- Integer = Integer + 1

then make the second trigger:

Code:
Loop 1 to Integer
set Point[Loop Integer A] = position of Unit[Loop Integer A]
end loop

Wait 0.50 seconds

Loop 1 to Integer
set Point2[Loop Integer A] = position of Unit[Loop Integer A]
If ((Distance between TempPoint[Loop Integer A] and TempPoint2[Loop Integer A]) Greater than or equal to 1.00) then do (Unit - Remove Permanent Invisibility from Unit[Loop Integer A]) else do (Unit - Add Permanent Invisibility to Unit[Loop Integer A])
end loop

Loop 1 to Integer
Custom script:   call RemoveLocation(udg_Point[bj_forLoopAIndex])
Custom script:   call RemoveLocation(udg_Point2[bj_forLoopAIndex])
endloop


This should make it MUI if I'm not mistaken.

the loop - endloop are For Loop Integer thingies.


You may want to expand the condition though, you're not checking if the unit already has invisibility or not.
Now you're adding/removing multiple invisibilities to/from one unit I think.
 

Exide

I am amazingly focused right now!
Reaction score
448
>Now you're adding/removing multiple invisibilities to/from one unit I think.
I believe that you can't remove an ability from a unit that doesn't have that ability, and you can't add an ability that is already there. I might be wrong, though. :p
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
>>I believe that you can't remove an ability from a unit that doesn't have that ability, and you can't add an ability that is already there. I might be wrong, though
if i am not mistaken though...if you removed an ability from a unit that doesnt has the ability...it will return nothing...Same as Removing *ViceVersa*
 

NetherHawk

New Member
Reaction score
26
Does it still leak after u have added in the TempPoint2? from what i've tried before in another skill, it still wont work ><
 

Exide

I am amazingly focused right now!
Reaction score
448
>Does it still leak after u have added in the TempPoint2? from what i've tried before in another skill, it still wont work ><

Nope, shouldn't leak.
Won't work? It's a fairly simple trigger, the only problem I see should be the If/ Then/ Else. -Make sure that it's a 'Real Comparison -> Math - Distance Between Points'. Also check your event, every X second, and how long wait you have.
 

rodead

Active Member
Reaction score
42
nice System +rep i don't use it but if i needed to use it i understand it perfectly.
 

Sim

Forum Administrator
Staff member
Reaction score
534
This is a system, definitely, not a tutorial.

New rules define it clearly :rolleyes:

And as such, a demo map will be required.
 

Exide

I am amazingly focused right now!
Reaction score
448
Sorry.
I didn't know the difference. :eek:

I will fix it as soon as possible.
 

waaaks!

Zinctified
Reaction score
256
i think this isnt a shadow meld...because shadow meld will make the unit invisible if it is not moving, while permanent invisiblity gives invisibility to a unit even if it is moving
 

Exide

I am amazingly focused right now!
Reaction score
448
>i think this isnt a shadow meld...because shadow meld will make the unit invisible if it is not moving, while permanent invisiblity gives invisibility to a unit even if it is moving

Correct.
 

waaaks!

Zinctified
Reaction score
256
i suggest, implementing the system IsUnitMoving(), so that if a unit move with the permanent invi, then remove the ability, and when it is not moving, then add the permanent invi again
 

Exide

I am amazingly focused right now!
Reaction score
448
Updated.
I added a Demo map, and attached it to the first post.
 

Trollvottel

never aging title
Reaction score
262
you could make it mui adding a unit learning the skill to a unit group and pick them every x seconds in....
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top