HUB world with portals to 5 different chapters?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

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!)
Post Reply
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

HUB world with portals to 5 different chapters?

Post by Hidden Hands »

I'm trying to pull this off, but honestly I'm not sure how. Currently, when you start my game up it lets you choose from a list of five chapters, much like the original Ultimate Doom. But what I want is something more like what QUAKE 1 did, as in you start the game and you immediately appear in a "hub" level (which in my game is MAP99). On this hub, there are portals to different episodes, five in total. Each one will take you to the respective 8 map episode, and once completed, will return you to the hub world. How can I pull this off please? I'm really not sure where to start.

Thanks in advance.

My ZMAPINFO

Code: Select all

Include DefaultMap.txt

GameInfo
{
	IntermissionMusic = "$INTERMUS"
	MenuFontColor_Title = "UNTRANSLATED"	
	CursorPic = "CURSOR"					
}

ClearEpisodes
Episode MAP01
{
	Name = "$MNU_TSGUTD"
}

Episode MAP09
{
	Name = "$MNU_TWGD"
}

Episode MAP17
{
	Name = "$MNU_TGOT"
}

Episode MAP25
{
	Name = "$MNU_IDBD"
}

Episode MAP33
{
	Name = "$MNU_TSP"
}

ClearSkills
Skill Baby
{
	SpawnFilter = Baby
	Name = "$SKILL_BABY"
	Key = "i"
	EasyBossBrain
	AutoUseHealth
	AmmoFactor = 2
	DamageFactor = 0.5
}

Skill Easy
{
	SpawnFilter = Easy
	Name = "$SKILL_EASY"
	Key = "n"
	EasyBossBrain
}

Skill Normal
{
	SpawnFilter = Normal
	Name = "$SKILL_NORMAL"
	Key = "h"
	DefaultSkill
}

Skill Hard
{
	SpawnFilter = Hard
	Name = "$SKILL_HARD"
	Key = "u"
}

Automap
{
    YourColor = "00 77 00"
    WallColor = "77 00 00"
}

AddDefaultMap
{	
	Cluster = 1
	Sky1 = "SPACESKY"
}

Map MAP01 Lookup "HUSTR_1"
{
	Music = "D_TUNLS" 
	Next = "MAP02"
}

Map MAP02 Lookup "HUSTR_2"
{
	Music = "O_PRCNG"
	Next = "MAP03"
}

Map MAP03 Lookup "HUSTR_3"
{
	Music = "R_GAMMA"
	Next = "MAP04"
	SecretNext = "MAP56"
}

Map MAP04 Lookup "HUSTR_4"
{
	Music = "C_CMAND"
	Next = "MAP05"
}

Map MAP05 Lookup "HUSTR_5"
{
	Music = "$MAPMUS_5"
	Next = "MAP06"
}

Map MAP06 Lookup "HUSTR_6"
{
	Music = "$MAPMUS_6"
	Next = "MAP07"
}

Map MAP07 Lookup "HUSTR_7"
{
	Music = "$MAPMUS_7"
	Next = "MAP08"
}

Map MAP08 Lookup "HUSTR_8"
{
	Music = "$MAPMUS_8"
	Next = "MAP09"
}

AddDefaultMap
{
	Sky1 = "SKY02"
}

Map MAP09 Lookup "HUSTR_9"
{
	Music = "$MAPMUS_9"
	Next = "MAP10"
}

Map MAP10 Lookup "HUSTR_10"
{
	Music = "$MAPMUS_10"
	Next = "MAP11"
}

Map MAP11 Lookup "HUSTR_11"
{
	Music = "$MAPMUS_11"
	Next = "MAP12"
}

Map MAP12 Lookup "HUSTR_12"
{
	Music = "$MAPMUS_12"
	Next = "MAP13"
}

Map MAP13 Lookup "HUSTR_13"
{
	Music = "$MAPMUS_13"
	Sky1 = "FIRESK00"
	Next = "MAP14"
}

Map MAP14 Lookup "HUSTR_14"
{
	Music = "$MAPMUS_14"
	Next = "MAP15"
}

Map MAP15 Lookup "HUSTR_15"
{
	Music = "$MAPMUS_15"
	Next = "MAP16"
	SecretNext = "MAP55"
}

AddDefaultMap
{
	Sky1 = "FIRESK00"
}

Map MAP16 Lookup "HUSTR_16"
{
	Music = "$MAPMUS_16"
	Next = "MAP17"
}

