Only one class can enter a map
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Only one class can enter a map
So for my mod, there are these seperate classes but I only want one to enter a specific map/episode. Is there a method for this?
Re: Only one class can enter a map
I think It is.
Take a look in this page: https://zdoom.org/wiki/Creating_new_player_classes
Take a look in this page: https://zdoom.org/wiki/Creating_new_player_classes
Re: Only one class can enter a map
What exactly am I supposed to being looking at?
- ramon.dexter
- Posts: 1562
- Joined: Tue Oct 20, 2015 12:50 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Kozolupy, Bohemia
Re: Only one class can enter a map
Well, this is more than simple player class. You have to also define which class start in which map, and that is probably done in MAPINFO or GAMEINFO - I'm not 100% sure about it, since I've never made a multi-class mod.
https://zdoom.org/wiki/MAPINFO
https://zdoom.org/wiki/MAPINFO
Re: Only one class can enter a map
So you want each class to start at a different map in an episode? That can be done using a combination of ACS functions.KeaganH wrote:So for my mod, there are these seperate classes but I only want one to enter a specific map/episode. Is there a method for this?
You can check the current class using PlayerClass and change the map using ChangeLevel.
PlayerClass returns a number based on the player's class, which are in turn based on how they were entered in MAPINFO, so for example:
Code: Select all
GameInfo
{
PlayerClasses = "Player1", "Player2", "Player3"
} //Player1 will return 0, Player2 will return 1, Player3 will return 2
Code: Select all
Script 1 ENTER
{
int class = PlayerClass(PlayerNumber()); //Get the current class number
If(class==0){ChangeLevel("MAP05",0,CHANGELEVEL_NOINTERMISSION,-1);} //If the player plays as Player1 class, jump to MAP05
Else If(class==1){ChangeLevel("MAP12",0,CHANGELEVEL_NOINTERMISSION,-1);} //If the player plays as Player2 class, jump to MAP12
Else If(class==2){ChangeLevel("MAP20",0,CHANGELEVEL_NOINTERMISSION,-1);} //If the player plays as Player3 class, jump to MAP20
}
Re: Only one class can enter a map
Okay so now, I have a new problem. Sometimes a map won't load up because it says No Player 1 Start
Re: Only one class can enter a map
That usually happens because you have set the arguments on the player start spot.
Most of the time, player start spots do not need their arguments set. The arguments are typically used to identify which ones should be used in cases where there are several start spots on the same map. e.g. a hub map which can be accessed from several other levels (which would have exit lines/scripts with exit specials that have arguments corresponding to the appropriate map spot).
Even if you need map spots with arguments, you can also add a map spot without arguments that will be used when warping to the map e.g. for testing purposes.
Most of the time, player start spots do not need their arguments set. The arguments are typically used to identify which ones should be used in cases where there are several start spots on the same map. e.g. a hub map which can be accessed from several other levels (which would have exit lines/scripts with exit specials that have arguments corresponding to the appropriate map spot).
Even if you need map spots with arguments, you can also add a map spot without arguments that will be used when warping to the map e.g. for testing purposes.