Home   Help Search Login Register  

Author Topic: Moving Map Icon  (Read 1095 times)

0 Members and 1 Guest are viewing this topic.

BARO

  • Guest
Moving Map Icon
« on: 25 May 2003, 23:25:52 »
I'm trying to make a mission for me and my friends where one team is a bunch of hunters or soldiers or anything really,  and the other team is a civilian or something to that extent.  They start about a town away from eachother, and the whole island is full of empty vehicles,  ammo boxes,  that sort of thing.  The goal is for the hunted to survive for a period of time to win.

As the game is open to the whole island, and there is nothing stopping the hunted to get in a car,  drive accross the island, and hide in a bush, I wanted a way to see in what area the hunted is in.  I don't want something as specific as an exact location,  rather just the general area.  Perhaps which grid they are in.

Is there any way to do this?  What would be the easiest way to implement something to give the hunters "hints" or rough directions to where the hunted is?

BARO

  • Guest
Re:Moving Map Icon
« Reply #1 on: 25 May 2003, 23:41:18 »
Ok I've been trying and trying some various ways and think I'm onto something.  I've got it set up so that when the hunter team radios alpha, it gets the position of "hunted" and what I'm trying to do now is make it to change the map icon "icony" so that location.

I would be happy to do it either way:

either the hunted team radios alpha,  and the map icon changes to the location of "hunted" unit

or

every 1 min or so,  the map icon automaticaly changes

or ever time you radio alpha,  it would simply give a textual location of the unit (ie "target is at Gh 09")

I'm SURE this is do-able,  just that my skill with scripts isn't good enough

deaddog

  • Guest
Re:Moving Map Icon
« Reply #2 on: 26 May 2003, 05:35:47 »
One way to do this would be to find the position of the hunted player and then add a random value to its x and y position:

#loop
_px=(getpos hunted select 0) + (random 1000) -500
_py=(getpos hunted select 1) + (random 1000) -500

"huntedmarker" setmarkerpos [_px,_py]

~5
goto "loop"


Replace "huntedmarker" with the name of the marker you are using to track to hunted player.  This will set the marker somewhere within 500 meters (x and y) of the actual position of the player.  Change the numbers to get the distance you like.

There is also a code snippet in the tutes section that will give you the map coordinates, ie FA57, or whatever.

BARO

  • Guest
Re:Moving Map Icon
« Reply #3 on: 26 May 2003, 08:41:47 »
I just get an error when I try to put this in.  Also.. what does all of that mean?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Moving Map Icon
« Reply #4 on: 26 May 2003, 10:47:20 »
What deaddog is suggesting is that you run a looping script throughout the mission.   (So you don't need radio alpha.)     The script displays a marker on the map showing the location of the hunted player.    This position updates every 5 seconds (~5), which I think is a bit too often - I would suggest updating every minute.

However, if the map shows the correct postition of the hunted it will be too easy for the hunters.    So the script actually places the marker at a random position in the general area of the hunted.

(In fact the way it currently is the marker will always be north east of the hunted .... so make it  ....(random 500)-500 at the end.     You will need to playtest those numbers till you find the right size.)

If you don't understand any of the commands (eg random) look them up in the command reference.    If you're getting an error, tell us what it is.    If there is something you don't understand, just point out which part it is and we'll find a better way of explaining it. :)
Plenty of reviewed ArmA missions for you to play

BARO

  • Guest
Re:Moving Map Icon
« Reply #5 on: 26 May 2003, 20:32:28 »
Well mainly I don't know where to put this.  Do I just copy and paste all of that starting with the # and put it in the units init field?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Moving Map Icon
« Reply #6 on: 27 May 2003, 11:51:00 »
lol sorry, we should have been clearer.   No, do not put it in an init field.   What you need is a little script.

If you're not sure how to do this there are lots of good tutes in the Ed Depot:  start with snYpir's Friendly Intro to Code snippets and Johan Gustafsson's Scripting tute.

The summary is, create a text file with notepad.   Call it marker.sqs (ensure it is not marker.sqs.txt).   Put it in the mission folder next to the mission.sqm.    Copy and past this into the file
    ; this script makes a marker appear near the postion of the hunted unit
    ; thanks to deaddog and macguba at OFPEC for help with this script

    #loop

    ? not (alive hunted):exit

    _px=(getpos hunted select 0) + (random 500) - (random 500)
    _py=(getpos hunted select 1) + (random 500) - (random 500)

    "huntedmarker" setmarkerpos [_px,_py]

    ~30

    goto "loop"

    exit

Now name the unit that is to be hunted .... call him hunted.   In his init line write

[] exec "marker.sqs"

Now create a marker and name it huntedmarker.

That should be it.   If it doesn't work try playing with it a bit.   You will need to do plenty of playtesting to see if 500m is any good, you might need a bigger or smaller number.

If you get stuck by all means come back here and ask, but please spend some time with the tutes and command reference first - if you understand what all this means you'll be able to fix it yourself if it's wrong, and make it better if its working.
Plenty of reviewed ArmA missions for you to play