Map MAP17 Lookup "HUSTR_17"
{
	Music = "$MAPMUS_17"
	Next = "MAP18"
}

Map MAP18 Lookup "HUSTR_18"
{
	Music = "$MAPMUS_18"
	Next = "MAP19"
}

Map MAP19 Lookup "HUSTR_19"
{
	Music = "$MAPMUS_19"
	Next = "MAP20"
}

Map MAP20 Lookup "HUSTR_20"
{
	Music = "$MAPMUS_20"
	Next = "MAP21"
}

Map MAP21 Lookup "HUSTR_21"
{
	Music = "$MAPMUS_21"
	Next = "MAP22"
}

Map MAP22 Lookup "HUSTR_22"
{
	Music = "$MAPMUS_22"
	Next = "MAP23"
}

Map MAP23 Lookup "HUSTR_23"
{
	Music = "$MAPMUS_23"
	Next = "MAP24"
}

AddDefaultMap
{
	Sky1 = "GOLDSKY"
}

Map MAP24 Lookup "HUSTR_24"
{
	Music = "$MAPMUS_24"
	Next = "MAP25"
}

Map MAP25 Lookup "HUSTR_25"
{
	Music = "U_WSPRS"
	Next = "MAP26"
	SecretNext = "MAP60"
}

Map MAP26 Lookup "HUSTR_26"
{
	Music = "$MAPMUS_26"
	Next = "MAP27"
}

Map MAP27 Lookup "HUSTR_27"
{
	Music = "$MAPMUS_27"
	Next = "MAP28"
	SecretNext = "MAP60"
}

Map MAP28 Lookup "HUSTR_28"
{
	Music = "$MAPMUS_28"
	Next = "MAP29"
}

Map MAP29 Lookup "HUSTR_29"
{
	Music = "$MAPMUS_29"
	Next = "MAP30"
	SecretNext = "MAP57"
}

Map MAP30 Lookup "HUSTR_30"
{
	Music = "$MAPMUS_30"
	Sky1 = "FIRESK00"
	Next = "D1END"
}

Map D1END Lookup "HUSTR_31"
{
	Music = "$DEND_1"
	NoIntermission
	NoAutoSaveHint
	Next = "MAP31"
}

AddDefaultMap
{
	Cluster = 2
	Sky1 = "SKY04"
}

Map MAP31 Lookup "HUSTR_31"
{
	Music = "$MAPMUS_31"
	Next = "MAP32"
}

Map MAP32 Lookup "HUSTR_32"
{
	Music = "$MAPMUS_32"
	Next = "MAP33"
}

Map MAP33 Lookup "HUSTR_33"
{
	Music = "$MAPMUS_33"
	Next = "MAP34"
}

Map MAP34 Lookup "HUSTR_34"
{
	Music = "$MAPMUS_34"
	Sky1 = "SKY01"
	Next = "MAP35"
}

Map MAP35 Lookup "HUSTR_35"
{
	Music = "$MAPMUS_35"
	Next = "MAP36"
}

Map MAP36 Lookup "HUSTR_36"
{
	Music = "$MAPMUS_36"
	Next = "MAP37"
}

Map MAP37 Lookup "HUSTR_37"
{
	Music = "$MAPMUS_37"
	Next = "MAP38"
}

Map MAP38 Lookup "HUSTR_38"
{
	Music = "$MAPMUS_38"
	Sky1 = "SKY01"
	Next = "MAP39"
}

Map MAP39 Lookup "HUSTR_39"
{
	Music = "$MAPMUS_39"
	Next = "MAP40"
}

Map MAP40 Lookup "HUSTR_40"
{
	Music = "$MAPMUS_40"
	Next = "MAP41"
}

Map MAP41 Lookup "HUSTR_41"
{
	Music = "$MAPMUS_41"
	Next = "MAP42"
}

AddDefaultMap
{
	Sky1 = "SKY05"
}

Map MAP42 Lookup "HUSTR_42"
{
	Music = "$MAPMUS_42"
	Next = "MAP43"
}

Map MAP43 Lookup "HUSTR_43"
{
	Music = "$MAPMUS_43"
	Next = "MAP44"
}

Map MAP44 Lookup "HUSTR_44"
{
	Music = "$MAPMUS_44"
	Next = "MAP45"
	SecretNext = "MAP58"
}

Map MAP45 Lookup "HUSTR_45"
{
	Music = "$MAPMUS_45"
	Next = "MAP46"
}

Map MAP46 Lookup "HUSTR_46"
{
	Music = "$MAPMUS_46"
	Next = "MAP47"
}

