Frictional Games Forum (read-only)
[SCRIPT] Loading Screen text - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Loading Screen text (/thread-11865.html)



Loading Screen text - teddan50 - 12-15-2011

Hello,

I wondered if it is possible to have different loading screen texts for different doors in a map?

What I mean by that is if you have a map with 2 different level doors, can you make it so when you go through door1 loadscreen1 appears, and when you go through door2 loadscreen2 appears.



RE: Loading Screen text - palistov - 12-15-2011

Yes. I've done it before in a test map. Use a local variable to track which door the player used. Then use that information to select which loading text to use. Here's an simple example of the script you'd probably use.


PHP Code:
void OnStart()
{
    
SetLocalVarInt("doorUsed"0);
    
SetEntityPlayerInteractCallback("door_1""doorInteract"false);
    
SetEntityPlayerInteractCallback("door_1""doorInteract"false);
}

void doorInteract(string &in entityName)
{
    if(
entityName == "door_1"SetLocalVarInt("doorUsed"1);
    if(
entityName == "door_2"SetLocalVarInt("doorUsed"2);
}
void OnLeave()
{
    switch(
GetLocalVarInt("doorUsed"))    
    {
        case 
1:
            
SetupLoadScreen("loadTextCat""loadTextEntry_1"0"img1.jpg");
        break;
        case 
2:
            
SetupLoadScreen("loadTextCat""loadTextEntry_2"0"img2.jpg");
        break;
    }




RE: Loading Screen text - teddan50 - 12-15-2011

(12-15-2011, 09:02 AM)palistov Wrote: Yes. I've done it before in a test map. Use a local variable to track which door the player used. Then use that information to select which loading text to use. Here's an simple example of the script you'd probably use.


PHP Code:
void OnStart() 

SetLocalVarInt("doorUsed"0); 
SetEntityPlayerInteractCallback("door_1""doorInteract"false); 
SetEntityPlayerInteractCallback("door_1""doorInteract"false); 


void doorInteract(string &in entityName

if(
entityName == "door_1"SetLocalVarInt("doorUsed"1); 
if(
entityName == "door_2"SetLocalVarInt("doorUsed"2); 

void OnLeave() 

switch(
GetLocalVarInt("doorUsed")) 

case 
1
SetupLoadScreen("loadTextCat""loadTextEntry_1"0"img1.jpg"); 
break; 
case 
2
SetupLoadScreen("loadTextCat""loadTextEntry_2"0"img2.jpg"); 
break; 




Thank you! That makes sence...