ENTER script isn't working.

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

ENTER script isn't working.

Post by Ceeb »

I have a map here that, in the course of exploring it, the player ends up entering another map (in a hub) to find a specific object. When the player returns to this map, an enter script checks for the object in the player's inventory. If found, it switches the sky. (To imply that the weather and time of day has changed while the player's been off elsewhere.) Unfortunantly, it doesn't work when the player returns to the map. I can puke it and it works just fine, or cheat coming from the previous map to have the object and it works, but not when returning from a hub.

Code: Select all

script 103 ENTER
{
CheckInventory("HellgateKey");
if(CheckInventory("HellgateKey") == 1)
{
changesky("WITCSKY6","FIRESK00");
}
else
{
}
}
Am I gonna have to resort to some hackery?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ENTER script isn't working.

Post by Graf Zahl »

ENTER scripts are only run when the player enters a map for the first time, not for subsequent returns in a hub.
For those you need to start a RETURN script.
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: ENTER script isn't working.

Post by Ceeb »

Graf Zahl wrote:ENTER scripts are only run when the player enters a map for the first time, not for subsequent returns in a hub.
For those you need to start a RETURN script.
Ah. Thank you, Graf. :)
Locked

Return to “Editing (Archive)”