Map MAP47 Lookup "HUSTR_47"
{
	Music = "$MAPMUS_47"
	Next = "MAP48"
}

AddDefaultMap
{
	Sky1 = "SKY06"
}

Map MAP48 Lookup "HUSTR_48"
{
	Music = "$MAPMUS_48"
	Next = "MAP49"
}

Map MAP49 Lookup "HUSTR_49"
{
	Music = "$MAPMUS_49"
	Next = "MAP50"
}

Map MAP50 Lookup "HUSTR_50"
{
	Music = "$MAPMUS_50"
	Next = "MAP51"
}

Map MAP51 Lookup "HUSTR_51"
{
	Music = "$MAPMUS_51"
	Next = "MAP52"
}

Map MAP52 Lookup "HUSTR_52"
{
	Music = "$MAPMUS_52"
	Next = "MAP53"
}

Map MAP53 Lookup "HUSTR_53"
{
	Music = "$MAPMUS_53"
	Next = "MAP54"
}

Map MAP54 Lookup "HUSTR_54"
{
	Music = "$MAPMUS_54"
	Sky1 = "SKY07"
	Next = "D2END"
}

Map D2END Lookup "FHUSTR_1"
{
	Music = "$DEND_2"
	NoIntermission
	NoAutoSaveHint
	Next = "MAP61"
}

Map MAP55 Lookup "HUSTR_55"
{
	Music = "$MAPMUS_55"
	Sky1 = "SKY01"
	Next = "MAP16"
}

Map MAP56 Lookup "HUSTR_56"
{
	Music = "$MAPMUS_56"
	Sky1 = "SKY01"
	Next = "MAP04"
}

Map MAP57 Lookup "HUSTR_57"
{
	Music = "$MAPMUS_57"
	Sky1 = "SKY04"
	Next = "MAP30"
}

Map MAP58 Lookup "HUSTR_58"
{
	Music = "$MAPMUS_58"
	Sky1 = "SKY04"
	Next = "MAP45"
	SecretNext = "MAP59"
}

Map MAP59 Lookup "HUSTR_59"
{
	Music = "$MAPMUS_59"
	Sky1 = "SKY01"
	Next = "MAP45"
}

Map MAP60 Lookup "HUSTR_60"
{
	Music = "$MAPMUS_60"
	Sky1 = "SKY07"
	Next = "MAP26"
}

AddDefaultMap
{
	Cluster = 3
}

Map MAP61 Lookup "FHUSTR_1"
{
	Music = "$FMAPMUS_1"
	Sky1 = "SKY04"
	Next = "MAP62"
}

Map MAP62 Lookup "FHUSTR_2"
{
	Music = "$FMAPMUS_2"
	Sky1 = "SKY08"
	Next = "MAP63"
}

Map MAP63 Lookup "FHUSTR_3"
{
	Music = "$FMAPMUS_3"
	Sky1 = "SKY04"
	Next = "MAP64"
}

Map MAP64 Lookup "FHUSTR_4"
{
	Music = "$FMAPMUS_4"
	Sky1 = "SKY08"
	Next = "MAP65"
}

Map MAP65 Lookup "FHUSTR_5"
{
	Music = "$FMAPMUS_5"
	Sky1 = "SKY04"
	Next = "MAP66"
}

Map MAP66 Lookup "FHUSTR_6"
{
	Music = "$FMAPMUS_6"
	Sky1 = "SKY04"
	Next = "MAP67"
}

Map MAP67 Lookup "FHUSTR_7"
{
	Music = "$FMAPMUS_7"
	Sky1 = "SKY08"
	Next = "MAP68"
}

Map MAP68 Lookup "FHUSTR_8"
{
	Music = "$FMAPMUS_8"
	Sky1 = "SKY08"
	Next = "MAP69"
}

Map MAP69 Lookup "FHUSTR_9"
{
	Music = "$FMAPMUS_9"
	Sky1 = "SKY08"
	Next = "MAP70"
}

Map MAP70 Lookup "FHUSTR_10"
{
	Music = "$FMAPMUS_10"
	Sky1 = "SKY04"
	Next = "MAP71"
}

Map MAP71 Lookup "FHUSTR_11"
{
	Music = "$FMAPMUS_11"
	Sky1 = "SKY08"
	Next = "MAP72"
}

Map MAP72 Lookup "FHUSTR_12"
{
	Music = "$FMAPMUS_12"
	Sky1 = "SKY04"
	Next = "MAP73"
}

