Fog, dynamic fog, metadata etc.

Host your own server and communicate with server operators.
4 posts Page 1 of 1 First unread post
Sasquatch
Mapper
Mapper
Posts: 141
Joined: Wed Nov 14, 2012 5:18 pm


A long time ago, a few updates prior in terms of pyspades, I was capable of setting the fog in the metadata so that I didn't have to log in and set it every time. Was this defunct in a newer release? Do I need the new script for it or something? Or is my metadata set wrong perhaps?

Here's what mine looks like.

name = 'deepspace'
version = '1.0'
author = 'Sasquatch'
description = ('Some alien docking stations and more...')
extensions = {
'arena': True,
'arena_blue_spawn' : (140, 238, 30),
'arena_green_spawn' : (373, 238, 30),
'arena_gates': ((145, 232, 32), (143, 245, 32), (370, 245, 32), (368, 232, 32)),
'water_damage' : 25
}
fog = (000, 000, 000)

Particularly it is the last line that is in question here.
ThisFrickinSite
Deuced Up
Posts: 553
Joined: Mon Nov 05, 2012 8:45 pm


I don't know much about this map metadata scripting stuff, but assuming that it uses it uses it as python code, you need to remove the parenthesis. I may be wrong, it's been a long time since I used python too.
izzy
Head Admin / Co-founder
Head Admin / Co-founder
Posts: 474
Joined: Tue Oct 09, 2012 8:16 pm


currently not part of vanilla pyspades, yeah - you need this script:
Code: Select all
# dynfog.py by SLoW

import commands

def apply_script(protocol, connection, config):
    class FogProtocol(protocol):
        default_fog = (128, 232, 255)
        def on_map_change(self, name):
            self.set_fog_color(getattr(self.map_info.info, 'fog', self.default_fog))
            protocol.on_map_change(self, name) 
    return FogProtocol, connection
you did the map metadeta correctly.

for white:
fog = (255, 255, 255)

for black:
fog = (0, 0, 0)

for red:
fog = (255, 0, 0)

etc.
Sasquatch
Mapper
Mapper
Posts: 141
Joined: Wed Nov 14, 2012 5:18 pm


Thanks izz
4 posts Page 1 of 1 First unread post
Return to “Servers”

Who is online

Users browsing this forum: No registered users and 41 guests