yes. I have been able to make it look good over flat ground. But if the unit should jump from cliff to cliff, you can't move him to the position that os not pathable. Anyway, I abandoned that project, so it's not nagging me anymore :)
You could simply say that you have to be able to walk in a somwhat straight line to the target point (check pathing cost)
Just stumbled over a trigger, and I thought of you :)
Set Unit State
It looks like you can set the ignore terrain height flag in there
I doubt it will make ground units behave like air units for pathing though, so if u plan to have some ability to jump to a targeted area, possibly over unpathable area, then it probally wont help. I have toyed a bit with such an ability before. Never really got something I was satisfied with.
If you dont use photoshop, perhaps you can find a tool online that can convert between tga and dds. Found a bunch of results by searching google for tga to dds converter.
The correct way to refference the field would be
Catalog - Set value of Units "Medivac" "FlagArray[IgnoreTerrainZInit]" for player 1 to "1"
however, this is one of those fields that cannot be written. So the best way I can think of to achive what you want is to dublicate your unit, set one of them to ignore terrain height, and then replace one unit with the other when needed. Or you can use one that ignore terrain height, and then use the trigger "Change Unit Height", to simulate the flag being off.
The easy way to damage a unit is to just set the unit property (life) to something less then what it currently have. However, this does not give anyone credit for the kill, so a better way would be to use a damage effect from the data editor. So make a damage effect.. I called it Trigger Damage. Then you can make a function like this.
DamageUnit
Options: Action
Return Type: (None)
Parameters
target = No Unit <Unit>
source = No Unit <Unit>
ammount = 0.0 <Real>
Grammar Text: DamageUnit(target, source, ammount)
Hint Text: (None)
Custom Script Code
Local Variables
Actions
Catalog - Set value of Effects "TriggerDamage" "Amount" for player (Owner of source) to (String(ammount) with Any Precision decimal places)
Environment - Execute Trigger Damage on target from source
As for the repairs.. You can issue orders to units with a trigger. You will need to specify that it is an order targeting a unit (press the blue "("). Then you can select scv - repair, and set the target.
Untitled Trigger 001
Events
Game - Map initialization
Local Variables
Conditions
Actions
Unit - Set Command Center [160.50, 135.50] Life to 500.0
------- //Repairing costs money
Player - Modify player 1 Minerals: Set To 1000
Unit - Order SCV [154.75, 135.93] to (SCV - Repair targeting Command Center [160.50, 135.50]) (Replace Existing Orders)
So you will need to make something similar in the marine actor. He doesn't have a work animation, but perhaps you could use his "Stand Ready" animation.
For the green effect, you could make a trigger like this
Poison tint
Events
Unit - Any Unit uses Poison at Generic6 - Complete stage (Ignore shared abilities)
Local Variables
Conditions
Actions
Actor - Send actor message (Set Tint Color (0%, 100%, 0%) with HDR 1.0 over 0.0 seconds) to main actor of unit (Triggering ability target unit)
General - Wait 5.0 Game Time seconds
General - If (Conditions) then do (Actions) else do (Actions)
If
((Triggering ability target unit) has Poisioned) == true
Then
General - Wait 0.5 Game Time seconds
General - If (Conditions) then do (Actions) else do (Actions)
If
((Triggering ability target unit) has Poisioned) == true
Then
General - Skip remaining actions
Else
Else
Actor - Send actor message (Set Tint Color (100%, 100%, 100%) with HDR 1.0 over 0.0 seconds) to main actor of unit (Triggering ability target unit)
The extra 0.5 sec wait is just because the buff duration is 5 sec, and im not sure if i can be sure that it is always over when the trigger has waited 5 sec.
As for the attack animation. Add an event for the actor of the caster:
I would not use a weapon. Instead, you could use a comination effects
For instance
A unit purchases a weapon.
You apply a persistent effect corrosponding to that weapon. The period durations should be the weapon cooldown, and it should just have 65535 periods. As a periodic validator, you check that the unit still have the weapon.
This persistent then call a search area effect, which finds an enemy, and calls a launch missile effect which on impact, calls a damage effect.
I haven't tested it, but I belive it should work (except adding multiple weapons of the same type might be problematic if you will be able to remove them again).
Otherwise, you could scrap the persistent, and use a trigger instead to apply the search area effect.
If you click your unit, the top most field is a list of abilities on the unit. Add the ability you created to that list.. And if there is no Queue ability on the list, add Queue(5) aswell.
Hmm. you want a trigger that cycle through every player color of active players?
I assume you want it to be on a pr unit basis.
Random color
Events
Unit - Any Unit Enters Region 001
Local Variables
player = 0 <Integer>
Conditions
Actions
Variable - Set player = (Integer((Custom value 0 of (Triggering unit))))
Variable - Set player = ((player + 1) mod (Number of players in (Active Players)))
Unit - Set (Triggering unit) custom value 0 to (Real(player))
Unit - Set (Triggering unit) team color to (Current player (Player (player + 1) from (Active Players)) color)
I dont know if there is an easy way of doing it, but we could do the hard way. First of all, you can set camera position to be center of the unit group consisting of the two units. Then you can set the camera height offset to the avrage distance from the ground + the base height you want to be at.
Just missing the distance then..
If you look at the triangle formed by the camera and the two units. Then emagine that triangle cut in half from the camera viewpoint to the center of your units.. Then you get two new triangles. One side in that triangle is the distance we want to find. The other is half the distance between your units. One of the angles is 90 degrees, so we just need to know one more thing about the triangle, and that is the angle at which the camera is watching (Field of view). we can look that up for our camera - its about 37. So using the sine relations a/sin(A)=b/sin(B) we get
cameraDistance = (Distance between units * sin(90 - camera field of view / 2)) / (2 * sin(camera field of view / 2))
You might want to calculate this for the y and z axis seperatly, and take the greatest distance of the two. Or you could just take the distance in two dimensions - it might zoom the camera a bit more out then required though.
Ofcourse this would need to be ajusted as the units move around (try to not update the camera when it is not needed, to reduce lag)
Hmm. try removing Liberty Multi (Mod) and Liberty Story (Campaign) in the depencies if you have those added.. Might work (dont know why, but I had a similar problem where that worked)
Random color
Events
Unit - Any Unit Enters Region 001
Local Variables
Conditions
Actions
Unit - Set (Triggering unit) team color to (Current player (Random integer between 0 and 15) color)
Actor - Send actor message (Set Tint Color (Color((Random percent)%, (Random percent)%, (Random percent)%, 100.0%)) with HDR 1.0 over 0.0 seconds) to main actor of unit (Triggering unit)
Edit: You can get more random team colors with a similar actor message
Actor - Send actor message (SetTeamColor (Color((Random percent)%, (Random percent)%, (Random percent)%)) (Color((Random percent)%, (Random percent)%, (Random percent)%))) to main actor of unit (Triggering unit)
First, go to the buttons tab in the data editor, and create a button. Here you select the image of the button, and the tooltip..
Then, you need to make an ability to train the unit. If you want the unit to be trainable from a building that can already train other units, you can modify the train ability for that building. Otherwise you can just make your own.
To make your own, go to the abilities tab, and create a Train ability. On that ability, look on the Info+ field -> Train 01. Then you can set a default button at the top of the window, and the unit at the buttom of the window. Also, the training time is just above where you add the unit.
Next, you need to find the building where you want to train the unit, and add the ability you just created. If the building doesnt have a queue ability added, you can add Queue (5) aswell.
Then, open the command card of the building. Add a new button. Find the button you created initially, then set Command type to Ability Command, Requirements to (none), Ability to the train ability you created, and then you should be able to find your unit under ability command
0
yes. I have been able to make it look good over flat ground. But if the unit should jump from cliff to cliff, you can't move him to the position that os not pathable. Anyway, I abandoned that project, so it's not nagging me anymore :)
You could simply say that you have to be able to walk in a somwhat straight line to the target point (check pathing cost)
0
Just stumbled over a trigger, and I thought of you :)
Set Unit State
It looks like you can set the ignore terrain height flag in there
I doubt it will make ground units behave like air units for pathing though, so if u plan to have some ability to jump to a targeted area, possibly over unpathable area, then it probally wont help. I have toyed a bit with such an ability before. Never really got something I was satisfied with.
0
I use a plugin for photoshop that can save in dds format.. http://developer.nvidia.com/object/photoshop_dds_plugins.html
If you dont use photoshop, perhaps you can find a tool online that can convert between tga and dds. Found a bunch of results by searching google for tga to dds converter.
0
The correct way to refference the field would be
Catalog - Set value of Units "Medivac" "FlagArray[IgnoreTerrainZInit]" for player 1 to "1"
however, this is one of those fields that cannot be written. So the best way I can think of to achive what you want is to dublicate your unit, set one of them to ignore terrain height, and then replace one unit with the other when needed. Or you can use one that ignore terrain height, and then use the trigger "Change Unit Height", to simulate the flag being off.
What are you trying to achive?
0
The easy way to damage a unit is to just set the unit property (life) to something less then what it currently have. However, this does not give anyone credit for the kill, so a better way would be to use a damage effect from the data editor. So make a damage effect.. I called it Trigger Damage. Then you can make a function like this.
DamageUnit
Options: Action
Return Type: (None)
Parameters
target = No Unit <Unit>
source = No Unit <Unit>
ammount = 0.0 <Real>
Grammar Text: DamageUnit(target, source, ammount)
Hint Text: (None)
Custom Script Code
Local Variables
Actions
Catalog - Set value of Effects "TriggerDamage" "Amount" for player (Owner of source) to (String(ammount) with Any Precision decimal places)
Environment - Execute Trigger Damage on target from source
As for the repairs.. You can issue orders to units with a trigger. You will need to specify that it is an order targeting a unit (press the blue "("). Then you can select scv - repair, and set the target.
Untitled Trigger 001
Events
Game - Map initialization
Local Variables
Conditions
Actions
Unit - Set Command Center [160.50, 135.50] Life to 500.0
------- //Repairing costs money
Player - Modify player 1 Minerals: Set To 1000
Unit - Order SCV [154.75, 135.93] to (SCV - Repair targeting Command Center [160.50, 135.50]) (Replace Existing Orders)
0
For all stuff related to the display of units/effects in game.. look for actors ;)
The nova actor has two events related to the snipe ability
Abil.NovaSnipe.SourceCastStart
AnimBracketStart Spell Work, Start Work Work, End
Abil.NovaSnipe.SourceCastStop
AnimBracketStop Spell
So you will need to make something similar in the marine actor. He doesn't have a work animation, but perhaps you could use his "Stand Ready" animation.
0
For the green effect, you could make a trigger like this
Poison tint
Events
Unit - Any Unit uses Poison at Generic6 - Complete stage (Ignore shared abilities)
Local Variables
Conditions
Actions
Actor - Send actor message (Set Tint Color (0%, 100%, 0%) with HDR 1.0 over 0.0 seconds) to main actor of unit (Triggering ability target unit)
General - Wait 5.0 Game Time seconds
General - If (Conditions) then do (Actions) else do (Actions)
If
((Triggering ability target unit) has Poisioned) == true
Then
General - Wait 0.5 Game Time seconds
General - If (Conditions) then do (Actions) else do (Actions)
If
((Triggering ability target unit) has Poisioned) == true
Then
General - Skip remaining actions
Else
Else
Actor - Send actor message (Set Tint Color (100%, 100%, 100%) with HDR 1.0 over 0.0 seconds) to main actor of unit (Triggering ability target unit)
The extra 0.5 sec wait is just because the buff duration is 5 sec, and im not sure if i can be sure that it is always over when the trigger has waited 5 sec.
As for the attack animation. Add an event for the actor of the caster:
Abil.Poison.ScourceCastStart
Anim Pllay Attack Attack
0
I would not use a weapon. Instead, you could use a comination effects
For instance
A unit purchases a weapon.
You apply a persistent effect corrosponding to that weapon. The period durations should be the weapon cooldown, and it should just have 65535 periods. As a periodic validator, you check that the unit still have the weapon.
This persistent then call a search area effect, which finds an enemy, and calls a launch missile effect which on impact, calls a damage effect.
I haven't tested it, but I belive it should work (except adding multiple weapons of the same type might be problematic if you will be able to remove them again).
Otherwise, you could scrap the persistent, and use a trigger instead to apply the search area effect.
0
If you click your unit, the top most field is a list of abilities on the unit. Add the ability you created to that list.. And if there is no Queue ability on the list, add Queue(5) aswell.
0
Hmm. you want a trigger that cycle through every player color of active players?
I assume you want it to be on a pr unit basis.
Random color
Events
Unit - Any Unit Enters Region 001
Local Variables
player = 0 <Integer>
Conditions
Actions
Variable - Set player = (Integer((Custom value 0 of (Triggering unit))))
Variable - Set player = ((player + 1) mod (Number of players in (Active Players)))
Unit - Set (Triggering unit) custom value 0 to (Real(player))
Unit - Set (Triggering unit) team color to (Current player (Player (player + 1) from (Active Players)) color)
0
The ability isnt on the list? If you added the ability to the unit first, it should be one of the top ones in the list.
0
I dont know if there is an easy way of doing it, but we could do the hard way. First of all, you can set camera position to be center of the unit group consisting of the two units. Then you can set the camera height offset to the avrage distance from the ground + the base height you want to be at.
Just missing the distance then..
If you look at the triangle formed by the camera and the two units. Then emagine that triangle cut in half from the camera viewpoint to the center of your units.. Then you get two new triangles. One side in that triangle is the distance we want to find. The other is half the distance between your units. One of the angles is 90 degrees, so we just need to know one more thing about the triangle, and that is the angle at which the camera is watching (Field of view). we can look that up for our camera - its about 37. So using the sine relations a/sin(A)=b/sin(B) we get
cameraDistance = (Distance between units * sin(90 - camera field of view / 2)) / (2 * sin(camera field of view / 2))
You might want to calculate this for the y and z axis seperatly, and take the greatest distance of the two. Or you could just take the distance in two dimensions - it might zoom the camera a bit more out then required though.
Ofcourse this would need to be ajusted as the units move around (try to not update the camera when it is not needed, to reduce lag)
0
Hmm. try removing Liberty Multi (Mod) and Liberty Story (Campaign) in the depencies if you have those added.. Might work (dont know why, but I had a similar problem where that worked)
0
Hmm. do you mean player color or tint color?
Done both here
Random color
Events
Unit - Any Unit Enters Region 001
Local Variables
Conditions
Actions
Unit - Set (Triggering unit) team color to (Current player (Random integer between 0 and 15) color)
Actor - Send actor message (Set Tint Color (Color((Random percent)%, (Random percent)%, (Random percent)%, 100.0%)) with HDR 1.0 over 0.0 seconds) to main actor of unit (Triggering unit)
Edit: You can get more random team colors with a similar actor message
Actor - Send actor message (SetTeamColor (Color((Random percent)%, (Random percent)%, (Random percent)%)) (Color((Random percent)%, (Random percent)%, (Random percent)%))) to main actor of unit (Triggering unit)
0
First, go to the buttons tab in the data editor, and create a button. Here you select the image of the button, and the tooltip..
Then, you need to make an ability to train the unit. If you want the unit to be trainable from a building that can already train other units, you can modify the train ability for that building. Otherwise you can just make your own.
To make your own, go to the abilities tab, and create a Train ability. On that ability, look on the Info+ field -> Train 01. Then you can set a default button at the top of the window, and the unit at the buttom of the window. Also, the training time is just above where you add the unit.
Next, you need to find the building where you want to train the unit, and add the ability you just created. If the building doesnt have a queue ability added, you can add Queue (5) aswell.
Then, open the command card of the building. Add a new button. Find the button you created initially, then set Command type to Ability Command, Requirements to (none), Ability to the train ability you created, and then you should be able to find your unit under ability command