Map MAP73 Lookup "FHUSTR_13"
{
	Music = "$FMAPMUS_13"
	Sky1 = "SKY08"
	Next = "D3END"
}

Map D3END Lookup "FHUSTR_14"
{
	Music = "$DEND_3"
	NoIntermission
	NoAutoSaveHint
	Next = "MAP74"
}

Map MAP74 Lookup "FHUSTR_14"
{
	Music = "$FMAPMUS_14"
	Sky1 = "SKY04"
	Next = "MAP75"
}

Map MAP75 Lookup "FHUSTR_15"
{
	Music = "$FMAPMUS_15"
	Sky1 = "SKY04"
	Next = "MAP76"
}

Map MAP76 Lookup "FHUSTR_16"
{
	Music = "$FMAPMUS_16"
	Sky1 = "SKY04"
	Next = "MAP77"
}

Map MAP77 Lookup "FHUSTR_17"
{
	Music = "$FMAPMUS_17"
	Sky1 = "SKY08"
	Next = "MAP78"
}

Map MAP78 Lookup "FHUSTR_18"
{
	Music = "$FMAPMUS_18"
	Sky1 = "SKY06"
	Next = "MAP79"
}

Map MAP79 Lookup "FHUSTR_19"
{
	Music = "$FMAPMUS_19"
	Sky1 = "SKY08"
	Next = "MAP80"
}

Map MAP80 Lookup "FHUSTR_20"
{
	Music = "$FMAPMUS_20"
	Sky1 = "SKY08"
	Next = "MAP81"
}

Map MAP81 Lookup "FHUSTR_21"
{
	Music = "$FMAPMUS_21"
	Sky1 = "SKY03"
	Next = "MAP82"
}

Map MAP82 Lookup "FHUSTR_22"
{
	Music = "$FMAPMUS_22"
	Sky1 = "SKY03"
	Next = "MAP83"
}

Map MAP83 Lookup "FHUSTR_23"
{
	Music = "$FMAPMUS_23"
	Sky1 = "FIRESK00"
	Next = "MAP84"
}

Map MAP84 Lookup "FHUSTR_24"
{
	Music = "$FMAPMUS_24"
	Sky1 = "FIRESK00"
	Next = "D4END"
}

Map D4END Lookup "FHUSTR_25"
{
	Music = "$DEND_4"
	NoIntermission
	NoAutoSaveHint
	Next = "MAP85"
}

Map MAP85 Lookup "FHUSTR_25"
{
	Music = "$FMAPMUS_25"
	Sky1 = "SKY04"
	Next = "MAP86"
}

Map MAP86 Lookup "FHUSTR_26"
{
	Music = "$FMAPMUS_26"
	Sky1 = "SKY04"
	Next = "MAP87"
}

Map MAP87 Lookup "FHUSTR_27"
{
	Music = "$FMAPMUS_27"
	Sky1 = "SKY04"
	Next = "MAP88"
}

Map MAP88 Lookup "FHUSTR_28"
{
	Music = "$FMAPMUS_28"
	Sky1 = "SKY04"
	Next = "MAP89"
}

Map MAP89 Lookup "FHUSTR_29"
{
	Music = "$FMAPMUS_29"
	Sky1 = "SKY04"
	Next = "MAP90"
}

Map MAP90 Lookup "FHUSTR_30"
{
	Music = "$FMAPMUS_30"
	Sky1 = "SKY01"
	Next = "D5END"
}

Include "CAST.TXT"
Map D5END ""
{
	Music = "$DEND_5"
	NoIntermission
	NoAutoSaveHint
	Next = "EndGameC"
}
MY LANGUAGE lump

Code: Select all

[enu default]

// Item Pickup Messages
GOTARMOR = "You pick up the armor.";
GOTMEGA = "You got the MegaArmor!";
GOTHTHBONUS = "You pick up a health bonus.";
GOTARMBONUS = "You pick up an armor bonus.";
GOTSTIM = "You pick up a stimpack.";
GOTMEDINEED = "You pick up a medikit.";
GOTMEDIKIT = "You pick up a medikit.";
GOTBLUECARD = "You pick up a blue keycard.";
GOTYELWCARD = "You pick up a yellow keycard.";
GOTREDCARD = "You pick up a red keycard.";
GOTBLUESKUL = "You pick up a blue skull key.";
GOTYELWSKUL = "You pick up a yellow skull key.";
GOTREDSKUL = "You pick up a red skull key.";
GOTINVIS = "Partial Invisibility!";
GOTVISOR = "Light Amplification Goggles";
GOTMSPHERE = "Mega Sphere!";
GOTSHELLBOX = "Picked up a box of shells.";
GOTBACKPACK = "You got the backpack!";

