Home   Help Search Login Register  

Author Topic: Markers and Locality  (Read 1556 times)

0 Members and 1 Guest are viewing this topic.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Markers and Locality
« on: 21 Apr 2008, 23:05:46 »
Hi all.

I'm going crazy with these new local commands for markers. In a Deathmatch I want OPFOR markers to be hidden from BLUFOR and viceversa. The solution I have doesn't seem to work. Does anyone have any ideas why? The markers are placed in editor and unfortunatly shows on all computers regardless of the players side. :weeping: The "serverpos" is a position that is broadcasted through publicVariable from the server. The markers are then on a loop to track your friendly AI groups.

Important question: Do the local marker commands only work if they are created locally in a script and not placed in the editor?

###init.sqs###

? local player AND side player == east : goto "east"

? local player AND side player == west : goto "west"


#east

"westmapmarker" setmarkertypelocal "Empty"
"wm1" setmarkertypelocal "Empty"
"wm2" setmarkertypelocal "Empty"
"wm3" setmarkertypelocal "Empty"
"wm4" setmarkertypelocal "Empty"
"wm5" setmarkertypelocal "Empty"
"wm6" setmarkertypelocal "Empty"
"wm7" setmarkertypelocal "Empty"
"wm8" setmarkertypelocal "Empty"
"wm9" setmarkertypelocal "Empty"
"wm10" setmarkertypelocal "Empty"

goto "eastloop"


#west

"eastmapmarker" setmarkertypelocal "Empty"
"em1" setmarkertypelocal "Empty"
"em2" setmarkertypelocal "Empty"
"em3" setmarkertypelocal "Empty"
"em4" setmarkertypelocal "Empty"
"em5" setmarkertypelocal "Empty"
"em6" setmarkertypelocal "Empty"
"em7" setmarkertypelocal "Empty"
"em8" setmarkertypelocal "Empty"
"em9" setmarkertypelocal "Empty"
"em10" setmarkertypelocal "Empty"
"eastammo1" setmarkertypelocal "Empty"
"eastammo2" setmarkertypelocal "Empty"

goto "westloop"


#westloop

"wm1" setmarkerposlocal wm1serverpos
"wm2" setmarkerposlocal wm2serverpos
"wm3" setmarkerposlocal wm3serverpos
"wm4" setmarkerposlocal wm4serverpos
"wm5" setmarkerposlocal wm5serverpos
"wm6" setmarkerposlocal wm6serverpos
"wm7" setmarkerposlocal wm7serverpos
"wm8" setmarkerposlocal wm8serverpos
"wm9" setmarkerposlocal wm9serverpos
"wm10" setmarkerposlocal wm10serverpos

~ 1

goto "westloop"



#eastloop

"em1" setmarkerposlocal em1serverpos
"em2" setmarkerposlocal em2serverpos
"em3" setmarkerposlocal em3serverpos
"em4" setmarkerposlocal em4serverpos
"em5" setmarkerposlocal em5serverpos
"em6" setmarkerposlocal em6serverpos
"em7" setmarkerposlocal em7serverpos
"em8" setmarkerposlocal em8serverpos
"em9" setmarkerposlocal em9serverpos
"em10" setmarkerposlocal em10serverpos

~ 1

goto "eastloop"


###end-init.sqs###

Please help!!!

Cheers

Laggy
« Last Edit: 21 Apr 2008, 23:07:57 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Markers and Locality
« Reply #1 on: 22 Apr 2008, 00:33:32 »
Well, AFAIK, to use local markers visible only to a player you need to use createMarkerLocal command. So, you may check the side of a player in the init.sqf, and create "his" local markers. Of course you will need to move the markers also locally.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Markers and Locality
« Reply #2 on: 28 Apr 2008, 15:01:34 »
I think you can use the local commands on global (editor-placed) markers in order to make different people see the markers in different ways. Sure I've done that myself, but if Mandoble thinks not, then I might be wrong (Haven't time to scour though my missions to check this out). Either way, what I'm going to say should give you more of a chance to get it right, since you are making some simple MP errors in your script.

You don't wait until the player has synchronised properly before running the script, so that you always do one version (this happens to default to EAST, since both of the ?s will not work, since the player is not valid yet) of the script. Although in SP, the value of player is set at the start of the mission, in MP it won't get set right away. You also gain nothing by checking if player is local or not, since it is either objNull (not set yet) which is not local, or
Code: (Check that the value of player has been set before using it) [Select]
@ not (isNull player)

? side player == east : goto "east"

? side player == west : goto "west"

When you move on to update the marker positions, you also need to check that the values have been synchronised. Wait until the value has been defined (is not nil), before starting the loop up (this actually isn't critical in this case, since even if the first couple of loops fail because the values are nil, it will correct itself once the values are received).
Code: (Check that the data has been received first, before starting the loop (to get to it, use goto "updateMarkerPositionsEast")) [Select]
#updateMarkerPositionsEast

; If you know that all of the marker positions have been sent at once, you only need to check if one of them
; is valid and can assume the rest are OK.
@ not (isNil "em1serverpos")

#eastloop
"em1" setmarkerposlocal em1serverpos
...etc...

~ 1

goto "eastloop"

When you are makeing side-specific markers such as these, you also should set all of the markers to "empty" in the editor and only make visible those that the player can see in your script. What you are doing is showing all initially (so everyone will see all the markers at the very start of the mission for a fraction of a second) and hiding those that cannot be seen. Hope you can see why that might be confusing to players.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Markers and Locality
« Reply #3 on: 28 Apr 2008, 18:16:56 »
Thanks alot Spooner.

The @ ! (IsNull player) thing was completely unknown to me.

Another quick question... I hope.

Is there a simple and quick way for you to describe what problems you face on a dedi server rather than a player server? Meaning what kind of mistakes can you miss in your mission making if you haven't tested it on a dedi?

Thanks again.

Laggy
« Last Edit: 28 Apr 2008, 18:19:01 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Markers and Locality
« Reply #4 on: 28 Apr 2008, 19:55:22 »
Well, there have been a lot of threads on this topic recently (search for MP and JIP). Sadly, since this is a complex subject, I can't give a short answer here. Perhaps you will find some of the information you need in the MP tutorial?
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline ferstaberinde

  • Members
  • *
  • I'm a llama!
Re: Markers and Locality
« Reply #5 on: 19 May 2008, 19:51:28 »
@ Laggy - Download the latest version of BAS f (see http://community.bistudio.com/wiki/BAS_f) and have a look at the ShackTac unit / fireteam markers scripts. They work using local markers which are side-specific, and the scripts themselves are heavily commented (and in SQF format). Hope that helps.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Markers and Locality
« Reply #6 on: 20 May 2008, 22:50:27 »
thanks.

laggy
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.