diff --git a/Content/ChoiceWidget.uasset b/Content/ChoiceWidget.uasset index 5f192a7..0768f00 100644 Binary files a/Content/ChoiceWidget.uasset and b/Content/ChoiceWidget.uasset differ diff --git a/Content/FirstPersonCharacter.uasset b/Content/FirstPersonCharacter.uasset index a30bbb2..0bfa9bf 100644 Binary files a/Content/FirstPersonCharacter.uasset and b/Content/FirstPersonCharacter.uasset differ diff --git a/Content/Geometry/Meshes/1M_Cube_Chamfer.uasset b/Content/Geometry/Meshes/1M_Cube_Chamfer.uasset index cb1abf9..e9c982a 100644 Binary files a/Content/Geometry/Meshes/1M_Cube_Chamfer.uasset and b/Content/Geometry/Meshes/1M_Cube_Chamfer.uasset differ diff --git a/Content/Geometry/characters/transpHighlight.uasset b/Content/Geometry/characters/transpHighlight.uasset index e492128..2d5c697 100644 Binary files a/Content/Geometry/characters/transpHighlight.uasset and b/Content/Geometry/characters/transpHighlight.uasset differ diff --git a/Content/NPC_BP.uasset b/Content/NPC_BP.uasset index d65b20a..5a55f14 100644 Binary files a/Content/NPC_BP.uasset and b/Content/NPC_BP.uasset differ diff --git a/Content/train.umap b/Content/train.umap index c6421e0..f38dbed 100644 Binary files a/Content/train.umap and b/Content/train.umap differ diff --git a/Content/train_BuiltData.uasset b/Content/train_BuiltData.uasset index 56dc39f..a4cc444 100644 Binary files a/Content/train_BuiltData.uasset and b/Content/train_BuiltData.uasset differ diff --git a/Source/SevenStars/NPC.cpp b/Source/SevenStars/NPC.cpp index d439626..503c36a 100644 --- a/Source/SevenStars/NPC.cpp +++ b/Source/SevenStars/NPC.cpp @@ -8,10 +8,299 @@ ANPC::ANPC() PrimaryActorTick.bCanEverTick = true; } +FString ANPC::GetQuestionLeft() +{ + if (NPC_Name == "Zyxel") { + if (NPC_State == 0) + return ZyxelQuestion0_0; + else if (NPC_State == 1) + return ZyxelQuestion1_0; + else if (NPC_State == 2) + return ZyxelQuestion2_0; + } + else if (NPC_Name == "Arthrum") { + if (NPC_State == 0) + return ArthrumQuestion0_0; + else if (NPC_State == 1) + return ArthrumQuestion1_0; + else if (NPC_State == 2) + return ArthrumQuestion2_0; + } + else if (NPC_Name == "Naioli") { + if (NPC_State == 0) + return NaioliQuestion0_0; + else if (NPC_State == 1) + return NaioliQuestion1_0; + else if (NPC_State == 2) + return NaioliQuestion2_0; + } + return ""; +} + +FString ANPC::GetQuestionRight() +{ + if (NPC_Name == "Zyxel") { + if (NPC_State == 0) + return ZyxelQuestion0_1; + else if (NPC_State == 1) + return ZyxelQuestion1_1; + else if (NPC_State == 2) + return ZyxelQuestion2_1; + } + else if (NPC_Name == "Arthrum") { + if (NPC_State == 0) + return ArthrumQuestion0_1; + else if (NPC_State == 1) + return ArthrumQuestion1_1; + else if (NPC_State == 2) + return ArthrumQuestion2_1; + } + else if (NPC_Name == "Naioli") { + if (NPC_State == 0) + return NaioliQuestion0_1; + else if (NPC_State == 1) + return NaioliQuestion1_1; + else if (NPC_State == 2) + return NaioliQuestion2_1; + } + return ""; +} + +FString ANPC::GetDialogue(bool Left) +{ + if (NPC_Name == "Zyxel") { + if (NPC_State == 0) + return GetDialogue_Zyxel(0, Left); + if (NPC_State == 1) + return GetDialogue_Zyxel(1, Left); + if (NPC_State == 2) + return GetDialogue_Zyxel(2, Left); + } + else if (NPC_Name == "Arthrum") { + if (NPC_State == 0) + return GetDialogue_Arthrum(0, Left); + if (NPC_State == 1) + return GetDialogue_Arthrum(1, Left); + if (NPC_State == 2) + return GetDialogue_Arthrum(2, Left); + } + else if (NPC_Name == "Naioli") { + if (NPC_State == 0) + return GetDialogue_Naioli(0, Left); + if (NPC_State == 1) + return GetDialogue_Naioli(1, Left); + if (NPC_State == 2) + return GetDialogue_Naioli(2, Left); + } + return ""; +} + +FString ANPC::GetDialogue_Zyxel(int index, bool Left) +{ + FString ret = ""; + if (index == 0 && Left) { + ret = ZyxelState0_0[NPC_CurrentIndexLeft]; + if (NPC_CurrentIndexLeft < ZyxelState0_0.Num() - 1) + NPC_CurrentIndexLeft++; + } + else if (index == 0 && !Left) { + ret = ZyxelState0_1[NPC_CurrentIndexRight]; + if (NPC_CurrentIndexRight < ZyxelState0_1.Num() - 1) + NPC_CurrentIndexRight++; + } + else if (index == 1 && Left) { + ret = ZyxelState1_0[NPC_CurrentIndexLeft]; + if (NPC_CurrentIndexLeft < ZyxelState1_0.Num() - 1) + NPC_CurrentIndexLeft++; + } + else if (index == 1 && !Left) { + ret = ZyxelState1_1[NPC_CurrentIndexRight]; + if (NPC_CurrentIndexRight < ZyxelState1_1.Num() - 1) + NPC_CurrentIndexRight++; + } + else if (index == 2 && Left) { + ret = ZyxelState2_0[NPC_CurrentIndexLeft]; + if (NPC_CurrentIndexLeft < ZyxelState2_0.Num() - 1) + NPC_CurrentIndexLeft++; + } + else if (index == 2 && !Left) { + ret = ZyxelState2_1[NPC_CurrentIndexRight]; + if (NPC_CurrentIndexRight < ZyxelState2_1.Num() - 1) + NPC_CurrentIndexRight++; + } + return ret; +} + +FString ANPC::GetDialogue_Arthrum(int index, bool Left) +{ + FString ret = ""; + if (index == 0 && Left) { + ret = ArthrumState0_0[NPC_CurrentIndexLeft]; + if (NPC_CurrentIndexLeft < ArthrumState0_0.Num() - 1) + NPC_CurrentIndexLeft++; + } + else if (index == 0 && !Left) { + ret = ArthrumState0_1[NPC_CurrentIndexRight]; + if (NPC_CurrentIndexRight < ArthrumState0_1.Num() - 1) + NPC_CurrentIndexRight++; + } + else if (index == 1 && Left) { + ret = ArthrumState1_0[NPC_CurrentIndexLeft]; + if (NPC_CurrentIndexLeft < ArthrumState1_0.Num() - 1) + NPC_CurrentIndexLeft++; + } + else if (index == 1 && !Left) { + ret = ArthrumState1_1[NPC_CurrentIndexRight]; + if (NPC_CurrentIndexRight < ArthrumState1_1.Num() - 1) + NPC_CurrentIndexRight++; + } + else if (index == 2 && Left) { + ret = ArthrumState2_0[NPC_CurrentIndexLeft]; + if (NPC_CurrentIndexLeft < ArthrumState2_0.Num() - 1) + NPC_CurrentIndexLeft++; + } + else if (index == 2 && !Left) { + ret = ArthrumState2_1[NPC_CurrentIndexRight]; + if (NPC_CurrentIndexRight < ArthrumState2_1.Num() - 1) + NPC_CurrentIndexRight++; + } + return ret; +} + +FString ANPC::GetDialogue_Naioli(int index, bool Left) +{ + FString ret = ""; + if (index == 0 && Left) { + ret = NaioliState0_0[NPC_CurrentIndexLeft]; + if (NPC_CurrentIndexLeft < NaioliState0_0.Num() - 1) + NPC_CurrentIndexLeft++; + } + else if (index == 0 && !Left) { + ret = NaioliState0_1[NPC_CurrentIndexRight]; + if (NPC_CurrentIndexRight < NaioliState0_1.Num() - 1) + NPC_CurrentIndexRight++; + } + else if (index == 1 && Left) { + ret = NaioliState1_0[NPC_CurrentIndexLeft]; + if (NPC_CurrentIndexLeft < NaioliState0_0.Num() - 1) + NPC_CurrentIndexLeft++; + } + else if (index == 1 && !Left) { + ret = NaioliState1_1[NPC_CurrentIndexRight]; + if (NPC_CurrentIndexRight < NaioliState0_1.Num() - 1) + NPC_CurrentIndexRight++; + } + else if (index == 2 && Left) { + ret = NaioliState2_0[NPC_CurrentIndexLeft]; + if (NPC_CurrentIndexLeft < NaioliState0_0.Num() - 1) + NPC_CurrentIndexLeft++; + } + else if (index == 2 && !Left) { + ret = NaioliState2_1[NPC_CurrentIndexRight]; + if (NPC_CurrentIndexRight < NaioliState0_1.Num() - 1) + NPC_CurrentIndexRight++; + } + return ret; +} + void ANPC::BeginPlay() { Super::BeginPlay(); - + + ZyxelState0_0.Add("I don't see why I would talk about the train. What is there to talk about?"); + ZyxelState0_0.Add("Are you even sure it is a train? Don't think about it."); + ZyxelState0_0.Add("No word from me. That's not how I roll."); + ZyxelState0_0.Add("Have you seen those statues? Well you probably have, of course. But aren't they great?"); + ZyxelState0_0.Add("I like it here. It's nice."); + ZyxelState0_0.Add("You're getting on my nerves. Why don't we talk about the great statues over here?"); + + ZyxelState0_1.Add("I am Zyxel."); + ZyxelState0_1.Add("I am just Zyxel."); + ZyxelState0_1.Add("What more is there to know ?"); + ZyxelState0_1.Add("I am Zyxel and I am a passenger on the train."); + ZyxelState0_1.Add("I am Zyxel and I am a passenger on the train. That is all."); + ZyxelState0_1.Add("Being a passenger on the train is, apart from my name, the only thing that defines me."); + ZyxelState0_1.Add("Now, stop bothering me."); + + ZyxelState1_0.Add("The driver? Why would he come out? He is driving."); + ZyxelState1_0.Add("I don't wanna talk about here. I like it, that's all, and I don't see why I would think about the train driver."); + ZyxelState1_0.Add("Perhaps I am the train driver and it's an automatic train? Now, stop asking me questions. I don't care."); + ZyxelState1_0.Add("What even is a train driver?"); + ZyxelState1_0.Add("Why do you even care about the train driver?"); + ZyxelState1_0.Add("Don't you have other people to bother on this train? Who cares what or who the driver is?"); + + ZyxelState1_1.Add("These statues are a fine piece of art."); + ZyxelState1_1.Add("There is not much to do in here, but it is nice. A lot of my appreciation of life comes from looking at these statues."); + ZyxelState1_1.Add("The statues are richely sculpted and decorated."); + ZyxelState1_1.Add("Actually, they are called \"Lucy\"."); + ZyxelState1_1.Add("They came from an ancient civilisation.They were pretty popular, and I can understand why."); + ZyxelState1_1.Add("They're absolutely gorgeous."); + ZyxelState1_1.Add("These statues appease my mind. Don't ask me why. They just do."); + + ZyxelState2_0.Add("Well, now that you have changed everything, there is no way back. Let's face reality…"); + ZyxelState2_1.Add("Actually, I made those statues when I was younger. Things where different back then…"); + + + ArthrumState0_0.Add("It is the train."); + ArthrumState0_0.Add("The train is the train."); + ArthrumState0_0.Add("This is the train. You are a passenger on it."); + ArthrumState0_0.Add("The train is all there is to know. There is nothing more about it."); + ArthrumState0_0.Add("Why, I don't see why I would bother. Being a passenger on the train is the only thing that is."); + + ArthrumState0_1.Add("Hi, I am Arthrum."); + ArthrumState0_1.Add("Why, like everyone else, a passenger on the train is what I am."); + ArthrumState0_1.Add("Arthrum, passenger on the train. Hi!"); + ArthrumState0_1.Add("Passenger on the train with a name, that is Arthrum. It is what I am."); + ArthrumState0_1.Add("Arthrum, for my name. Passenger on the train for what I do."); + + ArthrumState1_0.Add("Zyxel indeed loves the statues."); + ArthrumState1_0.Add("Of course we don't know who put the statues here."); + ArthrumState1_0.Add("Of course we don't know why they put the statues here."); + ArthrumState1_0.Add("Of course we don't know who is \"they\"."); + ArthrumState1_0.Add("But why should we care, we are passengers on the train."); + ArthrumState1_0.Add("Perhaps they are his daughters."); + + ArthrumState1_1.Add("Why, that is a strange thing to say."); + ArthrumState1_1.Add("I am not the one repeating things over."); + ArthrumState1_1.Add("Passenger on the train, you are rude."); + ArthrumState1_1.Add("You are repeating yourself."); + ArthrumState1_1.Add("Why, Arthrum of his name, is talking normally."); + ArthrumState1_1.Add("It is not."); + + ArthrumState2_0.Add("Forbidden things have been said."); + ArthrumState2_0.Add("Time shall not be told. It is a forbidden thing."); + ArthrumState2_0.Add("..."); + + ArthrumState2_1.Add("Not at all. You have sinned."); + ArthrumState2_1.Add("You have destroyed everything."); + ArthrumState2_1.Add("..."); + + + NaioliState0_0.Add("Ah, well of course, the train is the train! Wanna know more? Of course you do. Though, the train is the train. That's how it is."); + NaioliState0_0.Add("Well, the train is the train. Why would anyone know more than this? Sadly, it's probably no use asking me this over again."); + NaioliState0_0.Add("Nobody knows more than what I told you! At least, not that I know of. Apparently, there's no need to know. Well, it sure is nice here but..."); + NaioliState0_0.Add("As strange as it may sound, nobody knows who's the driver. Doesn't he ever take any breaks? I don't have a key to his cabin, though."); + + NaioliState0_1.Add("It is a pleasure to meet you! My name is Naioli, and I am a passenger on the train. That's what my life is, as it is for everyone else too."); + NaioliState0_1.Add("I would like to tell you more, but that's just how it is!"); + NaioliState0_1.Add("Well, when was I born? I at least know that they told me my name was Naioli. That's an interesting one, don't you think?"); + NaioliState0_1.Add("There is nothing more I know about myself. That may sound strange, but anyway, here nobody cares about this kind of things."); + + NaioliState1_0.Add("Well, we are passenging, right? That's what is going on here. Easy to figure out, isn't it?"); + NaioliState1_0.Add("We are just passenging on the train. Is that a word? I don't know, but it sounded nice in my head. I hope I can still do that."); + + NaioliState1_1.Add("Well, we are going to the destination of the train. You are asking a lot of things that have obvious answers!"); + NaioliState1_1.Add("We're going where the train takes us. As passengers on the train, that is what we do!"); + + NaioliState2_0.Add("Well, what does that mean? I'm not sure I understand your question, it's odd. Is there a meaning to it?"); + NaioliState2_0.Add("I... I am not sure I understand. I'm just here right? That's what I do..."); + NaioliState2_0.Add("What is... \"time\"? This concept does not seem very familiar. Are you sure you're working as intended? You seem to be malfunctioning... I'm curious."); + NaioliState2_0.Add("I'm not sure what I should do or think anymore."); + + NaioliState2_1.Add("Going outside? That sounds like a bad idea. Is there something outside? Should we care? Should we even know? I'm not sure I can follow you."); + NaioliState2_1.Add("Is the outside some concept we can grasp? Is it even worth considering?"); + NaioliState2_1.Add("What if there's no outside? Would there still be an inside, then? What is the point of anything? Sure, it was easier not asking myself this, but…"); + NaioliState2_1.Add("I'm not sure what I should do or think anymore."); } void ANPC::Tick(float DeltaTime) diff --git a/Source/SevenStars/NPC.h b/Source/SevenStars/NPC.h index 006b4b1..f24b5bf 100644 --- a/Source/SevenStars/NPC.h +++ b/Source/SevenStars/NPC.h @@ -15,4 +15,64 @@ public: ANPC(); virtual void BeginPlay() override; virtual void Tick(float DeltaTime) override; + + UFUNCTION(BlueprintCallable) + FString GetQuestionLeft(); + UFUNCTION(BlueprintCallable) + FString GetQuestionRight(); + UFUNCTION(BlueprintCallable) + FString GetDialogue(bool Left); + + FString GetDialogue_Zyxel(int index, bool Left); + FString GetDialogue_Arthrum(int index, bool Left); + FString GetDialogue_Naioli(int index, bool Left); + + UPROPERTY(BlueprintReadWrite, EditAnywhere) + FString NPC_Name; + int NPC_State = 0; + int NPC_CurrentIndexLeft = 0; + int NPC_CurrentIndexRight = 0; + + TArray ZyxelState0_0; + TArray ZyxelState0_1; + TArray ZyxelState1_0; + TArray ZyxelState1_1; + TArray ZyxelState2_0; + TArray ZyxelState2_1; + + FString ZyxelQuestion0_0 = "What is this train?"; + FString ZyxelQuestion0_1 = "Who are you?"; + FString ZyxelQuestion1_0 = "Who is the train driver?"; + FString ZyxelQuestion1_1 = "About those statues..."; + FString ZyxelQuestion2_0 = "Help..."; + FString ZyxelQuestion2_1 = "Those statues... They are..."; + + TArray ArthrumState0_0; + TArray ArthrumState0_1; + TArray ArthrumState1_0; + TArray ArthrumState1_1; + TArray ArthrumState2_0; + TArray ArthrumState2_1; + + FString ArthrumQuestion0_0 = "What is this train?"; + FString ArthrumQuestion0_1 = "Who are you?"; + FString ArthrumQuestion1_0 = "About Zyxel..."; + FString ArthrumQuestion1_1 = "Your way of talking is strange"; + FString ArthrumQuestion2_0 = "Are you alright?"; + FString ArthrumQuestion2_1 = "Is everything okay?"; + + TArray NaioliState0_0; + TArray NaioliState0_1; + TArray NaioliState1_0; + TArray NaioliState1_1; + TArray NaioliState2_0; + TArray NaioliState2_1; + + FString NaioliQuestion0_0 = "What is this train?"; + FString NaioliQuestion0_1 = "Who are you?"; + FString NaioliQuestion1_0 = "What are we doing here?"; + FString NaioliQuestion1_1 = "Where are we going?"; + FString NaioliQuestion2_0 = "How long have you been here?"; + FString NaioliQuestion2_1 = "What is outside?"; + }; diff --git a/Source/SevenStars/SevenStarsGameMode.cpp b/Source/SevenStars/SevenStarsGameMode.cpp index 981af6c..095fec0 100644 --- a/Source/SevenStars/SevenStarsGameMode.cpp +++ b/Source/SevenStars/SevenStarsGameMode.cpp @@ -8,10 +8,6 @@ ASevenStarsGameMode::ASevenStarsGameMode() : Super() { - // set default pawn class to our Blueprinted character - static ConstructorHelpers::FClassFinder PlayerPawnClassFinder(TEXT("/Game/FirstPersonCPP/Blueprints/FirstPersonCharacter")); - DefaultPawnClass = PlayerPawnClassFinder.Class; - // use our custom HUD class HUDClass = ASevenStarsHUD::StaticClass(); }