Spell Request: Charm (complicated one)

Avaleirra

Is back. Probably.
Reaction score
128
Hi I need help with a spell and I have no idea how to make it.


I wish to create a charm with a 10 second cast time. The spell needs a castbar and must be interupted when the caster moves, sleeps, gets stunned, paused, or dies. The charm is not a hero ability and can only target ancient, enemy, neutral, invulnerable, structure.

Needs to be MUI and MPI.


I'm assuming this requires JASS or vJASS. I have newgen so it's all good :).



I'll give rep and credits since this is sorta urgent :p.



Thanks
Avaleirra
 

Psiblade94122

In need of sleep
Reaction score
138
cant you just give charm a casting time?

if not base it off of channel, detect when a unit finishes channeling a spell (with the targets on whatever you want to target)
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
The only problem with this is the castbar, but i don't see if it's that necessary? If none of your other spells actually use a castbar, then, this is a waste of time. Why don't you make a spell with a 10 second casting time, and then create floating text that would go 10, 9, 8, 7...etc... . To make it MUI i suppose you'll need hashtables or some sort of a timer, i'm still quite inexperienced with it, but some people here are pretty good with them ^^
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Also, its quite laggy, at least I heard. There's this casting bar system somewhere in this forum, I think it has something to do with strings... And it'll cause lag.
 

Bogrim

y hello thar
Reaction score
154
Use a single target dummy spell.
Hide the unit.
Create a new unit using the same unit-type.
Add a no target channel spell to the dummy unit.
Add a 10 seconds expiration timer to the dummy unit. This will be your casting bar.
Detect if the dummy unit is interrupted & remove it & bring the original unit back.
Detect if the unit expires & change owner of the target unit & bring the original unit back.

You will need an array index system to make this MUI (it's possible to do in GUI by just using an array and an integer variable to count and reset the array integer).
 

Avaleirra

Is back. Probably.
Reaction score
128
I have already attempted using a casting time. Here's what went wrong.


-couldn't interuppt it by walking away
-stuns, sleeps, pauses didn't stop it
-even if the caster died it continued



The castbar worked fine though and there was no lag.

@Bogrim
I think the MUI thing is beyond my level of triggering spells.
 

Bogrim

y hello thar
Reaction score
154
@Bogrim
I think the MUI thing is beyond my level of triggering spells.
Then let's go with something more simple:
Trigger:
  • Mind Control
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mind Control
    • Actions
      • Custom Script: local unit u
      • Custom Script: local integer i
      • If Array_Index = 1000 Then Set Array_Index = 1 Else Set Array_Index = (Array_Index + 1)
      • Set Temp_Integer = Array_Index
      • Custom Script: set i = udg_Array_Index
      • Set Temp_Location = Position of (Casting unit)
      • Unit - Hide (Casting Unit)
      • Unit - Create 1 (Unit of unit-type (Casting unit)) at Temp_Location facing (Facing angle of (Casting unit))
      • Custom Script: call RemoveLocation( udg_Temp_Location )
      • Unit - Add a 10.10 seconds Generic expiration timer to last created unit
      • Custom Script: set u = GetLastCreatedUnit()
      • Unit - Add (Channel dummy ability) to (Last Created Unit)
      • Unit - Order (Last Created Unit) to Orc Shadow Hunter - Big Bad Voodoo
      • For each (Integer Custom_Integer[Temp_Integer]) from 1 to 20, do (Actions)
        • Loop - Actions
          • Wait 0.5 seconds
          • Custom Script: set udg_Temp_Unit = u
          • Custom Script: set udg_Temp_Integer = i
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of Temp_Unit) Not equal to bigbadvoodoo
            • Then - Actions
              • Set Temp_Location = (Position of Temp_Unit)
              • Unit - Remove Temp_Unit from the game
              • Unit - Unhide (Casting unit)
              • Unit - Move (Casting unit) instantly to Temp_Location
              • Custom Script: call RemoveLocation( udg_Temp_Location )
              • Skip remaining actions
            • Else - Actions
      • Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Casting unit)) and Change color
      • Set Temp_Location = (Position of Temp_Unit)
      • Unit - Remove Temp_Unit from the game
      • Unit - Unhide (Casting unit)
      • Unit - Move (Casting unit) instantly to Temp_Location
      • Custom Script: call RemoveLocation( udg_Temp_Location )
      • Custom Script: set u = null

