Set no jump/crouch/freelook by default for single player with classic games ?

General help and assistance forum.
Post Reply
Mythran
New User
Posts: 4
Joined: Wed May 27, 2020 2:09 pm

Set no jump/crouch/freelook by default for single player with classic games ?

#1

Post by Mythran » Wed May 27, 2020 2:59 pm

Hi everyone,

First post, I hope I didn't put it in the wrong place, feel free to move it.

I've been playing Doom, Heretic, Hexen since their release back in the day, and even though I already used GZDoom and Zandronum in the past, I wanted to set up a portable folder with Doom Explorer using Zandronum with a bunch of saved configurations for ease of use for myself and a few friends who never experienced these classic games and are not familiar with how to set all that up so they could just drop their original WADs in the correct folder and start playing solo or use the browser to join my server to discover the games in co-op together.

The thing I'm struggling with is setting the no jump, no crouch and no freelook (depending on the game) by default for single player.
I can set the flags on a server if we play co-op, but since they're not familiar, I wanted to have it properly configured for solo play too (and for myself not to accidently use those features) by default without having to change it on every start of a new game.

If I change it in the gameplay options, the setting is reset when starting a new game or restarting Zandronum.
I created an autoexec file, the settings are indeed changed when checking the options after launch, but they reset as soon as a new game is started.

According to this issue I found on the tracker, this would be default ZDoom behaviour not keeping the dmflags in the config.

I assume there is no default setting for these in the classic IWADs (MAPINFO), that's why having them set to DEFAULT still allows jump/crouch/freelook.
Is there a way to force that behaviour for single player to keep the gameplay close to the original ?

Thank you in advance for your help.

EDIT: I'm using Zandronum 3.0.1 stable (by the way, is there a reason this version is not advertised on the main page of the website ?) and Doom Explorer 1.73


Mythran
New User
Posts: 4
Joined: Wed May 27, 2020 2:09 pm

Re: Set no jump/crouch/freelook by default for single player with classic games ?

#3

Post by Mythran » Thu May 28, 2020 3:24 pm

Hi penguin, thanks!
This seems to do the trick.

Is there a reason why this works and not changing the options ? This is actually run when the game is running whereas an autoexec file only applies to the menus and is overridden when the game starts ?
Any reason why those options are not kept ?

Anyway, I tried to modify the script to remove the lines disabling freelook for Heretic and freelook and jump for Hexen, but it didn't work.
I assume this is because it needs to be compiled (sorry, I'm a bit new to this).
So I looked it up, found ACC but the script seems to need a zcommon.h.bcs file.
I'm not too sure where to find it so I downloaded GZDoom's source code but it wasn't there.
I tried including zcommon.acs (which is provided with ACC) instead, but it gave me an error.
I got Doom Builder and tried with the included editor but didn't compile for the same reason.

Do you know where I could find this file or how I could compile the script properly ?

Thanks again for sending me in the right direction :)

User avatar
penguin
 
Posts: 82
Joined: Tue Aug 28, 2018 5:05 am
Location: Japan
Contact:

Re: Set no jump/crouch/freelook by default for single player with classic games ?

#4

Post by penguin » Thu May 28, 2020 4:45 pm

Idk why they don't keep the settings.
You need a bcs compiler because it uses bcs files.
I've updated the mod. Please redownload. Use "c_~~" instead of "sv_~~". (If you type "c_" in the console and press tab key, you'll see three of them.)
You can do what you want at the start of the stage or by using "pukename force_cvar".

Mythran
New User
Posts: 4
Joined: Wed May 27, 2020 2:09 pm

Re: Set no jump/crouch/freelook by default for single player with classic games ?

#5

Post by Mythran » Thu May 28, 2020 5:32 pm

Hi, thanks for the updated file.
Though it doesn't seem to work automatically from startup like the previous one.

Sorry if I missed the point but what is the benefit of using the new version ?
At first glance I would assume it would be to have an easier time using the command with autocompletion to avoid having the whole list of sv_ commands.

What I want to achieve is to have jump/crouch/freelook disabled by default on start for Doom, jump/crouch disabled for Heretic and crouch disabled for Hexen so:
- my friends who never played the games don't have to think about disabling them every time they start a new game since they're not aware of the original gameplay, what source ports are and their added functionality
- I don't inadvertently use those features with the original games

Maybe I didn't use it properly.

I found BCC and quickly tried to compile FORCE.acs with it but didn't succeed.
I had this error: zcommon.h.bcs:1:0: error: unknown directive: ifndef

I then tried to include zcommon.bcs directly and had this error:
lib\zcommon.bcs:10:0: error: `library` directive not at the very top


Sorry again if I missed the purpose of the changes in the second version of your script.
Thank you again for your help :)

