Respawn for Neutral Hostile after Charm?

TheAbyss

New Member
Reaction score
2
Hey, I'm working on a map I have, and I'm trying to make any unit that belongs to Neutral Hostile and gets Charmed by a Dark Ranger respawn after 7.50 seconds times it's level. Here's what I've got so far:
Trigger:
  • Charm Respawn
    • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
    • (Owner of (Target unit of ability being cast)) Equal to Neutral Hostile
    • (Ability being cast) Equal to Charm
    • Actions
    • Set TempUnitType = (Unit-type of (Target unit of ability being cast))
    • Set TempPoint = (Position of (Target unit of ability being cast))
    • Wait (7.50 x (Real((Level of (Target unit of ability being cast))))) seconds
    • Unit - Create 1 TempUnitType for Neutral Hostile at TempPoint facing Default building facing degrees

It's not working at all. I know that the problem is problably that it picks up the new owner of the target instead of the old one, but I have no clue how to fix it. Any ideas? Keep in mind that it MUST be specified to only respawn Neutral Hostile units because summons from other players can be Charmed as well.
 

canons200

New Member
Reaction score
50
sorry, i not really get to know what is you desired.

From trigger above, it works as >>>> after an unit(X) uses a spell to target an unit(Y), after some time, create 1 more (Y)

1 more thing, you are using UNIT TYPE variable, which apply to all of those unit.

If you want to target only 1 unit, use UNIT variable
 

TheAbyss

New Member
Reaction score
2
What I want is for creeps to respawn later in the same position after being targeted by the Dark Ranger's ultimate ability Charm. In case you don't know what Charm is, it's an ability that changes the ownership of the non-hero, below level 6 unit that is targeted to the owner of the casting unit.
 

canons200

New Member
Reaction score
50
respawn later in the same position? see below

1) hide it and show it again later? or

2) just wait for a while and create another same unit? regardless the previous unit life/dead
 

TheAbyss

New Member
Reaction score
2
I think you're missing the point. When Charm is used, the unit switches over to being controlled by the player casting Charm. What I want to do is spawn a new one of the same unit for the original owner (Neutral Hostile) in the spot it was when Charm was casted on it. I only want to work if the original owner was Neutral Hostile.
 

canons200

New Member
Reaction score
50
hmm, either my english problem or your english problem. see below (what i think you want to do)

An unit(X) uses a spell target unit (Y), then owner of unit X gain control of unit Y(permanent), and owner of unit Y lose the unit Y, but after the desired time, unit of Y get back unit Y(by creating new 1) but yet owner of X still have unit Y, assuming he is alive.

So in end the owner of X and Y also have unit Y?
 

Bird

Ultra Cool Member
Reaction score
29
Your trigger looks OK to me - except that those variables could be overwritten? Is TempPoint and/or TempUnitType used in other triggers?
 

TheAbyss

New Member
Reaction score
2
An unit(X) uses a spell target unit (Y), then owner of unit X gain control of unit Y(permanent), and owner of unit Y lose the unit Y, but after the desired time, unit of Y get back unit Y(by creating new 1) but yet owner of X still have unit Y, assuming he is alive.
Exactly. There is already a spell for taking the unit, but I need the respawn part.
Your trigger looks OK to me - except that those variables could be overwritten? Is TempPoint and/or TempUnitType used in other triggers?
No, they are only used in this trigger. Like I said, I think that the problem is that it's reading the owner for the condition AFTER it's officially given to the owner of the caster.
 

Bird

Ultra Cool Member
Reaction score
29
^ Ahh, didn't read your 1st post, after the trigger.

Try changing your Event...

Trigger:
  • Unit - A unit Begins casting an ability

I suspect that wil fix it - if not, try the other Spell Events (several to choose from!)
 

Bird

Ultra Cool Member
Reaction score
29
Also, consider that for Respawn triggers - it is far superior to simply have a Periodic Event Timer that checks to see if the given creep camp has been emptied out and spawn the creeps, rather than to try to account for all ways that a creep *could* "die" (melee death? Charm? Possession?) and set individual Wait timers to respawn the unit.
 

TheAbyss

New Member
Reaction score
2
tried them all... still does absolutely nothing - and for your other suggestion, i would prefer they revive individually so that when they died and how strong they are have an impact on when they revive. And besides, being a hero map, there are only 2 ways they CAN die, death and Charm.
 

Bird

