How to code a .txt ?

The original, free Ace of Spades game powered by the Voxlap engine. Known as “Classic,” 0.75, 0.76, and all 0.x versions. Created by Ben Aksoy.
5 posts Page 1 of 1 First unread post
Gibbs3333
Mapper
Mapper
Posts: 89
Joined: Wed Dec 19, 2012 2:43 pm


Hi guys ! I am a french map maker and I have a problem with the .txt for the maps. I can't install map extensions as water damage, nobuild and I don't know why... I tried to regroup codes and then when I want to connect my server...bug. Can you help me ?
PS: I replace numbers to X,Y.

Image
HoboHob
Winter Celebration 2013
Winter Celebration 2013
Posts: 979
Joined: Mon Nov 05, 2012 5:02 pm


First off open Notepad, select the script, and press CTRL + X on your keyboard.

Go to your new Notepad window and press CTRL + V.

Now you have the script and map separate.

Then save the script in the scripts folder of PySnip (dist\scripts) as a .py file, not a .txt. Scripts must be in .py form.

Next put a quotation mark in front of the description behind the parentheses :) . Then save your map text file and place it with your map in the maps folder (dist\maps). Open up config.cfg (I think that is what it is called). It is in JSON format, search for scripts. In the scripts box put in the name of the script you just saved. Search for maps and erase everything but the name of the map you just saved.

And you're done!
Gibbs3333
Mapper
Mapper
Posts: 89
Joined: Wed Dec 19, 2012 2:43 pm


Thank you to help me quickly. It 's interesting but if I create this new script, the properties for the intel, flag & base will be for all the maps ? When I wrote a .txt with just the part #scripting, it was okay but I want all in one .txt. Is it possible or must I create two separate .txt ?
HoboHob
Winter Celebration 2013
Winter Celebration 2013
Posts: 979
Joined: Mon Nov 05, 2012 5:02 pm


Gibbs3333 wrote:
Thank you to help me quickly. It 's interesting but if I create this new script, the properties for the intel, flag & base will be for all the maps ? When I wrote a .txt with just the part #scripting, it was okay but I want all in one .txt. Is it possible or must I create two separate .txt ?
Yes the script will be available on all maps.

I don't think it is possible though, to have the script enabled for only one map.
Gibbs3333
Mapper
Mapper
Posts: 89
Joined: Wed Dec 19, 2012 2:43 pm


Thank you for your advice, I found where was the problem and we can write all in one .txt ! I show you an example Blue_Happy3 :
Code: Select all
name = 'DesertTown'
version = '1.0'
author = 'Gibbs3333'
description = ('Gibbs3333')
protected = ['D4','D5']
extensions = {
         'water_damage' : 100
}
# scripting

from pyspades.constants import *
from pyspades.server import ServerConnection

def get_entity_location(team, entity_id):
    if entity_id == BLUE_FLAG:
        return (297, 279, 59)
      
    if entity_id == BLUE_BASE:
        return (297, 279, 59)
      
    if entity_id == GREEN_FLAG:
        return (214, 231, 59)

    if entity_id == GREEN_BASE:
        return (214, 231, 59)

def get_spawn_location(connection):
 
    if connection.team is connection.protocol.blue_team:
        # sets a static spawn for just the blue team, but you could use "green_team" too.
        return (297, 279, 59)

    if connection.team is connection.protocol.green_team:
        # sets a static spawn for just the green team, but you could use "blue_team" too.
        return (214, 231, 59)
5 posts Page 1 of 1 First unread post
Return to “Ace of Spades 0.x Discussion”

Who is online

Users browsing this forum: No registered users and 37 guests