• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Growing effect on upgrades

Status
Not open for further replies.
Level 4
Joined
May 13, 2007
Messages
75
Got a quick question:

I came across the map Bug Evolution a while ago and I was wondering how they did the growing effect upon the upgrade. If you don't know the map, you can upgrade your bug, which works as follows: Once you hit "upgrade" the bug just grows, but not all of a sudden but slowly. When I did it like that, the smaller bug changed automatically to the bigger bug as soon as i hit "upgrade" (both bugs use the same model)

Anybody know the answer on how to achieve that effect?
 
Level 11
Joined
Dec 31, 2007
Messages
780
animation - change unit size to % of its original size

or something like that :p

to acomplish the slow grow (if it is not the skill ady_illidan mentioned) you may do it with a loop in 0.01 seconds wait or periodically
 
Level 4
Joined
May 13, 2007
Messages
75
hmm. how would a loop like that look? (GUI please, I'm a JASS noob)

By the way, sorry for the long response time but hive seemed to be down..?!
 
Level 11
Joined
Dec 31, 2007
Messages
780
yes.. it was down...

well... actually i would encourage you to make it with the skill ady_illidan mentioned... if it doesnt accomplish the effect you want... i may make the trigger for you... but ... as i see it... there are 2 ways... changing units size with periodic events and loops... or... replacing casting unit for a building evolve the building into the new unit and then replace the building for the new unit (wich is gonna be harder but the effect will be easier)

EDIT:

btw... start playing with this

  • Events
    • Time - Every 0.01 seconds of game time
  • Conditions
    • (Ability being cast) Equal to (your growing skill)
  • Actions
    • Animation - Change (Casting unit)'s size to (Size%, Size%, Size%) of its original size
    • Set Size = (Size + 1.00)
set variable "size" with a default value of 100.00 (real variable) and also dont enable this trigger until the cast is activated... with the command "trigger - run (growing trigger <gen>) trigger

once this is done you should re-set the variable value back to 100.00

if it grows too fast change the periodic time to another value 0.05 0.1 1 ... test the one that best fits your desire... also you may change the "Set Size = (Size + 1.00)" to 10.00 , 20.00 , 21.45
 
Last edited:
Level 7
Joined
Mar 16, 2008
Messages
348
Darkrider correct me if i'm wrong, but if im not wrong that trigger doesn't work because the ( Ability being cast ) part is not really usable since the events don't refer to an ability, you would have to make another trigger to turn that trigger off with THAT condition and with the event " A unit starts casting an ability" ( or something like that. Ill post the trigger right away, and like darkrider said try tu use ady_illidan's solution
Edit
First trigger
  • Activate growing trigger
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to (Your Ability)
    • Actions
      • Trigger - Turn on Growing trigger <gen>
Second Trigger( Initially off!!!!)(This trigger credit goes to darkrider!!!)
  • Growing trigger
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Animation - Change (Casting unit)'s size to (Size%, Size%, Size%) of its original size
  • Size = (Size +1.00)
 
Level 11
Joined
Dec 31, 2007
Messages
780
yep Luthion you are wright ... i missed that :p

VERY IMPORTANT! after the growing effect is done TURN GROWING EFFECT TRIGGER OFF if you dont the unit will grow until warcraft crashes

except for that ... the complete trigger is the one Luthion made
 
Level 8
Joined
Jun 25, 2007
Messages
165
Or you can just do (if ability have a buff) and in your trigger you have a mistake:
  • Animation - Change (Casting unit)'s size to (Size%, Size%, Size%) of its original size
the trigger dont know who is the casting unit so use variable for unit.
  • Ability
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Your ability) Equal to TRUE)) and do (Actions)
        • Loop - Actions
          • Animation - Change (Picked Unit) size to (Size%, Size%, Size%) of its original size
          • Set Size = (Size +1.00)
 
Last edited:
Level 11
Joined
Dec 31, 2007
Messages
780
yeah... well... if you see trigger i did it has as casting unit the unit that casts the ability... but i made that mistake... so... when luthion adapted it ... the casting unit remained there...

check that your trigger has a leak ..

unit group leaks... so you need to remove the group after setting it into a variable... ill try to make the whole trigger in a single post... gimme a sec and ill do it

  • casting part of the growing trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Evolution (your ability that makes the unit grow)
    • Actions
      • Set Unit = (Casting unit)
      • Trigger - Turn on (growing effect trigger <gen>)
      • If ((Level of Evolution for (Casting unit)) Equal to 1) then do (Set Wait = 10.00)(the time you want it to last) else do (Do nothing)
      • If ((Level of Evolution for (Casting unit)) Equal to 2) then do (Set Wait = 20.00) else do (Do nothing)
      • If ((Level of Evolution for (Casting unit)) Equal to 3) then do (Set Wait = 30.00) else do (Do nothing)
      • If ((Level of Evolution for (Casting unit)) Equal to 4) then do (Set Wait = 40.00) else do (Do nothing)
      • Wait Wait seconds
      • Trigger - Turn off (growing effect trigger <gen>)

  • growing effect trigger
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Animation - Change (Unit)'s(the variable you setted before) size to (Size%, Size%, Size%) of its original size
      • Size = (Size +1.00)

