Jump to content
Sign in to follow this  
Espectro (DayZ)

Getting a units position

Recommended Posts

Hi there.

I need to get a units position, the unit is named P1.

After that, i need to place another unit at the same place (both height and x and y coordinates), this unit is called S1

can some1 please help me ?

Share this post


Link to post
Share on other sites

ok, thanks alot...

But i got a nother problem.

How do i create a smokeshell?

I try and use "camcreate smokeshell getpos p1"

not working sad.gif

Share this post


Link to post
Share on other sites
Guest

the syntax is:

_shell = "smokeshell" camcreate getpos p1

Share this post


Link to post
Share on other sites

Cool, thanks it works... now the next problem (*drumroll*)

How do i make that smokeshell move along the unit p1 ?

Share this post


Link to post
Share on other sites

do a loop with setpos getpos. But Im not sure if it works since a smokeshell is kind of a fire and forget weapon (meaning you use it and thats it (the "object" aint there anymore). Kind of like trying to move an explosion). Though Im totally unsure, never tried it before smile.gif

Share this post


Link to post
Share on other sites
Guest

As a script, I'll draw out the basics, you can then adjust it to your needs.

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

; fsmoke.sqs

; [targetUnit, followTime] as input

; i.e [p1,10] = exec "fsmoke.sqs"

_targetUnit = this select 0

_imax = this select 1

; index variable

_i = 0

; update interval (seconds) for instance here 0.1 s

_ui = 0.1  

; max follow time

_imax = _imax/_ui

;create the smokeshell

_shell = "smokeshell" camcreate getpos targetUnit

# loop

;move the smoke

_shell setpos getpos targetUnit

;wait update interval

~_ui

; if we are done go to end label

?(_i >= _imax):goto "end"

;else increase i

_i = _i+1

; loop

goto "loop"

# end

exit

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

I havn't tried it but it should work.

Share this post


Link to post
Share on other sites

Okay... This is my script, can u tell me if anything wrong with it (cant test it here)

It is supposed to make a plane smoke and even engine failure if its damaged:

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

#check

?(targetUnit getdammage <= 0.3):goto "check"

_shell = "smokeshell" camcreate getpos targetUnit

Enginevar = 1

#loop

_shell setpos getpos targetUnit

~0.1

?(targetUnit getdammage = 1):goto "end"

?(targetUnit getdammage >= 0.7):goto "engine"

goto "loop"

#engine

?(Enginevar = 0):goto "loop"

Enginevar = 0

targetUnit setfuel 0

targetUnit setfuel 0.1

targetUnit setfuel 0

targetUnit setfuel 0.1

targetUnit setfuel 0

goto "loop"

#end

exit

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

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×