Jump to content

set unit damage script


Veteran66

Recommended Posts

 

i find this script from Grimes:

local pos = Unit.getByName('myUnit'):getPosition().p
pos.x = pos.x + 20
pos.y = pos.y + 3
pos.z = pos.z + 20
trigger.action.explosion(pos, 200) 

Link:

but i get a error

What is wrong?

 

 

Screenshot (56).png


Edited by Veteran66
Link to comment
Share on other sites

@Veteran66, try this :

 

local ExplodeThis = Unit.getByName('myUnit'):getPoint()
trigger.action.explosion(ExplodeThis, 200) 

 

Just re-read your post.... You can adjust the explosion power to adjust amount of damage... What exactly are you trying to go for?

The error you encounter seems to be you have not put the correct unitname into the script.  

Link to comment
Share on other sites

thy for your answers.

I make a Mission "attack airfield" after this attack there will be a second attack Mission.

so i need some destroy Static Airplanes around the Airfield.

 

with the Actions "Unit Explosion" all Static Plane have the same damage (look not realistic)

so my idea a explosion on the side of the Object. with the script i can out different coordinades so i get (i hope so) different damages on my static Planes.

but this script work not for Static Objeckts

 

-----------------------------------------

 

local pos = Unit.getByName('myUnit'):getPosition().p
pos.x = pos.x + 20
pos.y = pos.y + 3
pos.z = pos.z + 20
trigger.action.explosion(pos, 200)

-------------------------------------------

 

i try "StaticObject.getByName" too

 

 

(sorry for my bad english)

 

First Mission:

https://www.digitalcombatsimulator.com/en/files/1969649/

 

here a Pictures from the first attack:

 

Screen_201224_085410.png


Edited by Veteran66
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...