Ultra Cool Member
Reaction score
29
I just made the trigger (similar to yours), and it works fine. I did notice when making it that there is a *Unit* Ability Charm, and a *Hero* Ability Charm - are you sure you used the right one in your Conditional?

Trigger:
  • testit
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Owner of (Target unit of ability being cast)) Equal to Neutral Hostile
      • (Ability being cast) Equal to Charm
    • Actions
      • Set PointVariable = (Position of (Target unit of ability being cast))
      • Set UnitTypeVariable = (Unit-type of (Target unit of ability being cast))
      • Game - Display to (All players) for 10.00 seconds the text: ((the target is + (String(UnitTypeVariable))) + ( and the owner is + (Name of (Owner of (Target unit of ability being cast)))))
      • Wait 5.00 seconds
      • Game - Display to (All players) for 10.00 seconds the text: ((the target is + (String(UnitTypeVariable))) + ( and the owner is + (Name of (Owner of (Target unit of ability being cast)))))
      • Unit - Create 1 UnitTypeVariable for Neutral Hostile at PointVariable facing Default building facing degrees


(Note that after 5 seconds the Trigger *does* forget the Owner)
charmtest.jpg


If you are using the correct spell in your Conditional - then i think your Wait action is your problem. Set an Real Variable = to 7.5 x UnitLevel. Then use that Variable in the Wait. Don't use UnitLevel (something your Trigger *will* forget in the Wait.
 

canons200

New Member
Reaction score
50
do as below, SURE working(i tested), use chain lightning as base spell, remove damage, set it as show-effect-spell

Trigger:
  • abc
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (custom chain lightning)
      • (Owner of (Target unit of ability being cast)) Equal to Neutral Passive
    • Actions
      • Set AAA = (Target unit of ability being cast)
      • Set PPP = (Position of AAAAA)
      • Unit - Change ownership of AAA to (Owner of (Triggering unit)) and Change color
      • Wait 4.00 seconds
      • Unit - Create 1 (Unit-type of AAA) for Neutral Passive at PPP facing Default building facing degrees
 

TheAbyss

New Member
Reaction score
2
Alright, I tested it with setting the wait time first... and I made a message tell me how long till it respawns. Turns out it works fine on level 1 units but not on level five units. Here's how it happened: I used it on a Makrura Prawn (level one). The game said it would take 7.500 seconds. I waited and it appeared. Next, i tested it on a Makrura Deepseer (level five). It said wait 37.500 seconds. So I wait, and in 37.500 seconds, the game spawned a... Razormane Scout. Wtf? Well, the closest NH unit to me at the time was a Razormane Scout if it helps, but he was far enough to be out of my sight range, and I definately Charmed a Deepseer. Now I'm seriously confused o_O. I'm considering just giving Dark Ranger a different ulti :p.

Edit: Sorry canons you posted while I was typing XD. Yeah, I'll try that tomorrow after school, I need some sleep now XD.
 

Wratox1

Member
Reaction score
22
i would do a unit group variable and add all your creeps there, then if a unit dies check iif it is inside the group, even if you cast charm the unit will still be in the group..
 

Bogrim

y hello thar
Reaction score
154
You're using a global variable which you also use in other triggers. You set the value for this variable before the wait and the variable is then altered by another trigger during the wait, causing the unit spawn position after the wait to bug.

You need to understand that when you use global variables, you should never use them with wait actions unless the variable serves no other purpose and is specifically created for that trigger. There is a type of variable better suit for these sort of triggers, called local variables.

Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Changes owner
    • Conditions
      • (Previous owner) Equal to Neutral Hostile
    • Actions
      • Custom script: local location l = GetUnitLoc(GetTriggerUnit())
      • Custom script: local integer i = GetUnitTypeId(GetTriggerUnit())
      • Wait (7.50 x (Real((Level of (Triggering unit))))) seconds
      • Custom script: set udg_Temp_Point = l
      • Custom script: set udg_Temp_UnitType = i
      • Unit - Create 1 Temp_UnitType for Neutral Hostile at Temp_Point facing Default building facing degrees
      • Custom script: call RemoveLocation( l )
      • Custom script: set l = null

Note that unit-type variables are merely integer variables and aren't treated differently in Jass.
 

Attachments

  • charm.w3x
    16.5 KB · Views: 93

TheAbyss

New Member
Reaction score
2
Ah, I just found the other trigger where I use TempUnitType... *facepalm* sorry, thought I hadn't already been using it for some reason o_O. And it was standing right in front of my face too, it's in the same category, I've already asked questions concerning it before... wow. Sorry for the trouble XD.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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