Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ending A custom story
XeOnTricks Offline
Junior Member

Posts: 27
Threads: 12
Joined: Feb 2017
Reputation: 0
#1
Ending A custom story

so i just finished making the demo for my custom story but i cant seen to finure out how to end the demo. Can someone give me the entire script the i need to do this? and can you put in an example? might help me a bit more.
04-06-2017, 03:16 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Ending A custom story

Well, how are you trying to end it? Is it with a credits screen? Is it triggered by a collide callback or..? Smile

Discord: Romulator#0001
[Image: 3f6f01a904.png]
04-06-2017, 12:23 PM
Find
XeOnTricks Offline
Junior Member

Posts: 27
Threads: 12
Joined: Feb 2017
Reputation: 0
#3
RE: Ending A custom story

(04-06-2017, 12:23 PM)Romulator Wrote: Well, how are you trying to end it? Is it with a credits screen? Is it triggered by a collide callback or..? Smile

I'm trying to end it with start credits but it gave me an error when i put it on leave
04-06-2017, 07:25 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Ending A custom story

What's the crash? What's the script? We may be script wizards but we can't do magic. You gotta give us something to go on if we are to help you. Help us help you, you know?

04-06-2017, 09:19 PM
Find
XeOnTricks Offline
Junior Member

Posts: 27
Threads: 12
Joined: Feb 2017
Reputation: 0
#5
RE: Ending A custom story

(04-06-2017, 09:19 PM)Mudbill Wrote: What's the crash? What's the script? We may be script wizards but we can't do magic. You gotta give us something to go on if we are to help you. Help us help you, you know?

void OnStart()
{
PlayMusic("01_amb_darkness.ogg", true, 0.9, 0, 1, false);

SetEntityPlayerInteractCallback("Bedroom_1", "DoorMessage_1", false);

SetEntityPlayerInteractCallback("Bedroom_2", "DoorMessage_2", false);

SetEntityPlayerInteractCallback("Bedroom_3", "DoorMessage_3", false);

SetEntityPlayerInteractCallback("MasterBed_1", "DoorMessage_4", false);

SetEntityPlayerInteractCallback("StorageDoor_1", "DoorMessage_5", false);

SetEntityPlayerInteractCallback("Kitchen", "DoorMessage_6", false);

AddUseItemCallback("", "Key_2", "Masterbed_1", "KeyFunc", true);

AddEntityCollideCallback("Player", "SuitorArea_1", "EnemySpawn", false, 1);

AddEntityCollideCallback("Player", "MonsterArea_1", "EnemySpawn_1", false, 1);

AddUseItemCallback("", "Key_3", "mansion_9", "DoorKey", true);

AddEntityCollideCallback("Player", "AreaCollide_1", "Message", true, 1);

AddUseItemCallback("", "Key_4", "StorageDoor_1", "UnlockDoor", true);

AddEntityCollideCallback("Player", "MonsterArea", "Monster", true, 1);
}




void Monster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Monster", true);

ShowEnemyPlayerPosition("Player");
}




void UnlockDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);

PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);

RemoveItem("Key_4");
}





void Message(string &in asParent, string &in asChild, int alState)
{
AddQuest("Journal", "Memento");
}




void DoorKey(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);

PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);

RemoveItem("Key_3");
}




void EnemySpawn_1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Demon_1", true);

ShowEnemyPlayerPosition("Player");
}




void EnemySpawn(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Suitor_1", true);

ShowEnemyPlayerPosition("Player");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_1", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_2", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_3", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_4", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_5", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_6", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_7", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_8", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_9", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_10", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_11", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_12", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_13", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_14", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_15", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_16", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_17", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_18", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_19", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_20", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_21", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_22", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_23", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_24", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_25", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_26", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_27", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_28", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_29", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_30", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_31", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_32", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_33", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_34", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_35", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_36", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_37", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_38", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_39", 0.001f, "");

AddEnemyPatrolNode("Suitor_1", "PathNodeArea_40", 0.001f, "");
}




