WARNING: The forum is now in read-only mode as we will soon be transitioning to different forum software. Feel free to join our Discord server in the meantime.
TheSergeantArc
Posts:142
Joined:Thu Apr 25, 2013 7:52 am
Weather change Server-Side, HELP!

Thu Nov 27, 2014 10:37 pm

Where can I change it. I tried to change the state in dist/linux/levels/mp_005/level-00/levels/MP_005.dbx, but nothing happens.

Nasipal
Posts:222
Joined:Wed Oct 08, 2014 7:49 pm
Location:Ukraine

Re: Weather change Server-Side, HELP!

Sat Dec 13, 2014 8:00 pm

On server side you can only disable weather. Search in level (MP_XXX.dbx ) WeatherStateEntityData it will have field "Enabled">true<" put there false and you'r server will run this level with out weather. In some case it is not bad - no fog, more view distance but some maps like ATACAMA DESERT look's ugly with out it. To change state of weather you need to open ONLY client file, for example "D:\Program Files (x86)\Origin Games\Battlefield Bad Company 2\Package\levels\mp_005\level-00 FbRB" put in search "WeatherStateEntityData" find states field and swith from 3 (if i am not wrong) to 4. And you will see difference now. You can join to any server and play with out weather or with other state of it (atacama is have bad weather defoult state, try to find out what you like better from 1 to 24 states). P.s. i use state 4 also 7 is not bad.

Nasipal
Posts:222
Joined:Wed Oct 08, 2014 7:49 pm
Location:Ukraine

Re: Weather change Server-Side, HELP!

Fri Nov 02, 2018 11:46 am

Nasipal wrote:On server side you can only disable weather. Search in level (MP_XXX.dbx ) WeatherStateEntityData it will have field "Enabled">true<" put there false and you'r server will run this level with out weather. In some case it is not bad - no fog, more view distance but some maps like ATACAMA DESERT look's ugly with out it. To change state of weather you need to open ONLY client file, for example "D:\Program Files (x86)\Origin Games\Battlefield Bad Company 2\Package\levels\mp_005\level-00 FbRB" put in search "WeatherStateEntityData" find states field and swith from 3 (if i am not wrong) to 4. And you will see difference now. You can join to any server and play with out weather or with other state of it (atacama is have bad weather defoult state, try to find out what you like better from 1 to 24 states). P.s. i use state 4 also 7 is not bad.


Additional: If map have couple exist weather states: "type="GameSharedResources.WeatherStateEntityData">"
like on atakama mp_005gr it can be changed during gameplay by "Events Connections" scripts.

By default weather state is changed in End of round by this script:


Code: Select all

            </complex>
         </complex>
         <complex>
            <field ref="9e83abe4-ca96-414a-8c11-c6d5916c534e" name="Source" />  // - Source of event
            <field ref="c277ed68-c48a-4101-8d26-875a6ba22746" name="Target" />  //-Weather State GUID
            <complex name="SourceEvent">
               <field name="Name">OnImpulse</field>
               <field name="Id">0</field>
            </complex>
            <complex name="TargetEvent">
               <field name="Name">Enable</field>
               <field name="Id">0</field>
            </complex>
         </complex>
         <complex>


But we can make some more transitions. For Example:
When first m-com objects are destoyed, some trigger enable second combat area. So this event can be used. If I search combat area 2 GUID, I can find it in events, This event launches a combat area:


Code: Select all

            </complex>
         </complex>
         <complex>
            <field name="Source" ref="c8fcfc44-acd3-47ad-a871-15fb7452bf62" />  //-Trigger (what we will use)
            <field name="Target" ref="3e13ef3a-ab18-421d-987a-56acf99c52cc" /> //- Combat Area
            <complex name="SourceEvent">
               <field name="Name">OnTrigger</field>
               <field name="Id">0</field>
            </complex>
            <complex name="TargetEvent">
               <field name="Name">Enable</field>
               <field name="Id">0</field>
            </complex>
         </complex>
         <complex>


Now just need to add few lines to disable old weather and enable new:


Code: Select all

            </complex>
         </complex>
         <complex
            <field ref="c8fcfc44-acd3-47ad-a871-15fb7452bf62" name="Source" /> //-What will disable Weather State
            <field ref="14cae926-4757-485a-bf1f-4cefd3be68a1" name="Target" />//-Your DEF Weather State GUID
            <complex name="SourceEvent">
               <field name="Name">OnTrigger</field>
               <field name="Id">0</field>
            </complex>
            <complex name="TargetEvent">
               <field name="Name">Disable</field>
               <field name="Id">0</field>
            </complex>
         </complex>
         <complex
            <field ref="c8fcfc44-acd3-47ad-a871-15fb7452bf62" name="Source" />//-What will enable Weather State
            <field ref="c277ed68-c48a-4101-8d26-875a6ba22746" name="Target" />//-Your "New" Weather State GUID
            <complex name="SourceEvent">
               <field name="Name">OnTrigger</field>
               <field name="Id">0</field>
            </complex>
            <complex name="TargetEvent">
               <field name="Name">Enable</field>
               <field name="Id">0</field>
            </complex>
         </complex>
         <complex>



you can make a lot of events!!! not only with weather! try to make experiments to find out power of it :idea:


Objects can be destroyed:

Code: Select all

            </complex>
         </complex>
         <complex>
            <field name="Source" ref="GUID" />
            <field name="Target" ref="GUID" />
            <complex name="SourceEvent">
               <field name="Name">OnEnabled</field>
               <field name="Id">0</field>
            </complex>
            <complex name="TargetEvent">
               <field name="Name">Destroy</field>
               <field name="Id">0</field>
            </complex>
         </complex>
         <complex>
            <field name="Source" ref="GUID" />
            <field name="Target" ref="GUID" />
            <complex name="SourceEvent">
               <field name="Name">OnEnabled</field>
               <field name="Id">0</field>
            </complex>
            <complex name="TargetEvent">
               <field name="Name">Destroy</field>
               <field name="Id">0</field>
            </complex>
         </complex>
         <complex>


SourceEvent>TargetEvent even can have same guids in some cases and it work.

Return to “Modifications”

Who is online

Users browsing this forum: No registered users and 10 guests