Disguise

Rare_Yeoman

Cool Member
Reaction score
1
I am working on an ability, Disguise. This ability will use the chaos ability to make the hero into a unit with the model file of a villager (there are going to be many villager units in this map), also this chaos-ed unit wont appear on the mini map, it will have one ability, remove disguise, which obviously would change the unit back to normal. I will also have it made so that if the unit is attacked, he changes back to normal. Is there a way to stop computer units and/or player units from automatically running upto the disguised unit and attacking it? I want for the only way for other people to know if its the disguised unit, is to attack random villagers in hopes that one of them will be the disguised unit.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
There is no way known to me (and i am working with the editor for a long time now) how to do what you want. But there are several alternate methods i would like to show you:

1). Set the aquisation range of all units to 1.
-> This will make all units stop attacking enemy units by their own, they will now only attack back if they are attacked or they will attack if they are given an attack order by their owner.

cons: You cannot have ranged units and they wont attack any unit in the game by their own.

2). make the actual unit have no model at all and be invulnerable and spawn an additional neutral owned villager as a dummy on top of your unit. whenever the villager is taking damage / attacked make the actual unit lose the same amount of hp, remove the neutral owned villager and unchange the form of the actual, player owned, unit.

cons: alot of work.

3). make the unit not attackable by the other units, for example, give it the classification "ancient" or "sapper" or something like this and add to the possible attack targets of the enemies "no-ancient" or "no-sapper".
-> You would need an other way of attacking that unit, like an ability to damage them. (which will then make the unit un-disguise and be able to be attacked normally again.

cons: more work for the players.


On a sidenote, you should rather use metamorphosis (or similar abilities) instead of chaos. Chaos is known to cause bugs if you are switching between 2 unit types back and forth.
 

Sajin

User title under construction.
Reaction score
56
First, Maybe set the neutral villagers as an allied computer?

second, trigger a spell based on thunder clap,

When unit starts the effect of an ability

ability = thunder clap

set casting_unit = casting unit
hide casting_unit
set position = current position of casting_unit
Create disguised[villager] at position for owner of casting_unit
set last created unit = disguised_unit
add disguised_unit to Disguised_unit_group
add disguised_unit to current selection of Owner of casting_unit




Unit is attacked

unit = disguised[villager]

set attacked unit = attacked_unit
if
attacked_unit is in Disguised_unit_group
then
remove disguised_unit from disguised_unit_group
move casting_unit to current position of disguised unit
remove disguised_unit from game
un hide casting_unit
add casting_unit to current selection for owner of casting_unit



Sorry this was rushed :p was in a hurry but this should work alright (it has leaks) but i haven't tested it so yea
 

inevit4ble

Well-Known Member
Reaction score
38
I thought once you change a unit with chaos it cannot be changed back.

If its only one kind of unit that the hero can change into then you should you the above idea. I have done it before but slightly different to retain cooldowns, learned abilities etc.

And to stop units attacking the disguised unit you could change ally alignment but then the enemies won't attack at all until its changed back.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
you could make the unit it transforms into an ancient and make the villagers unable to target ancients

then give the unit an ability based off the bear transformation spell with the modified (ancient) villager model file
 

MP®

Member
Reaction score
11
I also made various maps with a disguise spell. I used this method:
3). make the unit not attackable by the other units, for example, give it the classification "ancient" or "sapper" or something like this and add to the possible attack targets of the enemies "no-ancient" or "no-sapper".
-> You would need an other way of attacking that unit, like an ability to damage them. (which will then make the unit un-disguise and be able to be attacked normally again.

cons: more work for the players.
Except I didn't make another way of attacking that unit, but made the unit unmask (change back to normal) when a player clicked on it.

So the unit will be unmasked before anyone attacks it, but you have to click the right one first.

Another idea is: when you play with 1 hero per person, you could just make all enemies of the disguised unit treat him as ally without shared vision. And change back when unmasked
 

Rare_Yeoman

Cool Member
Reaction score
1
@Accname - Thank you, I think I'm going to use the ancient type to keep the computer from attacking, and set the aquisation range of all the melee heros in my map to 1 to deal with the players. As for the use of chaos, I guess I decided to use it because I had been tinkering with it alot lately and it was the first thing that came to mind, completly forgot about metamorphosis (which is what i've now decided to use). ++rep

@Sajin - I've decided to take the easy way out for now, but if it doesnt work out I'll try using your trigger; thanks +rep

@Inevit4ble - You can change a unit back by using a different chaos ability that will change the changed unit into the original unit. Thanks for your input.

@GFreak45 - Yeah, I think the ancient type is going to work perfectly when dealing with computer units, thanks

@MP - It is a one hero per person map, and that is an interesting idea, I'll have to try that; Thanks for the input.

P.S. If I have any other questions regarding this ability, should i continue them on this thread or start a new one?
 

MP®

Member
Reaction score
11
@Accname - Thank you, I think I'm going to use the ancient type to keep the computer from attacking, and set the aquisation range of all the melee heros in my map to 1 to deal with the players. As for the use of chaos, I guess I decided to use it because I had been tinkering with it alot lately and it was the first thing that came to mind, completly forgot about metamorphosis (which is what i've now decided to use). ++rep

@Sajin - I've decided to take the easy way out for now, but if it doesnt work out I'll try using your trigger; thanks +rep

@Inevit4ble - You can change a unit back by using a different chaos ability that will change the changed unit into the original unit. Thanks for your input.

@GFreak45 - Yeah, I think the ancient type is going to work perfectly when dealing with computer units, thanks

@MP - It is a one hero per person map, and that is an interesting idea, I'll have to try that; Thanks for the input.

P.S. If I have any other questions regarding this ability, should i continue them on this thread or start a new one?
You might like the map I am currently working on :)
 

Smitty

Member
Reaction score
20
If the questions are about the same kind of problems, probably just post them here rather than spamming the board :)
 
General chit-chat
Help Users

      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