// Need Key Messages
PD_BLUEO = "You need a blue key.";
PD_REDO = "You need a red key.";
PD_YELLOWO = "You need a yellow key.";
PD_BLUEK = "You need a blue key.";
PD_REDK = "You need a red key.";
PD_YELLOWK = "You need a yellow key.";
PD_BLUECO = "You need a blue key.";
PD_REDCO = "You need a red key.";
PD_YELLOWCO = "You need a yellow key.";
PD_BLUESO = "You need a blue key.";
PD_REDSO = "You need a red key.";
PD_YELLOWSO = "You need a yellow key.";

// Cheat Messages
STSTR_DQDON = "All Powerful Mode ON.";
STSTR_DQDOFF = "All Powerful Mode OFF.";
STSTR_KFAADDED = "Lots Of Goodies!";
STSTR_FAADDED = "Lots Of Goodies! (no keys)";

// Cries Of Doom Level MUSIC
PSXTITLE = "TITLE";
INTERMUS = "INTER";
PSXCRDTS = "CRDTS";
MAPMUS_0 = "FORTD";
MAPMUS_1 = "D_TUNLS";
MAPMUS_2 = "O_PRCNG";
MAPMUS_3 = "R_GAMMA";
MAPMUS_4 = "C_CMAND";
MAPMUS_25 = "U_WSPRS";

// Cries of DOOM: Episode 1 Level names
HUSTR_1 = "UAC Storage Area";
HUSTR_2 = "The Seas Ran Red With Blood";
HUSTR_3 = "Toxins Unrefined";
HUSTR_4 = "The Impossible Planet";
HUSTR_5 = "The Terror of Torment";
HUSTR_6 = "Downward Spiral";
HUSTR_7 = "Cries Of Doom";
HUSTR_8 = "The Satan Pit";

// Cries of DOOM: Episode 2 Level names
HUSTR_9 = "tbc";
HUSTR_10 = "tbc";
HUSTR_11 = "tbc";
HUSTR_12 = "tbc";
HUSTR_13 = "tbc";
HUSTR_14 = "tbc";
HUSTR_15 = "tbc";
HUSTR_16 = "tbc";

//Cries of DOOM: Episode 3 Level names
HUSTR_17 = "tbc";
HUSTR_18 = "tbc";
HUSTR_19 = "tbc";
HUSTR_20 = "tbc";
HUSTR_21 = "tbc";
HUSTR_22 = "tbc";
HUSTR_23 = "tbc";
HUSTR_24 = "tbc";

// Cries of DOOM: Episode 4 Level names
HUSTR_25 = "The Dark Place";
HUSTR_26 = "tbc";
HUSTR_27 = "tbc";
HUSTR_28 = "tbc";
HUSTR_29 = "tbc";
HUSTR_30 = "tbc";
HUSTR_31 = "tbc";
HUSTR_32 = "tbc";

// Cries of DOOM: Episode 5 Level names
HUSTR_33 = "tbc";
HUSTR_34 = "tbc";
HUSTR_35 = "tbc";
HUSTR_36 = "tbc";
HUSTR_37 = "tbc";
HUSTR_38 = "tbc";
HUSTR_39 = "tbc";
HUSTR_40 = "tbc";

// Nightmare Spectre Obituary
OB_NMSPECTREHIT = "%o was devoured by a nightmare spectre.";

// Skills
SKILL_BABY			= "Don't Hurt Me";
SKILL_EASY			= "Make Me Bleed";
SKILL_NORMAL		= "Put Me On Life Support";
SKILL_HARD			= "Kill Me To Death";
SKILL_VERYHARD      = "Nightmare";

// Menu
MNU_NEWGAME			= "New Game";
MNU_OPTIONS			= "Options";
MNU_QUITGAME		= "Quit Game";
MNU_LOADGAME		= "Load Game";
MNU_SAVEGAME		= "Save Game";

MNU_EPISODE			= "Episode";

MNU_TSGUTD			= "The Sea Gave Up The Dead";
MNU_TWGD			= "The Wicked Go Down";
MNU_TGOT			= "The Gnashing Of Teeth";
MNU_IDBD			        = "In Darkness Be Drowned";
MNU_TSP		                = "The Sinful Path";

MNU_SKILL			= "Difficulty";

