Jump to content
Sign in to follow this  
ffak

Showmap only one player

Recommended Posts

I've got a 4 human players rifle squad.

I want showmap true for only 1 player, the others showmap false

Is it possible?

thx! smile.gif

Share this post


Link to post
Share on other sites

This disables map from everyone else except unit named mapDude:

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

~0.1

if (player == mapDude) then {showmap true;} else {showmap false;}

<span id='postcolor'>

run this at mission startup, for example from init.sqs

Share this post


Link to post
Share on other sites

and if I want to custom that, is that code correct?

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

if ((player == mapDude) hasweapon "M16") then {showmap true;} else {showmap false;}<span id='postcolor'>

Share this post


Link to post
Share on other sites

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

if ((player == mapDude) and (mapDude hasweapon "M16")) then {showmap true;} else {showmap false;}

<span id='postcolor'>

Share this post


Link to post
Share on other sites

wow.gif6--></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Bart.Jan @ Jan. 04 2003,21wow.gif6)</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">

if ((player == mapDude) and (mapDude hasweapon "M16")) then {showmap true;} else {showmap false;}

~0.1<span id='postcolor'><span id='postcolor'>

it's working fine but the map is blinking..  confused.gif  (because I put showmap=0 in description.ext for starting showmap false)

Share this post


Link to post
Share on other sites

FFAK

If your map is blinking then you must be looping the line constantly. To test, before the ~0.1 put 'Player sidechat "map decision"'

see how often you see that come up. wink.gif

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 (FFAK @ Jan. 05 2003,23:56)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Bart.Jan @ Jan. 04 2003,21wow.gif)</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">

if ((player == mapDude) and (mapDude hasweapon "M16")) then {showmap true;} else {showmap false;}

~0.1<span id='postcolor'><span id='postcolor'><span id='postcolor'>

Hmm.. I don see why it should blink... why did you move the ~0.1 to below the if statement? It shouldn't work at all like that (The delay is there so it gets ran just after the mission is launched, not during briefing after which the map settings seem to get reseted)

Share this post


Link to post
Share on other sites

I must loop the script to check often hif statement have changed (if one player took M16 since mission start)

let's say I've got 3 players, I setup something like that (with showmap=0 in description.ext

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

#scan

~0.1

if ((player == player1) and (player1 hasweapon "M16")) then {showmap true;} else {showmap false;}

if ((player == player2) and (player2 hasweapon "M16")) then {showmap true;} else {showmap false;}

if ((player == player3) and (player3 hasweapon "M16")) then {showmap true;} else {showmap false;}

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

Share this post


Link to post
Share on other sites

How about you make a script like this:

mapMonitor.sqs

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

_player = _this

?(_player != Player):exit;

?(_player hasweapon "M16"):showmap true;goto "SHOWN";

showmap false;

#NOT_SHOWN

@(_player hasweapon "M16")

showmap true;

#SHOWN

@!(_player hasweapon "M16")

showmap false;

goto "NOT_SHOWN";<span id='postcolor'>

Call the script from a players init: this exec "mapMonitor.sqs"

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 @ Jan. 06 2003,00:00)</td></tr><tr><td id="QUOTE">How about you make a script like this:

mapMonitor.sqs

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

_player = _this

?(_player != Player):exit;

?(_player hasweapon "M16"):showmap true;goto "SHOWN";

showmap false;

#NOT_SHOWN

@(_player hasweapon "M16")

showmap true;

#SHOWN

@!(_player hasweapon "M16")

showmap false;

goto "NOT_SHOWN";<span id='postcolor'>

Call the script from a players init: this exec "mapMonitor.sqs"<span id='postcolor'>

there isn't loop in your script, it check one time and it's gone am I wrong?

Share this post


Link to post
Share on other sites

Check @ command in scripting reference. It waits for condition to be true.

There is a loop. See the last line of script. smile.gif

Share this post


Link to post
Share on other sites

FFAK, tu essaies de checker quelle condition pour faire apparaitre la map?

A la limite, réponse sur TS wink.gif

Sorry for french, but easier for us to use it....

Whis'

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 (whisperFFW06 @ Jan. 06 2003,19:51)</td></tr><tr><td id="QUOTE">FFAK, tu essaies de checker quelle condition pour faire apparaitre la map?

A la limite, réponse sur TS wink.gif

Sorry for french, but easier for us to use it....

Whis'<span id='postcolor'>

Seul le porteur d'une arme donnée a la carte visible. Les autres non.

Only the choosen weapon carrier has showmap true.The other players' not.

Share this post


Link to post
Share on other sites

What are you working on, an OICW weapon system type mission? smile.gif

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 @ Jan. 06 2003,20:46)</td></tr><tr><td id="QUOTE">What are you working on, an OICW weapon system type mission?   smile.gif<span id='postcolor'>

A 'nam type mission wink.gif

only the radio (sebprc25) carrier has the map...

In real life, each member of the rifle squad have not a map ..

Share this post


Link to post
Share on other sites

Ok I found a way:

here is my scan script

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

~0.1

if ((player == ap1) and (ap1 hasweapon "sebprc25")) then {showmap true;} else {showmap false;}

if ((player == ap2) and (ap2 hasweapon "sebprc25")) then {showmap true;} else {showmap false;}

~10

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

I tested it on multiplayer and its work fine... for player ap2 but not for player ap1 when ap1 is the host sad.gif

I don't know why it's not working for the host....any suggestion?

(I didn't try on a dedicated server)

Share this post


Link to post
Share on other sites

I have a similar problem. I have in init.sqs :

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

? cadetMode : showMap false

<span id='postcolor'>

and it shows map all the time regardless of difficulty.

I didn't try on a dedicated server too.

Share this post


Link to post
Share on other sites

Bart, make sure to put a nice fat ~1 in the init.sqs, or call it from the init field of some unit on the map.

I figure the description.ext takes priority, if not than the default takes priority after the init has run... confused.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  

×