Jump to content
Sign in to follow this  
JAP

How can i ... mark a unit with realtime marker

Recommended Posts

Hey all,

I ve got this mission to rescue a downed pilot.

I was wondering how i can make the position of the pilot's movement visible on the map with a marker ?

Marker should mark the realtime movement of the pilot.

Cheers and thx upfront.

smile.gif

/edit

Some more info.

This is for a co op, so marker should be visible for everybody ingame. ( west )

Share this post


Link to post
Share on other sites

You have some options, in cadet mode you can use a reveal unit loop to each group that should see this on map.

Otherwise you create a quick setMarkerPos loop. smile.gif

Ok ok, so I think you will ahve more complicated questions.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (bn880 @ 01 May 2003,19:26)</td></tr><tr><td id="QUOTE">You have some options, in cadet mode you can use a reveal unit loop to each group that should see this on map.

Otherwise you create a quick setMarkerPos loop.  smile.gif

Ok ok, so I think you will ahve more complicated questions.<span id='postcolor'>

Lol BN880,

Somehow i knew who was gonna answer my question smile.gif

I m no scripting hero, so could you tell me how ....

Last thing i need to finish this mission.

Thx upfront.

Share this post


Link to post
Share on other sites

M113marker.sqs

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">#loop

"M113marker" setMarkerPos [(getpos M113Ambulance select 0), (getpos M113Ambulance select 1), 1]

~0.5

goto "loop"<span id='postcolor'>

Unit's init.field

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">[] exec "M113marker.sqs"<span id='postcolor'>

Change the names of the stuff so that it fits your mission.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (iNeo @ 01 May 2003,19:44)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">#loop

"M113marker" setMarkerPos [(getpos M113Ambulance select 0), (getpos M113Ambulance select 1), 1]

~0.5

goto "loop"<span id='postcolor'>

M113marker is the name of the marker. M113Ambulance is the name of the unit. Change as you like. tounge.gif<span id='postcolor'>

Ok,

And what s the name of my unit confused.gif?

.................

tounge.gif

Thx neo, thx bn880 you made me a happy man ( ok, my wife did some work too .... )

Share this post


Link to post
Share on other sites

Edited my post to make it a bit clearer hehe

Share this post


Link to post
Share on other sites

Thx neo,

Works like a charm.

But then you already know cause we already beta tested it smile.gif

Cheers

Share this post


Link to post
Share on other sites

Ok all, this was the only area of the forum that was talking about realtime markers. I created a script that does this same function in a MP mission I am designing (WMD+Everon).

content of my EastMarker.SQS

#PlayerEastMarkers

"EastCommanderMarker" setmarkerpos getpos EastCommander

~0.5

goto "PlayerEastMarkers"

Player Init

[player]exec "EastMArker.SQS"

This works in MP mode up an until I die and respawn? When I respawn the marker stays where I died. Why this stumped me...since the players init would/should re-execute the SQS again. What am I missing?

sad.gif

Any help would be appreciated....

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (SoloZone @ 09 May 2003,00:55)</td></tr><tr><td id="QUOTE">Ok all, this was the only area of the forum that was talking about realtime markers. I created a script that does this same function in a MP mission I am designing (WMD+Everon).

content of my EastMarker.SQS

#PlayerEastMarkers

"EastCommanderMarker" setmarkerpos getpos EastCommander

~0.5

goto "PlayerEastMarkers"

Player Init

[player]exec "EastMArker.SQS"

This works in MP mode up an until I die and respawn? When I respawn the marker stays where I died. Why this stumped me...since the players init would/should re-execute the SQS again. What am I missing?

sad.gif

Any help would be appreciated....<span id='postcolor'>

What if you execute the script from another unit, like a gamelogic or something?

Share this post


Link to post
Share on other sites

iNeo, we had it in a Flag unit (under Init) but same issue. After looking at the script again, we realized that once the player dies and respawned, it does not retain the player name variable that was assigned in its init (ie EastCommander = this), the body stays on the map with the name. Thus the script will not move the marker over the newly respawned player.

I think we have narrowed it down to that, so the question is now how do you assign the same name or move the name to the new respawned player? We are going to test deleting the man (deletevehicle _player) :

#Deadplayer

~35

deletevehicle _player

~0.5

player = EastCommander

~1

_Marker setmarkerpos [(getpos player select 0), (getpos player select 1)]

~1

_player = player

Share this post


Link to post
Share on other sites

The technical issue behind this is, you save or pass the current Player object to an object variable. When the Player dies, the object you have saved will not change.

Simple solution is to use Player all the time (no extra processing). Not save it to another variable.

Share this post


Link to post
Share on other sites

I use a script like this and execute it only on the client side for each player.

; positions.sqs

; usuage [] exec "positions.sqs"

@alive player

?(side player == west): Goto "Loop_West"

