Author Topic: Arch3r OS: Random weather for multiplayer gamemodes (fixed)  (Read 5293 times)

0 Members and 1 Guest are viewing this topic.

Arch3r

  • Grandmaster Knight
  • *
  • >:I
    • View Profile
  • Faction: Rhodok
  • MP nick: CoR_Arch3r
  • M&BWBNW
Works now
Very simple to implement: Random weather effects (rain is still broken it seems :/) for multiplayer! It generates random fog and a random day time (dawn, noon or night).
Just place these commons in module_mission_templates and add them to the "multiplayer_##" templates to have random weather with that gametype.

I've placed these commons after
Code: [Select]
common_siege_assign_men_to_belfry = (
  0, 0, ti_once,
  [
    (call_script, "script_cf_siege_assign_men_to_belfry"),
    ], [])

Commons to add:
(click to show/hide)
Add them by adding
Code: [Select]
common_random_multiplayer_weather,and below that:
Code: [Select]
common_random_multiplayer_weather_client,and below that:
Code: [Select]
common_random_multiplayer_weather_server,
To complete it, add the following below
Code: [Select]
multiplayer_event_return_max_num_bots                         = 106 in header_commons:

Code: [Select]
##Arch3r OS
multiplayer_event_return_weather                              = 110
multiplayer_event_return_day_time                             = 111
multiplayer_event_return_fog                                  = 112
##Arch3r OS

And finally add in module_scripts, above
Code: [Select]
         (try_end),
     ]),

  # script_cf_multiplayer_evaluate_poll
:
Code: [Select]
#Arch3r
        (else_try),
          (eq, ":event_type", multiplayer_event_return_weather),
          (store_script_param, ":value", 3),
          (store_script_param, ":value2", 4),
          (assign, "$rain_strength", ":value"),
          (assign, "$fog_dist", ":value2"),
        (else_try),
          (eq, ":event_type", multiplayer_event_return_day_time),
          (store_script_param, ":value", 3),
          (assign, "$day_time", ":value"),
#Arch3r

« Last Edit: May 06, 2010, 06:57:26 PM by Arch3r »
                                                                                           

Slenderpeasants,
the evil minions of the Bonerlords

Arch3r

  • Grandmaster Knight
  • *
  • >:I
    • View Profile
  • Faction: Rhodok
  • MP nick: CoR_Arch3r
  • M&BWBNW
Re: Arch3r OS: Random weather for multiplayer gamemodes (broken)
« Reply #1 on: May 05, 2010, 11:45:16 AM »
Managed to fix it, will update it tonight or so. One bug is that the player would have to disconnect and reconnect for it to work properly, but after that he will get the correct weather on each map. I still need to see if there's a solution for that.
                                                                                           

Slenderpeasants,
the evil minions of the Bonerlords

Harmast

  • Master Knight
  • *
    • View Profile
  • Faction: Nord
  • WF&S
Re: Arch3r OS: Random weather for multiplayer gamemodes (broken)
« Reply #2 on: May 05, 2010, 11:54:28 AM »
Rain might work if set_global_cloud_amount is set to 100 first. I can't remember whether set_global_haze_amount needed to be set as well.

The order in which set_global_cloud_amount, set_global_haze_amount, scene_set_day_time and set_rain are called is very specfic. Not sure which order was correct, but it should be quick to test.

Arch3r

  • Grandmaster Knight
  • *
  • >:I
    • View Profile
  • Faction: Rhodok
  • MP nick: CoR_Arch3r
  • M&BWBNW
Re: Arch3r OS: Random weather for multiplayer gamemodes (fixed)
« Reply #3 on: May 05, 2010, 01:29:17 PM »
Thanks, I will try some things with that.
                                                                                           

Slenderpeasants,
the evil minions of the Bonerlords

Annynduir

  • Sergeant
  • *
  • It was cold outside in Rhodok land..
    • View Profile
  • Faction: Nord
  • MP nick: Annynduir_|CR|
Re: Arch3r OS: Random weather for multiplayer gamemodes (fixed)
« Reply #4 on: May 06, 2010, 06:14:08 PM »
sooooo does this work or not? ~confused~

Arch3r

  • Grandmaster Knight
  • *
  • >:I
    • View Profile
  • Faction: Rhodok
  • MP nick: CoR_Arch3r
  • M&BWBNW
Re: Arch3r OS: Random weather for multiplayer gamemodes (fixed)
« Reply #5 on: May 06, 2010, 06:58:10 PM »
Works now, with a small problem that you either have to reconnect first, or the map has to get changed. The current map when joining does not work yet as there's no way for the server to get the weather info on the client before he is connected.
                                                                                           

Slenderpeasants,
the evil minions of the Bonerlords

