Home   Help Search Login Register  

Author Topic: Mapcoord updater  (Read 564 times)

0 Members and 1 Guest are viewing this topic.

Offline Blanco

  • Former Staff
  • ****
Mapcoord updater
« on: 17 Feb 2005, 09:08:43 »
I tried this by myself, but I couldn't write it, it seems to be easy tho... :-\

Here is the deal :

There is a script that shows the mapcoords in a hint,chat or radio message . Find it HERE

What I want is that those mapcoords automatically are displayed each 30 sec or so but only if the leader of your group moves into a new sector.
So the first time the script runs, the coords should be shown because you need something to compare.
I was thinking about putting these coords into an array like _coords1
, wait 30sec, check the coords again and put them into another array like _coords2, compare each element of the two arrays and when the are the same don't display thez coords on screen.
So only when the coords are different.

Each element in the arrays are strings.

eg : ["BF","15"]

I think there is problem with comparing the strings with eachother...

Some ideas?




 









 
« Last Edit: 17 Feb 2005, 09:09:59 by Blanco »
Search or search or search before you ask.

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Mapcoord updater
« Reply #1 on: 22 Feb 2005, 23:27:46 »
Sure, wouldn't string1 ==/!= string2 do the job? That works just fine in other circumstances, for example:
?format["%1",undefinedvari] == "scalar bool array string 0xfcfffef"

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:Mapcoord updater
« Reply #2 on: 23 Feb 2005, 01:21:54 »
Yes - you can compare the strings, it's the arrays that you can't - you have to compare each element individually, e.g.

?((_coord1 Select 0) != (_coord2 Select 0)): Goto "hesmoved"

I may be overcompensatin with the brackets.

Flash of baseless inspiration: unless someone's done a function to do it . . .

Offline Blanco

  • Former Staff
  • ****
Re:Mapcoord updater
« Reply #3 on: 23 Feb 2005, 07:32:49 »
thx, ACF thats exactly what I did, it doesn't work.

I want this script to get more automatic communication between AI friendly groups. If you know in what sector the objective takes place, other teams could inform you where they are: like
"This is team Bravo, Moving into sector GH-23"

Or even more : ... and we have 9 men left...

Such information could be very usefull in the field and I'm pretty sure it's possible.  :-\



« Last Edit: 23 Feb 2005, 07:57:08 by Blanco »
Search or search or search before you ask.

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:Mapcoord updater
« Reply #4 on: 23 Feb 2005, 19:20:19 »
Try this - I think it does what you want, albeit at 5s intervals to prevent boredom setting in.  The string comparisons are working here as they should.

I've based it on softegg's script (pretty good that one) so it should be easier to follow.  I have got a script that is most of the way to spoken coordinates. It's a different structure that would only need 20 samples instead of 200, but I'll save that for another time!

The generic sitrep script you seem to be hinting at sounds a good idea, though.

Offline Blanco

  • Former Staff
  • ****
Re:Mapcoord updater
« Reply #5 on: 23 Feb 2005, 21:39:03 »
Quote
spoken coordinates

 :wow:

Thx, I try it ASAP!

**edit**
Works great and it was easy :)  no need to use arrays at all.
Sometimes the solution is so easy that you can't see it...
20 samples...
From A to H  and from 0 to 9 ?




« Last Edit: 26 Feb 2005, 04:35:34 by Blanco »
Search or search or search before you ask.