A request to mod makers that have setup scripts

Maps, modifications, add-ons, projects, and other releases for Zandronum. Also includes announcers.
Post Reply
User avatar
AlexMax
Forum Regular
Posts: 244
Joined: Tue May 29, 2012 10:14 pm
Contact:

A request to mod makers that have setup scripts

#1

Post by AlexMax » Fri Feb 24, 2017 1:42 am

In my time running Euro Friday Night Fragfest, I have had some difficulty in running setup scripts from a config file or from the command line as a + parameter. I believe what is going on is that configuration files and command line parameters are simply executed too soon - before the mod has a chance to load. Thus, everytime I load a mod that requires a setup script, I need to have somebody log in and execute an RCON command. This is...slightly inconvenient. More inconvenient if a server crashes, restarts, and requires the command be run again with no administrators around.

Now, there might be some method that I'm missing that can automatically run scripts on boot, and if so, please let me know.

Failing that, would it be too much trouble to have some method of bootstrapping the server automatically? Off the top of my head, the simplest way I think would probably be to replace MAP01 with a "Start Map" that maybe acts as sort of an introduction to the game, and the moment somebody joins the game, the setup script is fired. Another possibility is a global ACS script that detects when the playercount goes from 0 to 1, and the moment it does, fire the setup script.

Just a thought.
The only limit to my freedom is the inevitable closure of the
universe, as inevitable as your own last breath. And yet,
there remains time to create, to create, and escape.

Escape will make me God.

User avatar
arkore
Forum Regular
Posts: 183
Joined: Mon Dec 17, 2012 8:01 pm

Re: A request to mod makers that have setup scripts

#2

Post by arkore » Fri Feb 24, 2017 4:39 am

I've had trouble with this as well for as long as I've been doing this, and there's no easy answer it seems. I began to write a long post here, then gave up. I really hate this shit.

But I believe any solution does involve usage of global variables though, or maybe inventory items given to player?

I will say that my most recent project does have a START map for the same reasons.

It has, for server cfg:

Code: Select all

sv_maprotation true
clearmaplist
addmap START
For MAPINFO:

Code: Select all

ClearEpisodes

// Episodes
Episode START
{
        Name = "$EP_WRATH"
	Key = "w"
	NoSkillMenu
}

DefaultMap {
    Music = "D_IDLE"
    Sky1 = "SKY1", 0.0
}

Map START "$MAP_START" {
	NoIntermission
	LevelNum = 199
	Music = ""
	Sky1 = "SKY1", 0.0
}
For LANGUAGE:

Code: Select all

[enu default]
EP_WRATH = "Wrath of Hell";
MAP_START = "Start";
and an ACS script, CORE:

Code: Select all

global int 8:game_started; // Do not change this.

script "Game" OPEN {
	// Start map.
	Delay(10);
	if (!game_started) {
		game_started = true; Delay(1);
		ConsoleCommand("map START");
	}

	// Waiting for players.
	until (PlayerCount() > 0) { Delay(1); }

	...

}
Then START.wad map script is:

Code: Select all

#include "zcommon.acs"

global int 8:game_started; // Do not change this.

// Game
script "Game" OPEN {
	// Do initialization stuff here.
	game_started = true;
	Delay(10);
	ConsoleCommand("changemap HUB01");
}
And the map itself (START) is just a black dark room with 4 player spawns.

Catastrophe
Retired Staff / Community Team Member
Posts: 2558
Joined: Sat Jun 02, 2012 2:44 am

Re: A request to mod makers that have setup scripts

#3

Post by Catastrophe » Fri Feb 24, 2017 10:31 pm

All of my mods come with a command called "setup" for this very reason.

User avatar
AlexMax
Forum Regular
Posts: 244
Joined: Tue May 29, 2012 10:14 pm
Contact:

Re: A request to mod makers that have setup scripts

#4

Post by AlexMax » Sat Feb 25, 2017 4:18 am

Catastrophe wrote:All of my mods come with a command called "setup" for this very reason.
Read my original post again. Unless I'm missing something, I can't execute these setup scripts from a config file or at the command line. They're convenient, but they require an administrator to RCON them and run them by hand.
The only limit to my freedom is the inevitable closure of the
universe, as inevitable as your own last breath. And yet,
there remains time to create, to create, and escape.

Escape will make me God.

User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

Re: A request to mod makers that have setup scripts

#5

Post by ZZYZX » Sat Feb 25, 2017 4:09 pm

Setup scripts? Such thing exists?
I wonder what happens with these once ConsoleCommand is blocked.

Post Reply