// Configuration
MNU_CONFIG			= "Key Config";
MNU_MOUSE			= "Mouse";
MNU_JOYSTICK		= "Control Pad";
MNU_SOUND			= "Sound";
MNU_VIDEO			= "Video";
MNU_ADVANCED		= "Advanced";
MNU_MAIN			= "Main Menu";
User avatar
Dan_The_Noob
Posts: 880
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support
Contact:

Re: HUB world with portals to 5 different chapters?

Post by Dan_The_Noob »

Here's the Hub wiki page, hope this helps?
https://zdoom.org/wiki/Hub
User avatar
RailedRobin
Posts: 37
Joined: Thu Aug 01, 2019 5:00 pm

Re: HUB world with portals to 5 different chapters?

Post by RailedRobin »

Here's another guide for HUB worlds:

https://www.realm667.com/index.php/en/a ... g-69845146
User avatar
Sarah
Posts: 551
Joined: Wed Sep 06, 2006 12:36 pm
Preferred Pronouns: She/Her
Operating System Version (Optional): Debian 11 (bullseye), Windows 10
Location: Middle of Nowheresville Il.
Contact:

Re: HUB world with portals to 5 different chapters?

Post by Sarah »

I think "hub" is kind of the wrong word here. A hub, in ZDoom's terms, is a group of levels, called a cluster, who's state is remembered as you move between levels. This is for situations where you have an interconnected world - I believe Strife does this, for an example, you can travel all the way back to the beginning of the game and that first level will be as you left it.

In your case, wouldn't an ACS solution be called for here? In your episode select level, whichever hall/switch/portal/however you're doing it, activates the script for each episode; in this case an actual episode as ZDoom thinks of episodes.
Your episode maps progress normally, then the last map exits with another script to drop the player back at the episode select level; I believe you said MAP99.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: HUB world with portals to 5 different chapters?

Post by Graf Zahl »

The hub system won't indeed help here. This is something perfectly suited for ACS global variables, because you need to remember state across multiple levels. Then, returning to the central hub level, set it up according to these variables. I think Quake works exactly like that - it never remembers the state of the hub map, it just starts it with different settings base on which episodes have been played already.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: HUB world with portals to 5 different chapters?

Post by Hidden Hands »

Ah okay, excellent. So what exactly will I need to script up? Basically my "hub" for lack of a better word, has five doors and five switches. Each switch opens up a corresponding door and behind it is a vortex to an episode. Basically, each door teleports you to its episode (1 of 5 to choose). Beating the level needs to remember how it was left, as you said. So if you were to return, everything would still be as you left it.

Since i've never actually done anything like this before, has anyone got a rough idea how I should put it together. Only this is pretty confusing to a first timer. Also, how would i make the game start from the menu drop you in the "hub" instead of giving an episode select?

THANKS IN ADVANCE! :)
User avatar
RailedRobin
Posts: 37
Joined: Thu Aug 01, 2019 5:00 pm

Re: HUB world with portals to 5 different chapters?

Post by RailedRobin »

Since I'm kind of planning having a "hub" like Quake 1 myself, how I will do it is something like this:

Let's say HUB map is Map01. In the mapinfo, for one episode, I would do

Code: Select all

map map02
	{
		Next = "Map03"
	}

map map03 
	{
		Next = "Map04"
	}

map map04 
	{
		Next = "Map01"
	}


That way, when you finish map04 you will go to the HUB map. Now, before exiting map04, I would make an event where the player is given a custom inventory item, let's call it "EpisodeEnd1".
When entering map01 have something like this

Code: Select all

Script 1 open
  if (CheckInventory("EpisodeEnd1"))
{
 Code that ensures the exit for Episode 1 is closed
}
Simply have a script for every EpisodeEnd-item you make, and at the end of every episode you give the player that item.

To make the exits in the HUB, I'm guessing you have to use the Linedef "Teleport to map" and put your desired map. And for the episodes, define them in the mapinfo and make sure the last map in each episode links to the HUB by the next="map01" example. That way you will always return to the HUB level. However, since it isn't defined as a hub it won't save what you've done there before, that's why you get a special item that will tell the map what state to open in.

So, HUB map will have several exits which teleport to specific maps. Each of those maps will link to other maps in the mapinfo, and the last map in each episode will always lead back to the HUB.

That's how I'm planning to do it, but someone else will probably have a different way. Not sure if you'd have to use "Return" in the script, instead of "Open" though, or even "Enter" (someone wiser will correct me on this).
Post Reply

Return to “Scripting”