HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

New to triggers, size problem.

06-13-2004, 05:05 PM#1
DnStalker
Hey everyone, I'm making a map where there's a hero called Soul Beast, and the idea is that when it attacks it gets stronger and bigger. So I made a trigger called Soul Beast Grow that looks like this:

Events
Unit - A unit owned by Player 10 (Light Blue) Is attacked
Unit - A unit owned by Player 10 (Light Blue) Dies

Conditions
(Attacking unit) Equal to Soul Beast 0000 <gen>

Actions
Animation - Change Soul Beast 0000 <gen>'s size to ((100.00 + 1.00)%, (100.00 + 1.00)%, (100.00 + 1.00)%) of its original size
Hero - Modify Strength of Soul Beast 0000 <gen>: Add 1
Hero - Modify Agility of Soul Beast 0000 <gen>: Add 1
Hero - Modify Intelligence of Soul Beast 0000 <gen>: Add 1

The idea of the trigger is to make it so when the Soul Beast kills a unit he gets 1 of each stats and 1% bigger each time. There are two key problems though:

1. He gets +1 to all stats whenever he attacks a unit
2. He goes to 1% more than the original size of a ghoul and doesn't grow anymore.

Could someone please point me in the right direction and solve my problems? Thanks in advance!
06-13-2004, 07:14 PM#2
th15
Okay, let's go over some basics first.

Events: EVERY event you put here will cause the trigger to run. In this case your trigger will run when two things happen. You probably added these two events here because your train of thought was chronological (i.e. "A unit is attacked then a unit dies, so i'll put both in") but you must realise that all triggers happen, barring wait actions, INSTANTANEOUSLY. The game does not do ANYTHING until it has finished processing a single trigger.

If you want the beast to grow only when he kills a unit, the correct event to use here is "Unit - A unit owned by Player 10 (Light Blue) Dies". Otherwise you want to keep the other event. But either way, you want to have only one event. Very few triggers that you do will actually have more than 1 event.

Conditions: For triggers, at least 1 condition must be true for it to run the rest of the trigger. However, if a condition refers to something that CANNOT be true (for example, if you used a condition that checked if casting unit equal to attack unit, the trigger would never run) it will not run. In your above trigger, your condition will prevent the "Unit - A unit owned by Player 10 (Light Blue) Dies" from ever running the trigger because of the incorrect condition (your condition will check for attacking unit when only dying unit is applicable).

Actions: You've got the stats increase correct (I don't see why you list it as a problem). However, what your size trigger is doing is repeatedly setting its size to 101%. What you need to do is create an Real variable to keep track of the Soul Beast's size. You can edit and create variables I the variables menu (accesible by clicking the yellow X at the top of the trigger window). Each time you want to increase the size of the Soul Beast, you want to "Set variable SoulBeastSize = SoulBeastSize + 1" In order to do the "SoulBeastSize + 1" bit you'll use the arithmetic function (its the default when you click to assign the value). Your resize trigger will be changed to "Animation - Change Soul Beast 0000 <gen>'s size to ((SoulBeastSize)%, (SoulBeastSize)%, (SoulBeastSize)%) of its original size"

In summary, your completed trigger would look something like this:

Code:
Melee Initialization
    Events
        Unit - A unit owned by Player 10 (Light Blue) Dies
    Conditions
        (Killing unit) Equal to Soul Beast 0000 <gen>
    Actions
        Set SoulBeastSize = (SoulBeastSize + 1.00)
        Animation - Change Soul Beast 0000 <gen>'s size to (SoulBeastSize%, SoulBeastSize%, SoulBeastSize%) of its original size
        Hero - Set Agility Soul Beast 0000 <gen> to (Agility of Soul Beast 0000 <gen> (Exclude bonuses)), (Permanent or Temporary:Permanent)
        Hero - Set Intelligence ofSoul Beast 0000 <gen> to ((Intelligence of Soul Beast 0000 <gen> (Exclude bonuses)) + 1), (Permanent or Temporary:Permanent)
        Hero - Set Agility ofSoul Beast 0000 <gen> to ((Agility of Soul Beast 0000 <gen> (Exclude bonuses)) + 1), (Permanent or Temporary:Permanent)
        Hero - Set Strength ofSoul Beast 0000 <gen> to ((Strength of Soul Beast 0000  <gen> (Exclude bonuses)) + 1), (Permanent or Temporary:Permanent)

Note that i did the trigger in WEU so it might differ slightly from what you see. But you'll notice that i use arithmetic functions a lot. BTW make sure that eh SoulBeastSize Real variable has its "initial value" set to 100.
06-13-2004, 07:50 PM#3
DnStalker
Wow, thanks a lot! it works now and thanks for teaching me some basics :)
11-13-2004, 10:07 PM#4
Guest
Hi, I am working on this trigger to make a unit grow over about 10 seconds into an adult. I am not really sure how to set up the trigger.

I am making an Alien vs Predator map for tft
What happends is a unit get facehugged or posses then it die and a baby alien is created...
I want the baby alien to gradualy grow into an adult
The trigger looks like this
Unit - A unit enters (Entire map)
(Unit-type of (Entering unit)) Equal to Alien
Animation - Change (Triggering unit)'s size to (100.00%, 100.00%, 100.00%) of its original size

but how do i make it so that it grows to that exact size gradually over a certain amount of time? about 10 seconds preferably
11-13-2004, 10:08 PM#5
Guest
I want the alien to gradualy grow into an adult
The trigger looks like this
Unit - A unit enters (Entire map)
(Unit-type of (Entering unit)) Equal to Alien
Animation - Change (Triggering unit)'s size to (100.00%, 100.00%, 100.00%) of its original size

but how do i make it so that it grows gradually over a certain amount of time? about 10 seconds preferably And maybe have its life start at 100 and then gradually increase to the amount of it unit default
so that the alien is weak and can be killed easily when it is born.
But when it is has grown into an adult it has its regular stength.
How would i do that? please help
I need help