Question making an anti charm

Status
Not open for further replies.
Level 6
Joined
Mar 11, 2018
Messages
135
So I know this is going to sound odd but I am looking to make a kind of anti-charm. The idea is i want to make a unit that you can't attack but one player can control. They use an aoe charm spell to change a group of units to creep class (so the person with the unit does not get control) but it works just like charm where they stay the same unit.

the reson why I want to do this is because the map is like a god battle all most. In testing what I did with my friend's they would always mass a huge army and just bash anything that comes out of the spawners till they beat the tasks needed to drop the invisability. Having a charm aoe will make them not be able to camp the spawers or else they loose those units and if they turn to creep rather then the "God" player control they can't be made to abuse the people trying to beat the god.

In short I am too dumb to know how to make it so charm can set it to creep class (or at least to a set player class) let alone how to make it aoe.


Also should note I use the normal editor. I have seen people use these hash codes and stuff like long form i think they call them jazz lines I can't do that. It's the base editor.


--------------------
edit

I was given info I was wrong on the one I said. I can work with jass. Lua is the one I can not understand.
 
Last edited:

Uncle

Warcraft Moderator
Level 71
Joined
Aug 10, 2018
Messages
7,615
Warcraft 3 uses two programming languages, Jass and Lua.
Jass is the standard one that has been used since day 1, and Lua was introduced not too long ago as a better alternative.
Maps by default start in Jass mode and they can only use one of these two languages at the same time. Jass is recommended for non-advanced users.

To define yourself:
You're a Jass user that uses GUI, which is the Graphical User Interface that the Trigger Editor provides. In other words, you create your game logic (triggers) using the interface in the Trigger Editor. Blizzard designed this interface in order to make coding your map easier. And yes, even as a GUI user you're still technically coding your map. Understand that all of your triggers are converted into Jass code when you run and play your map, so you ARE coding in Jass, just in an easy to use GUI form. GUI is sort of like training wheels on a bicycle. With training wheels you're still riding a bike, the extra wheels simply make it easier to do so, at a cost of course (limitations). Anyway, what's important is having a basic understanding of those two terms, Jass and GUI.

To answer your question, the creep class is called Neutral Hostile. Any unit owned by the Neutral Hostile player will behave like a creep.
The Action to do this is simple:
  • Unit - Change ownership of (Some unit) to Neutral Hostile and Change color
But you want to Change the ownership of multiple units in response to casting an ability. That's simple as well:
  • AoE Creep Charm
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Creep Charm
    • Actions
      • Set VariableSet TempPoint = (Position of (Triggering unit))
      • Set VariableSet TempGroup = (Units within 400.00 of TempPoint.)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) is A structure) Equal to False
            • Then - Actions
              • Unit - Change ownership of (Picked unit) to Neutral Hostile and Change color
            • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Custom script: call DestroyGroup (udg_TempGroup)
Notes:
  • (Triggering unit) is always equal to the unit that caused the Unit Event to run. So in this case it's the unit that started the effect of the Creep Charm ability, in other words it's the (Casting unit).
  • I use the Pick Every Unit in Unit Group action to interact with multiple units at the same time.
  • I use an If Then Else action to filter through the (Picked units), allowing us to decide who will be changed to Neutral hostile. In this case I made it so the units must belong to an enemy of the caster, they must be alive, and they can't be structures.
  • The Point variable and a Unit Group variable are used in order to avoid Memory Leaks. These are completely optional but recommended if you want to make your map as efficient as possible.
  • The Custom script stuff is the final step in avoiding Memory Leaks. They remove the Point and Unit Group objects that we generated. Think of it like emptying your Recycle Bin on a Windows pc. If you don't use the two Variables then this Custom script isn't needed either.
 
Last edited:
Level 6
Joined
Mar 11, 2018
Messages
135
Warcraft 3 uses two programming languages, Jass and Lua.
Jass is the standard one that has been used since day 1, and Lua was introduced not too long ago as a better alternative.
Maps by default start in Jass mode and they can only use one of these two languages at the same time. Jass is recommended for non-advanced users.

To define yourself:
You're a Jass user that uses GUI, which is the Graphical User Interface that the Trigger Editor provides. In other words, you create your game logic (triggers) using the interface that Blizzard designed to make coding your map easier. And yes, even as a GUI user you're still technically coding your map. Understand that all of your triggers are converted into Jass code when you run your map and play it, so technically you ARE coding in Jass, just in an easy to use form. It's like training wheels on a bicycle. You're still technically riding a bike, the wheels simply make it easier to do so, at a cost of course.

To answer your question, the creep class is called Neutral Hostile. Any unit owned by the Neutral Hostile player will behave like a creep.
The Action to do this is simple:
  • Unit - Change ownership of (Some unit) to Neutral Hostile and Change color
But you want to Change the ownership of multiple units in response to casting an ability. That's simple as well:
  • AoE Creep Charm
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Creep Charm
    • Actions
      • Set VariableSet TempPoint = (Position of (Triggering unit))
      • Set VariableSet TempGroup = (Units within 400.00 of TempPoint.)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) is A structure) Equal to False
            • Then - Actions
              • Unit - Change ownership of (Picked unit) to Neutral Hostile and Change color
            • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Custom script: call DestroyGroup (udg_TempGroup)
Notes:
  • (Triggering unit) is always equal to the unit that caused the Unit Event to run. So in this case it's the unit that started the effect of the Creep Charm ability, in other words it's the (Casting unit).
  • I use the Pick Every Unit in Unit Group action to interact with multiple units at the same time.
  • I use an If Then Else action to filter through the (Picked units), allowing us to decide who will be changed to Neutral hostile. In this case I made it so the units must belong to an enemy of the caster, they must be alive, and they can't be structures.
  • The Point variable and a Unit Group variable are used in order to avoid Memory Leaks. These are completely optional but recommended if you want to make your map as efficient as possible.
  • The Custom script stuff is the final step in avoiding Memory Leaks. They remove the Point and Unit Group objects that we generated. Think of it like emptying your Recycle Bin on a Windows pc. If you don't use the two Variables then this Custom script isn't needed either.
ah I knew I was saying something wrong with jass. I don't understand the tech stuff at all. Thank you for telling me I said the wrong one. when I was talking about the one too hard to work I meant lua I can't do. I will have to change that.

That. Looks complicated but i have noticed when you get the code in it is easier then it looks so I will begin putting that in.

As for lua Honestly I will use what ever is easier. I played around in the starcraft 2 editor and my gods that thing was like a gift of qol and easy stuff. Literally clicked 2 things and everything was set to endless no unit cap and so on in seconds. Shame they don't take that and work it into warcraft 3 editor but I am rambling.

Thank you for the aid now to open my map file.

So I am looking threw I can't find a Set VariableSet TempPoint = (Position of (Triggering unit)). I select set variable then click the red variable and noting no options
 
Last edited:
Status
Not open for further replies.
Top