Home   Help Search Login Register  

Author Topic: MP and weather  (Read 2667 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
MP and weather
« on: 22 Apr 2007, 19:39:13 »
Well im doing a bit of MP scripting and i hate it  :D

I've got a small problem - I have a trigger which is radio alpha and has the code...

Code: [Select]
0 setovercast 0; 0 setrain 1
The condition is set as

Code: [Select]
This and player == leader player
Because i only want the trigger to be activated by squad leaders. However i have been told (by people testing the mission) that the weather isnt noticeable for all players but is only done to the leader of the group.

So how can I get this so that only the leader can activate it (there are more then one squads and therefore more then one leader) and so it shows on everyones machine.

Also is it possible to remove the radio on the map screen from anyone who is not a leader. In OFP this worked by doing this...

Code: [Select]
? !(player == leader group player) : showradio false
But as expected it doesnt work in ArmA.

Thanks a lot.

Offline WhisperOFP

  • Members
  • *
  • I'm a llama!
Re: MP and weather
« Reply #1 on: 23 Apr 2007, 22:12:12 »
setOvercast, setRain and setFog only effect the local computer, their effect is not transmitted over network.
So you need to signify the weather change in your trigger by a variable that you publicVariable, and ONLY THEN, with another trigger that awaits this variable change, you will change the weather.
This way, when condition are met (which can be true on 1 computer only, meaning the weather changes would only be done on this computer), the variable is broadcasted, and every computer see the variable change and change the weather accordingly.
So, your radio alpha trigger should have code
Code: [Select]
changeWeather = true; publicVariable "changeWeather"And you have a second trigger with condition
Code: [Select]
changeWeatherand with code
Code: [Select]
0 setovercast 0; 0 setrain 1

Offline 456820

  • Contributing Member
  • **
Re: MP and weather
« Reply #2 on: 24 Apr 2007, 17:13:22 »
Thanks a lot. Shall give it a go.

Edit - Also any ideas on the show radio thing?

I have tried just showradio = false which acording to the comref should work but doesnt work in SP or MP?

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: MP and weather
« Reply #3 on: 24 Apr 2007, 17:29:20 »
Does it not work in SP?
urp!

Offline 456820

  • Contributing Member
  • **
Re: MP and weather
« Reply #4 on: 24 Apr 2007, 17:37:07 »
Doesn't appear to. I want it so only the leader of each group (names cant be done here as the leader may not always be the officer) to have access to the radio but if you are not the squad leader then I want the radio to be hidden so they cant mess about with artillery and other controls.