I wrote this out of my head so it probably doesn't match the WE's text completely, but I hope it gives you an idea of how this trigger would work.
 

cryowraith

New Member
Reaction score
7
I guess you are looking for something similar to DotA's Sand King's Epicenter, in terms of casting? You'll have to use it as a channeling spell instead of casting time. Make a spell with 10 seconds channeling time and 0 casting time, with no effects. Then use trigger to detect the finish channeling (I think its finish casting) event and do whatever you need in the actions. Thats without the floating text/casting bar part though. You'll need another trigger for that I guess.
 

Dirac

22710180
Reaction score
147
Do this:

A unit begins casting an ability

Add unit to CastGroup

-----------

A unit stops casting an ability

Remove unit from castgroup


then check if the caster is still in castgroup
EDIT: Forgot to mention, this method works PERFECTLY for me, and has no bugs since a unit cant cast 2 abilities at the same time
 

Xienoph

You can change this now in User CP.
Reaction score
43
Don't you also need:

A unit finishes casting an ability.

Charm the unit in castgroup

EDIT: nvm. Misunderstood your approach.
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
I guess you are looking for something similar to DotA's Sand King's Epicenter, in terms of casting? You'll have to use it as a channeling spell instead of casting time. Make a spell with 10 seconds channeling time and 0 casting time, with no effects. Then use trigger to detect the finish channeling (I think its finish casting) event and do whatever you need in the actions. Thats without the floating text/casting bar part though. You'll need another trigger for that I guess.

This.

Let me explain better.
The best way is to make 3 triggers. One for the casting bar, one to start it, and one to cancel it in the event the unit moves.
The casting bar trigger will also contain whats to be done after the unit is done with the 10 seconds cast time.

The first trigger will roughly do this:
event:
Every 0.05 seconds (or whatever low-ish value you want. The lower the more accurate, but also the more laggy)
Conds: somebooleanvar == true
actions:
increase an integer by 1
then increase the cast bar's length by 1/200th (note, your cast bar may not and will probably not have 200 ticks, what you'll want to do is every 10 ticks of that integer, increase bar by 1 tick (thats for a 20-ticks bar))
once the integer variable reaches 200, that means 10 seconds passed
enter actions to be perfomed here (Charm in your case, so you have to save the target unit and owner of casting unit in variables when the unit starts then use them here)

The second trigger:
event: unit starts the effect of an ability
conds: ability = charmwithcastingtime
action: set somebooleanvar = true (remember that condition in the first trigger?)

the last trigger:
event: unit stops channeling an ability
cond: ability being cast = charmwithcastingtime
action:
set somebooleanvar = false
set integervariable = 0 (the one you use to tick in first trigger)

now for this to be bug free, you need to make that charm a channeled ability with duration equal to10 + the time in the first trigger's event

(for example, i used Every 0.05 seconds of game time, that would mean a duration of 10.05 seconds)

One last thing, this isnt mpi nor mui. If you want it MPI, make every variable a 12-indexes array. If you want it MUI, you need to use jass to create a new timer every time a new index has to be used.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
I wish to create a charm with a 10 second cast time. The spell needs a castbar and must be interupted when the caster moves, sleeps, gets stunned, paused, or dies. The charm is not a hero ability and can only target ancient, enemy, neutral, invulnerable, structure.
Is there a mana cost? Should it be spent at the beginning of channeling, or at the end?

What should happen if you start charming a target that is already being charmed, and the other spell finishes while yours is still casting?

[edit]
if not base it off of channel, detect when a unit finishes channeling a spell (with the targets on whatever you want to target)
Did it this way, with a ghettotastic casting bar. :p

Other concurrent casters will be ordered to stop when the target is successfully charmed. Requires a unit auto-indexer (map includes GUI-AIDS).
 

Attachments

  • Cast Time Charm.w3x
    22.5 KB · Views: 163
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top