Annynduir

  • Sergeant
  • *
  • It was cold outside in Rhodok land..
    • View Profile
  • Faction: Nord
  • MP nick: Annynduir_|CR|
Re: Arch3r OS: Random weather for multiplayer gamemodes (fixed)
« Reply #6 on: May 07, 2010, 03:59:39 PM »
Awesome though matey, nice one.
Shame that such a simple thing is so hard to implement.

Arch3r

  • Grandmaster Knight
  • *
  • >:I
    • View Profile
  • Faction: Rhodok
  • MP nick: CoR_Arch3r
  • M&BWBNW
Re: Arch3r OS: Random weather for multiplayer gamemodes (fixed)
« Reply #7 on: May 07, 2010, 04:16:22 PM »
It's not hard at all, most multiplayer things are much harder to implement.
                                                                                           

Slenderpeasants,
the evil minions of the Bonerlords

Annynduir

  • Sergeant
  • *
  • It was cold outside in Rhodok land..
    • View Profile
  • Faction: Nord
  • MP nick: Annynduir_|CR|
Re: Arch3r OS: Random weather for multiplayer gamemodes (fixed)
« Reply #8 on: May 10, 2010, 01:05:32 AM »
What I meant was that weather is such an obvious thing you'd expect to be there but here you are needing to work out how to mod it in.

BJB

  • Sergeant
  • *
    • View Profile
  • Faction: Nord
  • MP nick: Bjord
  • WB
Re: Arch3r OS: Random weather for multiplayer gamemodes (fixed)
« Reply #9 on: May 10, 2010, 03:08:49 PM »
This is probably gonna sound stupid, but are there ways to make the weather non-random? I always have the same annoying sun-down skybox/weather, and I'd like to change it to a clear and pristine one.

Arch3r

  • Grandmaster Knight
  • *
  • >:I
    • View Profile
  • Faction: Rhodok
  • MP nick: CoR_Arch3r
  • M&BWBNW
Re: Arch3r OS: Random weather for multiplayer gamemodes (fixed)
« Reply #10 on: May 10, 2010, 04:33:35 PM »
There is.
In the commons of mission_templates look for:

(store_random_in_range, "$day_time", 4,22),

Just set it at 14 or 16 and it will be clear day. It would look like this: (replaces the line above)
(assign, "$day_time", 14),
                                                                                           

Slenderpeasants,
the evil minions of the Bonerlords

Annynduir

  • Sergeant
  • *
  • It was cold outside in Rhodok land..
    • View Profile
  • Faction: Nord
  • MP nick: Annynduir_|CR|
Re: Arch3r OS: Random weather for multiplayer gamemodes (fixed)
« Reply #11 on: May 10, 2010, 04:49:38 PM »
So in regards to the client server problem.  The problem is that you can't get the info to the client without them joining the server, yes?
Once they have joined, why is it then not possible to reset the weather?  (sorry just trying to understand the code) :)
Could there be such a thing as a disconnect and rejoin script?

Arch3r

  • Grandmaster Knight
  • *
  • >:I
    • View Profile
  • Faction: Rhodok
  • MP nick: CoR_Arch3r
  • M&BWBNW
Re: Arch3r OS: Random weather for multiplayer gamemodes (fixed)
« Reply #12 on: May 10, 2010, 09:29:32 PM »
When a client joins the scene loads automatically, while the client needs to know the weather before he loads the scene. That's where it goes wrong.
                                                                                           

Slenderpeasants,
the evil minions of the Bonerlords

NaglFaar

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Nord
  • MP nick: NaglFaar
  • M&BWBNW
Re: Arch3r OS: Random weather for multiplayer gamemodes (fixed)
« Reply #13 on: June 07, 2010, 05:49:45 PM »
I added the code but it has some minor flaws.


The fog is always too thick. You can barely see the tip of you sword through the dense fog.
There is also no randomness in it. (Might not be a bug but I got the impression that it should randomize the weather).
Mæli þarft eða þegi


the thread is in Alpha stages and when all the ideas have been put together and implemented the taleworlds post shall be completed.

GetAssista

  • Grandmaster Knight
  • *
  • TLD corovan robber
    • View Profile
  • Faction: Neutral
  • M&BWF&S
Re: Arch3r OS: Random weather for multiplayer gamemodes (fixed)
« Reply #14 on: June 07, 2010, 06:08:12 PM »
The fog is always too thick.

Code: [Select]
(store_random_in_range, "$fog_dist", 40,250),
...
 (lt, "$fog_dist", 110),
find those in code and increase all numbers like 2fold (40 is min fig dist, 110 max, when rnd is in 110-250 there's no fog)
There is also no randomness in it.
change 0xbfbfbf for other numbers to have other colors for fog