MAPINFO 'forceclass'

Moderator: GZDoom Developers

User avatar
Tapika
Posts: 205
Joined: Sat Jun 24, 2006 1:28 pm

MAPINFO 'forceclass'

Post by Tapika »

Here's an example:

Code: Select all

forceclass = DoomPlayer
means when the level starts, the PlayerClass will be 'DoomPlayer'. If the class does not exist (Or is simply not defined as a PlayerClass and relative of PlayerPawn) it will be the set class for this gametype.
I know this is possible- You say we cannot change class in-game, but what about between intermissions, hmnn?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Post by Kate »

Being able to do it from a function call from ACS makes it a lot more flexible, because it allows one to create selective or special exits instead of having the map itself change the player class, considering a possibility where a map can be designed for more than one player class. In this case, you'd just have the line execute a script that looks something like this:

Code: Select all

Script 1 (void)
{
    ChangeLevel ("NEWMAP", 0, 0, GameSkill(), "NewClass");
}
with NEWMAP being the next map's lump name and NewClass being the name of the class you want the player to start as.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Tapika's method does have the slight advantage of enforcing the class change even when a player warps to it, however.

Perhaps both methods could be added in some form.
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Post by Kate »

Oh I'm pretty sure if the code for one gets added, then adding the code for the other would be somewhat trivial, since they both pretty much do the same thing.
User avatar
Tapika
Posts: 205
Joined: Sat Jun 24, 2006 1:28 pm

Post by Tapika »

Sure, ACS may be flexable, but in the end when you want to do some last minuite changes you don't have to go through hell compiling a really long script. :roll:
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Post by Cutmanmike »

Tapika wrote:Sure, ACS may be flexable, but in the end when you want to do some last minuite changes you don't have to go through hell compiling a really long script. :roll:
That's where DoomScript will hopefully (eventually) come in... if it does at all.
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Post by Ghastly »

SnowKate709 wrote:

Code: Select all

Script 1 (void)
{
    ChangeLevel ("NEWMAP", 0, 0, GameSkill(), "NewClass");
}
What if someone warps directly to a map from the console?
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Post by Kate »

Ghastly_dragon wrote:What if someone warps directly to a map from the console?
Well it is a cheat, so of course they would assume their default class, which, as I said before, is useful for testing maps that can be played through with different classes (ala Hexen).

I could see the use for this if you need to specify a class for a situation like -warp to the map from the commandline, but in this case it'd probably be better to use a "defaultclass" for when one isn't specified instead of forcing it to that value for every map change, as there may be some situations where you don't specifically want to force the player to change classes (like using it for a startmap after they just select one).

But I didn't necessarily say no to this, I'm just saying there would already be another way of doing it in some situations, but I don't see a reason not to add it, since it could be used to ensure that the player enters the map as this class, regardless of how they got there (I could imagine something like the shrinker tool and "mini-levels" with a small player, where this would be needed to enforce size constraints so it doesn't try to spawn a full-size playerclass into a small room).
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

Tapika wrote:Sure, ACS may be flexable, but in the end when you want to do some last minuite changes you don't have to go through hell compiling a really long script. :roll:
You think ACS is a pain in the ass in that regard? Protip: Don't go into a career that involves programming in a decent language.
User avatar
Nash
 
 
Posts: 17505
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

I just started learning QuakeC and ACS is such a joke compared to QuakeC (and even QC is a real joke compared to C++).
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Post by Ghastly »

@Kate: What about about Skulltag's map change votes? That's not a cheat.

Both suggestions look to be useful, but I think the MAPINFO option's the best suggestion for forcing a player class for a certain map.
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Post by Kate »

Ghastly_dragon wrote:What about about Skulltag's map change votes? That's not a cheat.
I wrote:[...] in this case it'd probably be better to use a "defaultclass" for when one isn't specified instead of forcing it to that value for every map change, as there may be some situations where you don't specifically want to force the player to change classes [...]
Of course if you really look at it, it breaks down in multiplayer because there's no way, script or otherwise, to set a class for a specific player, only for all of them at once. In this I'm assuming doing so through a script only affects the script activator, whereas in mapinfo it affects ALL players. In this case if 'default' is specified it'd be more of a 'soft change' as script class changes would override map classes, whereas the force option would override script changes.

...Actually having it affect all players from the script would make more sense, since the default (soft) change would reset the class anyway since it probably wouldn't be able to tell if a script changed the player to that class 2 maps before...

I'm trying to consider a situation like this:

There are gateways to hell in one map that warp to a hellish second map. The hellish second map specifies that all players are imps, but one wants to set it so that if they crossed the gateway, they would start off as barons. A default class would mean that the script wins and they become barons when they start the next map, but if they didn't go through the gate to end the level and go to the map (for example the map is directly warped to or votemap or whatever), they would start as imps. In contrast, forceclass means they would always start as imps, regardless of whether they crossed the gateway line or not in the last map.
Last edited by Kate on Thu Oct 18, 2007 1:34 pm, edited 1 time in total.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Tapika wrote:Sure, ACS may be flexable, but in the end when you want to do some last minuite changes you don't have to go through hell compiling a really long script. :roll:
Yes, and you'll never get that 2.4 seconds back, either. :roll:
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Post by Project Shadowcat »

Tapika wrote:Sure, ACS may be flexable, but in the end when you want to do some last minuite changes you don't have to go through hell compiling a really long script. :roll:
Want long? ZDCMP1 has over 1000 lines of ACS script...
and one of the maps in my project has nearly 1000 by myself.
That is what comment lines are for...
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”