void DoorMessage_1(string &in asEntity)
{
SetMessage("Messages", "DoorEntry_1", 0.00f);
}


void DoorMessage_2(string &in asEntity)
{
SetMessage("Messages", "DoorEntry_2", 0.00f);
}


void DoorMessage_3(string &in asEntity)
{
SetMessage("Messages", "DoorEntry_3", 0.00f);
}


void DoorMessage_4(string &in asEntity)
{
SetMessage("Messages", "DoorEntry_4", 0.00f);
}


void DoorMessage_5(string &in asEntity)
{
SetMessage("Messages", "DoorEntry_5", 0.00f);
}


void DoorMessage_6(string &in asEntity)
{
SetMessage("Messages", "DoorEntry_6", 0.00f);
}




void KeyFunc(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);

PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);

RemoveItem("Key_2");
}




void OnEnter()
{



}




void OnLeave()
{

StartCredits("ending_alexander.ogg", "Messages", "EndDemo", 1);

}


FATAL ERROR: Could not load script file ''
custom_stories/MyLastWords/maps/MyLastWords.hps'!
main (241, 6) : ERR : No matching signatures to 'StartCredits(string@%,
string@&, string@&, const uint)'
(This post was last modified: 04-07-2017, 11:50 AM by XeOnTricks.)
04-07-2017, 11:44 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#6
RE: Ending A custom story

The StartCredits script is supposed to be this:

PHP Code: (Select All)
void StartCredits(stringasMusicbool abLoopMusicstringasTextCatstringasTextEntryint alEndNum); 

You've forgotten the second argument, the bool. That's why it can't find the "signature" for the script and crashes.

Try:

PHP Code: (Select All)
StartCredits("ending_alexander.ogg"true"Messages""EndDemo"1); 

04-07-2017, 04:12 PM
Find
XeOnTricks Offline
Junior Member

Posts: 27
Threads: 12
Joined: Feb 2017
Reputation: 0
#7
RE: Ending A custom story

(04-07-2017, 04:12 PM)Mudbill Wrote: The StartCredits script is supposed to be this:

PHP Code: (Select All)
void StartCredits(stringasMusicbool abLoopMusicstringasTextCatstringasTextEntryint alEndNum); 

You've forgotten the second argument, the bool. That's why it can't find the "signature" for the script and crashes.

Try:

PHP Code: (Select All)
StartCredits("ending_alexander.ogg"true"Messages""EndDemo"1); 

void OnEnter()
{



}




void OnLeave()
{

StartCredits("ending_alexander.ogg", true, "Messages", "EndDemo", 1);

}



i did what you told me but now i'm getting another error. when i exit the map it says it cannot load the other map but i never made one either, sorry, i'm pretty bad at explaining this but all i wanted it to do was open the credit screen and then do it's thing saying it's only a demo.
04-07-2017, 11:03 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#8
RE: Ending A custom story

How are you leaving the map? If you're leaving through a level door without an assigned map, it will crash. If you're just going to end the game when you leave the door instead of actually loading another map, then just select the current map as the destination.

04-08-2017, 04:20 AM
Find
XeOnTricks Offline
Junior Member

Posts: 27
Threads: 12
Joined: Feb 2017
Reputation: 0
#9
RE: Ending A custom story

(04-08-2017, 04:20 AM)Mudbill Wrote: How are you leaving the map? If you're leaving through a level door without an assigned map, it will crash. If you're just going to end the game when you leave the door instead of actually loading another map, then just select the current .p as the destination.

so are you saying to mark the first map as the destination? which i did but the credits didnt show up it just put me back into the map. Im wondering what im doing wrong .
04-08-2017, 06:31 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#10
RE: Ending A custom story

I suppose putting the destination to the same map won't trigger the OnLeave callback. Try setting it to a different map.

04-09-2017, 11:09 PM
Find




Users browsing this thread: 2 Guest(s)