• 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.

Problem with Transform

Status
Not open for further replies.
Level 11
Joined
Jun 2, 2004
Messages
849
The movement speed you specify in triggers is absolute, not relative. You're not adding 200 movement speed, you're setting the unit's movement speed to 200. Presumably the unit's base movement speed is higher than 200, so it goes slower after the trigger runs.

Same goes for the size part.
 
Level 25
Joined
May 11, 2007
Messages
4,650
Create 4 variables: transform_index (integer, NO array) transform_size (real array)
transform_group_up (unit group) and transform_group_down

Pseudo code cuz I'm lazy, and it uses custom value of the unit, replace with hashtable if you don't want to use custom value.
Two triggers for increasing and decreasing unit size:

Transform_size_up: time - every 0.03 seconds

For each unit in transform_group_up
{
set variable transform_size[unit custom value of picked unit] = transform_size[unit custom value of picked unit] + 1
animation set size of picked unit to transform_size[unit custom value of picked unit] (x, y, z)
if (set variable transform_size[unit custom value of picked unit]) > 150
{
unit group remove picked unit from transform_group_up
//Size is increased enough!
}
}

Transform_size_down: time - every 0.03 seconds
For each unit in transform_group_down
{
set variable transform_size[unit custom value of picked unit] = transform_size[unit custom value of picked unit] + 1
animation set size of picked unit to transform_size[unit custom value of picked unit] (x, y, z)
if (set variable transform_size[unit custom value of picked unit]) <= 100
{
unit group remove picked unit from transform_group_down
//Size is increased enough!
}
}

------
Change your transform trigger
set transform_index = transform_index + 1
set the custom_value of (triggering unit) to transform_index
add the unit to the transform_group_up unit group, then when you want the unit to decrease in size add them to the
Transform_size_down trigger
 
Level 5
Joined
Jul 27, 2017
Messages
73
upload_2017-8-23_15-24-12.png


That should be his code for the first size up:

Transform_size_up: time - every 0.03 seconds

For each unit in transform_group_up
{
set variable transform_size[unit custom value of picked unit] = transform_size[unit custom value of picked unit] + 1
animation set size of picked unit to transform_size[unit custom value of picked unit] (x, y, z)
if (set variable transform_size[unit custom value of picked unit]) > 150
{
unit group remove picked unit from transform_group_up
//Size is increased enough!
}
}

The code i posted is also with simple variables and not with Arrays.

upload_2017-8-23_15-36-43.png


And this is the part

set transform_index = transform_index + 1
set the custom_value of (triggering unit) to transform_index
add the unit to the transform_group_up unit group


I´m sorry for some german text
Einheitengruppe = unitgroup
Größer als = greater than

the variable transform_size has to be from type real
As I see now in the first line the "Units in (Playable map area)"-part should be replaced with "transform_group_up"


I hope that it works
 

Attachments

  • upload_2017-8-23_15-11-45.png
    upload_2017-8-23_15-11-45.png
    118.4 KB · Views: 88
  • upload_2017-8-23_15-12-41.png
    upload_2017-8-23_15-12-41.png
    16.5 KB · Views: 101
Status
Not open for further replies.
Top