- Home /
How can I make a quest system?
This question is still not fully answered
Please tell me how to make a simple script that allows certain text to appear and dissapear after some time. I would also need a checkpoint script. This is an example:
- Add following text: "Private what are you doing? Come back to the ship this instant... Ahh! Stay away, no!"
- Wait 2.5
- Remove the text
- Wait 0.5
- Add following text: "Private, you're on your own from now on. I've hidden in the ship's cargo storage and will try to start contact with you again once I will found a safer place."
- Wait 3.5
- Remove the text
- Wait 0.5
- Add a text that says "Missions: find a secured area on apparently abandoned planet"
- Place a preset mark on the map and give the player a set amount of time to reach it
- Delete the timer when player reached mark and add more text
I know this is possible but please, give me something to work on, I'm rather new to scripting but if I have a template I could work on it. Please?
Statement gave you a template, which is kind of what you're asking for... I'd recommend giving him the green check mark... $$anonymous$$aybe ask the other part in another question, grouping questions is a bad habit...
Please, if you're gonna copy & paste a script as an example, do explain a bit? XD
Hmm you're right Justin, I gave him the green mark, but this is not all I needed. I didn't really group it, I only asked several questions, and he asnwered only a single question.
That's what I mean though, you need to seperate your questions, even if it means you have 3-5 different questions lined up on the page... I've seen it done multiple times =). Have a good day man!
Actually, I don't feel my answer ought to be marked as accepted answer. I only addressed the first issue. If you can uncheck it I'll delete the answer.
Answer by Statement · Dec 29, 2010 at 03:07 PM
A simple solution might be to use co-routines.
private var text : String = String.Empty;
function Narrative() { text = "Private what are you doing? ... (cut out)"; yield WaitForSeconds(2.5f); text = String.Empty; yield WaitForSeconds(0.5f);
text = "Private, you're on your own ... (cut out)";
yield WaitForSeconds(3.5f);
text = String.Empty;
yield WaitForSeconds(0.5f);
}
function OnGUI() { if (GUILayout.Button("Start Narrative")) { StartCoroutine("Narrative"); } GUILayout.Label(text); }
Nice, but doesn't cover all what I need. Still thx this is a nice start
Well, what do you need? "Please tell me how to make a simple script that allows certain text to appear and dissapear after some time."
Answer by Kristijan · Dec 29, 2010 at 03:14 PM
Hmm
I See
That's actually quite nice
What confuses me is "Narrative", as Narrator, as voice or is it just a silly name for a text command?
Anyways, what I need is to be able to actually put the text onto the screen as soon as you start the game, and then continue changing it. I've already added music and built most of the terrain etc., but I still need the conversations to actually work, can you help me a bit more plz?
Ohh ya, GUILayout, how does that function? I've always used GUItext and 3dtext for now never quite used a Layour, i'm quite new to Unity
The string.Empty, that means that the script should be located in an empty object, right? Coz I already made that and copy pasted this script inside, but I still need what I've written above
"What confuses me is "Narrative", as Narrator, as voice or is it just a silly name for a text command?" It's a "silly" name for a function that handle the narrative.
Rate? Your downvote? Somebody probably didn't like you post a comment in an answer.