ok... i guess now it is complete ^^
 
Level 8
Joined
Jun 25, 2007
Messages
165
Yea its complete... so there is two thing you can do:
  • casting part of the growing trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Evolution (your ability that makes the unit grow)
    • Actions
      • Set Unit = (Casting unit)
      • Trigger - Turn on (growing effect trigger <gen>)
      • If ((Level of Evolution for (Casting unit)) Equal to 1) then do (Set Wait = 10.00)(the time you want it to last) else do (Do nothing)
      • If ((Level of Evolution for (Casting unit)) Equal to 2) then do (Set Wait = 20.00) else do (Do nothing)
      • If ((Level of Evolution for (Casting unit)) Equal to 3) then do (Set Wait = 30.00) else do (Do nothing)
      • If ((Level of Evolution for (Casting unit)) Equal to 4) then do (Set Wait = 40.00) else do (Do nothing)
      • Wait Wait seconds
      • Trigger - Turn off (growing effect trigger <gen>)

  • growing effect trigger
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Animation - Change (Unit)'s(the variable you setted before) size to (Size%, Size%, Size%) of its original size
      • Size = (Size +1.00)
OR
  • Ability
  • Events
    • Time - Every 0.10 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Your ability) Equal to TRUE)) and do (Actions)
      • Loop - Actions
        • Animation - Change (Picked Unit) size to (Size%, Size%, Size%) of its original size
        • Set Size = (Size +1.00)
 
Level 4
Joined
May 13, 2007
Messages
75
Thanks for all the responses but at the current stae I would say Elven God's Trigger hit the nail on the head. Although that way the unit would have a ABILITY rather than an UPGRADE right that would trigger the function since it is looking for a certain BUFF.

EDIT:

Got it two work using two seperate Triggers:

  • Upgrade
    • Events
      • Unit - A unit Begins an upgrade
    • Conditions
    • Actions
      • Unit - Create 1 Special Caster for Neutral Passive at (Position of (Triggering unit)) facing Default building facing (270.0) degrees
      • Unit - Order (Last created unit) to Human Priest - Inner Fire (Triggering unit)
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
  • Upgrade Effect
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)(((Matching unit) has buff Inner Fire ) Equal to True)) and do (Actions)
        • Loop - Actions
          • Animation - Change (Picked unit)'s size to (Size%, Size%, Size%) of its original size
          • Set Size = (Size + 0.50)



But I have one more problem: When the unit upgrades it plays its alternate animation (because buildings alternates are the upgrade one blah bla blah). The question is: how can I disable that?

Thanks for all the help I have gotten so far :thumbs_up:

Second Edit: @darkrider: I don't want it to just become bigger, I want it to really upgrade and while upgrading become bigger. But thenaks anyways, got it to work using a combination of yours and Elven_Gods triggers. +rep to you both! But what about my next problem?
 
Level 4
Joined
May 13, 2007
Messages
75
What's that supposed to mean?

Got two more questions:
1. When the unit upgrades it plays its alternate animation. How can I disable that?
2. What would the trigger have to look like if I wanted to make "Size" a local variable so that I can run more instances of evolving at the same time? It should be like everytime a unit evolves, a new instance of the trigger "Upgrade Effect" is created.
 
Level 4
Joined
May 13, 2007
Messages
75
You know how in JASS a trigger can have local variables? I want the variable "Size" to be such a local variable so that i can have more than one bug evolve at the same time. Because the way it is now, if two bugs evolve at the same time, they will grow twice as fast because the trigger will fire twice thus adding twice the amount to "Size"
 
Level 7
Joined
Mar 16, 2008
Messages
348
yep i think it is, try doing this:
Trigger
bla bla bla
actions
Custom Script: Local integer size


I believe that works , if you want to make it string or whatever just change it, but i think what you want is integer, good luck!
 
Level 22
Joined
Feb 26, 2008
Messages
891
A better way is to make some global in the Variable editor.
Let's say TempInt. Then, in your trigger:

  • Custom script: local integer udg_TempInt
Then, you can use the normal GUI Set Variable function, and it will be fooled into using your local variable. :grin:

Of course, if you try to do unit group loops, ifs, etc., you can have some problems.
 
Level 7
Joined
Mar 16, 2008
Messages
348
=P Ghan_04 I'm completely not a jass expert and not even begginer i just stumbled upon that in some tutorial, but just to inform spudnik, if he wanted to change my variable(local integer size) he would to do another custom script like:
Custom Script: set size = size + 1.00
And thats it, but maybe Ghan's solution is more effective
 
Level 4
Joined
May 13, 2007
Messages
75
@ Luthion: I don't think so because the variable is local, but will be treated as global, meaning that it can just be a normal trigger and doesn't have to be custom script
 
Level 7
Joined
Mar 16, 2008
Messages
348
Custom script is used inside normal triggers, there is an action called Custom Script in which you can insert a single line of jass.
 
Status
Not open for further replies.
Top