User avatar
TDRR
Forum Regular
Posts: 219
Joined: Thu Jun 28, 2018 9:13 pm
Location: Venezuela
Contact:

Re: Set no jump/crouch/freelook by default for single player with classic games ?

#6

Post by TDRR » Thu May 28, 2020 11:14 pm

Mythran wrote:
Thu May 28, 2020 5:32 pm
I found BCC and quickly tried to compile FORCE.acs with it but didn't succeed.
I had this error: zcommon.h.bcs:1:0: error: unknown directive: ifndef

I then tried to include zcommon.bcs directly and had this error:
lib\zcommon.bcs:10:0: error: `library` directive not at the very top
zcommon.h.bcs should be #import-ed, not #include-d, just in case. You should rename FORCE.acs to FORCE.bcs, and if you're using BCC from the command line, you can just add the "-x bcs" parameter (without quotes, of course).

The reason it didn't work is because BCC thought it was compiling an ACS file, but by using either fix I mentioned above (renaming or using -x bcs), BCC will know it's compiling a BCS file and will enable the BCS-specific improvements.
One thing I have asked from the Lord, that I shall seek: That I may dwell in the house of the Lord all the days of my life, to behold the beauty of the Lord and to meditate in His temple. (Psalm 27:4, NASB)
My Discord tag is @tdrr, and it's my preferred contact method. I also check PMs here from time to time.

User avatar
penguin
 
Posts: 82
Joined: Tue Aug 28, 2018 5:05 am
Location: Japan
Contact:

Re: Set no jump/crouch/freelook by default for single player with classic games ?

#7

Post by penguin » Fri May 29, 2020 5:12 am

The reason it's zcommon.h.bcs is because I always use bcs.
Use this. It works perfectly. (zandroum only)
Spoiler: ACS (Open)

Code: Select all

#library "FORCE"
#include "zcommon.h.bcs"

enum {
	IWAD_OTHER,
	IWAD_DOOM,
	IWAD_HERETIC,
	IWAD_HEXEN,
};

function int GetIWAD(void)
{
	int TID = UniqueTID();
	SpawnForced("MapSpot", GetActorX(0), GetActorY(0), GetActorZ(0), TID);
	Thing_SpawnNofog(TID, 255, 0, TID);
	if(ThingCountName("DoomCheck", TID) > 0) {
		Thing_Remove(TID);
		return IWAD_DOOM;
	} else if(ThingCountName("HereticCheck", TID) > 0) {
		Thing_Remove(TID);
		return IWAD_HERETIC;
	} else if(ThingCountName("HexenCheck", TID) > 0) {
		Thing_Remove(TID);
		return IWAD_HEXEN;
	} else {
		Thing_Remove(TID);
		return IWAD_OTHER;
	}
}
	
Script "Force_CVar" (void) ENTER
{
	switch (GetIWAD()) {
		case IWAD_DOOM:
			ConsoleCommand("sv_nojump true");
			ConsoleCommand("sv_nocrouch true");
			ConsoleCommand("sv_nofreelook true");
			break;
		
		case IWAD_HERETIC:
			ConsoleCommand("sv_nojump true");
			ConsoleCommand("sv_nocrouch true");
			ConsoleCommand("sv_nofreelook false");
			break;
		
		case IWAD_HEXEN:
			ConsoleCommand("sv_nojump false");
			ConsoleCommand("sv_nocrouch true");
			ConsoleCommand("sv_nofreelook false");
			break;
		
		default:
			break;
	}
}
Spoiler: Decorate (Open)

Code: Select all

ACTOR DoomCheck
{
	Game Doom
	SpawnID 255
	-SOLID
	+THRUACTORS
	+NONSHOOTABLE
}

ACTOR HereticCheck
{
	Game Heretic
	SpawnID 255
	-SOLID
	+THRUACTORS
	+NONSHOOTABLE
}

ACTOR HexenCheck
{
	Game Hexen
	SpawnID 255
	-SOLID
	+THRUACTORS
	+NONSHOOTABLE
}



Mythran
New User
Posts: 4
Joined: Wed May 27, 2020 2:09 pm

Re: Set no jump/crouch/freelook by default for single player with classic games ?

#9

Post by Mythran » Fri May 29, 2020 5:20 pm

Hey, thanks again for your help guys!

I'm not too familiar with creating and editing maps for the Id Tech 1 engine yet.
I set SLADE up for compiling with BCS, I could find the script editor but compiling didn't seem to do anything, maybe I need to save a map somewhere first...
And I'm also not sure where to put the Decorate part.

Anyway, thanks to TDRR for specifying how to compile BCS files with BCC (I should've looked at the docs a bit more carefully), I went back to your original script and could compile a few different versions with the different commands so I have different files I can load depending on the gameplay I want.
This way I can also apply them to Strife, Chex Quest, Hacx, etc.

Thanks again to you both!

Post Reply