Home   Help Search Login Register  

Author Topic: Display the position of a certain unit (update every 5 seconds)  (Read 451 times)

0 Members and 1 Guest are viewing this topic.

KoffeK

  • Guest
I'm using the positioning-script by SoftEgg, and here's what I want to do:

A group of units (leader's name is "play12") is being chased by some enemies.
It's a multiplyer mission, and I want the enemies (east side) to get the position of "play12" every 5 seconds.
This is my script this far:

Trigger in game:

Activated "once", "present" by "east".

Init: [Getpos play12 select 0, GetPos Play12 select 1] exec "position.sqs"


position.sqs:


_xpos = _this select 0
_ypos = _this select 1

_letters = ["Aa","Ab","Ac","Ad","Ae","Af","Ag","Ah","Ai","Aj","Ba","Bb","Bc","Bd","Be","Bf","Bg","Bh","Bi","Bj","Ca","Cb","Cc","Cd","Ce","Cf","Cg","Ch","Ci","Cj","Da","Db","Dc","Dd","De","Df","Dg","Dh","Di","Dj","Ea","Eb","Ec","Ed","Ee","Ef","Eg","Eh","Ei","Ej","Fa","Fb","Fc","Fd","Fe","Ff","Fg","Fh","Fi","Fj","Ga","Gb","Gc","Gd","Ge","Gf","Gg","Gh","Gi","Gj","Ha","Hb","Hc","Hd","He","Hf","Hg","Hh","Hi","Hj","Ia","Ib","Ic","Id","Ie","If","Ig","Ih","Ii","Ij","Ja","Jb","Jc","Jd","Je","Jf","Jg","Jh","Ji","Jj"]
_numbers = ["99","98","97","96","95","94","93","92","91","90","89","88","87","86","85","84","83","82","81","80","79","78","77","76","75","74","73","72","71","70","69","68","67","66","65","64","63","62","61","60","59","58","57","56","55","54","53","52","51","50","49","48","47","46","45","44","43","42","41","40","39","38","37","36","35","34","33","32","31","30","29","28","27","26","25","24","23","22","21","20","19","18","17","16","15","14","13","12","11","10","09","08","07","06","05","04","03","02","01","00"]

?_xpos<0 or _xpos>12800:_xcoor="??";goto "Ycoor"

_xcoor = _letters select ((_xpos-64)/128)

#Ycoor

?_ypos<0 or _ypos>12800:_ycoor="??";goto "ShowXYcoor"

_ycoor = _numbers select ((_ypos-64)/128)

#ShowXYcoor

hint format ["%1%2", _xcoor, _ycoor]

~5


(activate the trigger again, how?)



This script displays the map coords (eg. Dh12) of unit "play12".
The problem is, I can't make it update its position. I need a command that
activates the trigger after 5 seconds,
thus going through the whole getpos thing and displaying it again.
I tried entering "trigger=true" (without the quotes) in the init field,
that didn't work. It didn't work when I entered it in the script either..

Anyone who knows what to do? I started scripting yesterday, so I'm a total newbie at it..


« Last Edit: 26 Jan 2003, 13:01:32 by KoffeK »

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
y dont just

make a script dat wil call dis script every five secs ? (and i think dat hint every 5 secs is dengerous 2 ppl :P)

so da script goes like dat

#loop
[Getpos play12 select 0, GetPos Play12 select 1] exec "position.sqs"
~5
goto "loop"

tada ;) hint every 5 secs ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

KoffeK

  • Guest

Excellent!

Exactly what I was looking for!

Thanks.