?(side player == east): Goto "Loop_east"

#Loop_West

~.1

_unit = W1; _mark = "Pos_W1"

?(!alive _unit):_mark setmarkerpos [0,0]

?(alive _unit):_mark setmarkerpos [getpos _unit select 0,getpos _unit select 1]

_unit = W2; _mark = "Pos_W2"

?(!alive _unit):_mark setmarkerpos [0,0]

?(alive _unit):_mark setmarkerpos [getpos _unit select 0,getpos _unit select 1]

_unit = W3; _mark = "Pos_W3"

?(!alive _unit):_mark setmarkerpos [0,0]

?(alive _unit):_mark setmarkerpos [getpos _unit select 0,getpos _unit select 1]

_unit = W4; _mark = "Pos_W4"

?(!alive _unit):_mark setmarkerpos [0,0]

?(alive _unit):_mark setmarkerpos [getpos _unit select 0,getpos _unit select 1]

~1

Goto "Loop_West"

#Loop_east

~.1

_unit = E1; _mark = "Pos_E1"

?(!alive _unit):_mark setmarkerpos [0,0]

?(alive _unit):_mark setmarkerpos [getpos _unit select 0,getpos _unit select 1]

_unit = E2; _mark = "Pos_E2"

?(!alive _unit):_mark setmarkerpos [0,0]

?(alive _unit):_mark setmarkerpos [getpos _unit select 0,getpos _unit select 1]

_unit = E3; _mark = "Pos_E3"

?(!alive _unit):_mark setmarkerpos [0,0]

?(alive _unit):_mark setmarkerpos [getpos _unit select 0,getpos _unit select 1]

_unit = E4; _mark = "Pos_E4"

?(!alive _unit):_mark setmarkerpos [0,0]

?(alive _unit):_mark setmarkerpos [getpos _unit select 0,getpos _unit select 1]

~1

Goto "Loop_east"

Share this post


Link to post
Share on other sites

hoz, thanks, but you may want to check your script.That wont work..... how are you identifying which player is assigned the names of W1...W4?

BN880. You gave me some ideas and I went to go implement them. My script got a lot worse and I went back to scratch....this was my original script that worked fine in non-MP mission and for MP before you die and respawn. Can you do me a favor and recode based on your input? I am on my 4th day...and I will give you all the credit on the start page of my MP map called WMD+Everon.....

Each East player has init :

EastCommander=this; [this] exec "EastMarkers.sqs"

....AlphaLeader=this...

...

EastMarkers.SQS

#PlayerEastMarkers

"EastCommanderMarker" setmarkerpos getpos EastCommander

"EastAlphaMarker" setmarkerpos getpos EastAlphaLeader

"EastBravoMarker" setmarkerpos getpos EastBravoLeader

"EastCharlieMarker" setmarkerpos getpos EastCharlieLeader

"EastDeltaMarker" setmarkerpos getpos EastBravoLeader

"EastEchoMarker" setmarkerpos getpos EastEchoLeader

"EastFoxTrotMarker" setmarkerpos getpos EastFoxTrotLeader

goto "PlayerEastMarkers" smile.gif

Share this post


Link to post
Share on other sites

The script I use works. Each player is W1, W2, E1, E2...etc..

I think your problem is you need to run the script on each unit. The markers have to be updated on each client, markers moved on one client doesn't show on another client.

Markers are identified as Pos_W1, etc....

If its a coop mission with just west players remove the EAST update and save some cpu cycles wink.gif

Hoz

Share this post


Link to post
Share on other sites

Ok, I think I got it for a two player game....well this will work. In the description file set respawn to base and time to 30. (assuming you know the code for that). Put a marker on the map, preferably off and out of the way called P1M & P2M (make it a 'dot' and name it whatever). Hide each marker from each side in the INIT.SQS file.

Create the two players, and put in there Init field:

P1 = this; [] exec "charmarkerP1.sqs"

P2 = this; [] exec "charmarkerP2.sqs"

In the sqs file(s):

#start

?(!(Alive player)): goto "deadplayer"

~1

"P1M" setmarkerpos [(getpos player select 0),(getpos player select1)]; goto "start"

#deadplayer

;the below time should be more than the time set for respawn in Description.sqs

~32

goto "start"

This will not work if you have more than player on your side. It will work if you have 2 player game with one on each side.

Thanks all for your combine info, it truely helped... biggrin.gif

Share this post


Link to post
Share on other sites

(F.Y.I. RTM = RealTime Marker)

Activation Line:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

["yourunit","yourmarker"] exec "RTM.sqs"

In RTM.sqs

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_unit = this select 0

_marker = this select 1

#Loop

~0.05

_marker setmarkerpos _unit

goto "Loop"

Nevermind it doesnt work... iNeos is currently the most efficent.

mad_o.gif

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  

×