• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Chameleon (Anyone know how to do this?)

Status
Not open for further replies.
Level 5
Joined
Jun 18, 2006
Messages
139
In Mortal Kombat there is a character called Chameleon who changes randomly from about 7 different characters, 1 every so many secs.

What I want to know is, how do I do this? I want to make a character that changes randomly (doesn't have to be random) from other certain characters every 30 seconds.
 
Level 3
Joined
May 12, 2006
Messages
35
create 7 diff chars for player

hide 6 of them

creat unit group (blah)
for all (7)

every 30 sec
random number frome 1-7
if 1
hide (current char)
unhide (#1 from group)
move (1) to currentchar

i donno how to change model im newb too but since noone replyed ill give it a shot 4 u

and if u want them to have same exp and every thing just set variables

intiger (lah) = (exp of currentchar char)
add Lah to next current char

sry i can explain it better if u whant
 
Level 27
Joined
Feb 22, 2006
Messages
3,052
Replacing unit would work, besides for a hero. Then it would get complicated.
For then it would have to know all the hero's abilities using 5 variables for each ability learned, then 10 for each level... unless you used arrays, but then multicasting would get downright complcated...
If you have the hero still in play you can do every 1 seconds set level of ability X to level of ability for current hero and stuff like that.
--donut3.5--
 
Level 27
Joined
Feb 22, 2006
Messages
3,052
Daelin said:
I would go for chaos ability. Though you should be careful about it. Once added, you can't remove it. The only way to do it is to add all the chaos abilities to a spellbook and change the level of the spellbook to a random value. It's the best solution.

~Daelin
Actually, you can. Sort of. Give it all the chaos abilities, then make each one require different dummy units and become a different unit then do
Every .01 seconds
Replace (dummy unit) with random unit from (dummy units)

I guess I just thought of that... :)
--donut3.5--
 
Level 2
Joined
Sep 12, 2006
Messages
23
what about this?
Code:
Trigger 1
    Events
        Unit - A unit Sells a unit
    Conditions
        (Unit-type of (Sold unit)) Equal to Chameleon
    Actions
        Unit - Create 1 Chameleon for (Owner of (Buying unit)) at Point facing Default building facing degrees
        Set Chameleon = (Last created unit)
        Set CurrentHero = (Last created unit)
        Unit Group - Add (Last created unit) to ChameleonUnitGroup
        Unit - Create 1 Unit 2 for (Owner of (Buying unit)) at Point facing Default building facing degrees
        Set Unit2 = (Last created unit)
        Unit Group - Add (Last created unit) to ChameleonUnitGroup
        Unit - Hide (Last created unit)
        Unit - Create 1 Unit 3 for (Owner of (Buying unit)) at Point facing Default building facing degrees
        Set Unit3 = (Last created unit)
        Unit Group - Add (Last created unit) to ChameleonUnitGroup
        Unit - Hide (Last created unit)
        Unit - Create 1 Unit 4 for (Owner of (Buying unit)) at Point facing Default building facing degrees
        Set Unit4 = (Last created unit)
        Unit Group - Add (Last created unit) to ChameleonUnitGroup
        Unit - Hide (Last created unit)
        Unit - Create 1 Unit 5 for (Owner of (Buying unit)) at Point facing Default building facing degrees
        Set Unit5 = (Last created unit)
        Unit Group - Add (Last created unit) to ChameleonUnitGroup
        Unit - Hide (Last created unit)
        Unit - Create 1 Unit 6 for (Owner of (Buying unit)) at Point facing Default building facing degrees
        Set Unit6 = (Last created unit)
        Unit Group - Add (Last created unit) to ChameleonUnitGroup
        Unit - Hide (Last created unit)
Code:
Trigger 2
    Events
        Unit - A unit Gains a level
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Triggering unit) Equal to Chameleon
                (Triggering unit) Equal to Unit2
                (Triggering unit) Equal to Unit3
                (Triggering unit) Equal to Unit4
                (Triggering unit) Equal to Unit5
                (Triggering unit) Equal to Unit6
    Actions
        Unit Group - Remove (Triggering unit) from ChameleonUnitGroup
        Unit Group - Pick every unit in ChameleonUnitGroup and do (Hero - Set (Picked unit) Hero-level to ((Hero level of (Picked unit)) + 1), Hide level-up graphics)
        Unit Group - Add (Triggering unit) to ChameleonUnitGroup
Code:
Trigger 3
    Events
        Time - Every 30.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in ChameleonUnitGroup and do (Unit - Hide (Picked unit))
        Set Point = (Position of CurrentHero)
        Set CurrentHero = (Random unit from ChameleonUnitGroup)
        Unit - Move CurrentHero instantly to Point
        Unit - Unhide CurrentHero

Lots and lots of variables, and i havnt tested anything yet, not even sure if this will work.... but imo it should work, im sure theres an easier way.... just my quick solution :D
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
donut3.5 said:
Actually, you can. Sort of. Give it all the chaos abilities, then make each one require different dummy units and become a different unit then do
Every .01 seconds
Replace (dummy unit) with random unit from (dummy units)

I guess I just thought of that... :)
--donut3.5--
The purpose of the chaos ability is to automatically replace the unit, without needing to use the Replace action. I checked its code a lot of times, and it simply removes the initial unit, and creates another unit. Chaos ability does natively this thing much better. The unit should retain its previous selections or selection or whatever, and should not require a lot of coding! Just changing the level of the spellbook and disabling it in an initial trigger. Piece of cake and short!

~Daelin
 
Status
Not open for further replies.
Top