[solved]How do I load plaintext text into a text object?

Get help using Construct 2

Post » Tue Jul 15, 2014 2:19 pm

@damjancd No prob mate, just spreading the knowledge !

@eli0s You might want to take a look at XML. Using a simple XML document you could probably achieve a fully functionnal dialog system. Although you could do it with tokens, it's definitely not the most effective way. The method would be quite similar, Request Project File -> Your XML file. On completed -> Load XML using Ajax.LastData. Then using an easy XPath syntax you can fetch your nodes.
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Tue Jul 15, 2014 3:20 pm

@eli0s, I would also love to find out the answer to your question :)
B
37
S
6
G
1
Posts: 301
Reputation: 2,865

Post » Tue Jul 15, 2014 3:33 pm

I will concoct an example for both of you guys. Stay tuned !
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Tue Jul 15, 2014 3:58 pm

@Magistross , thank you in advance for your help!
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Tue Jul 15, 2014 4:04 pm

This tutorial covers the basics about that..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jul 15, 2014 5:11 pm

That tutorial has pretty much everything you need. But here's my example anyway, it might explains things a bit further.

https://dl.dropboxusercontent.com/u/7004246/dialogsXml.capx
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Wed Jul 16, 2014 9:41 am

@LittleStain thank you!

@Magistross WOW! First of all, thank you very much for your example! Very funny dialogue there :D Secondly, I'd hopped that it's easier to pull something like this in C2. Never the less, your capx provides a solid foundation to understand the logic, so thank you again!!!

:)
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Wed Jul 16, 2014 1:48 pm

@eli0s XPath is probably the most daunting part. But once you get the grasp of it, you'll be writing XPath expression like it's a second nature ! Here's the W3Schools tutorial on XPath. It covers everything you need to know for node searching and stuff.
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Wed Jul 16, 2014 8:07 pm

Thanks @Magistross , I will look into it!

:)
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Sat Jul 26, 2014 10:07 am

I would also love to know an answer to this since CocoonJS and Ejecta are VERY glitchy with larger loads of text. Selecting a specific text and loading it from a txt where the whole text is stored, would be a godsend. Any AJAX magicians?

@eli0s maybe we should make a separate "how to" thread?
Last edited by damjancd on Sat Jul 26, 2014 1:57 pm, edited 1 time in total.
B
37
S
6
G
1
Posts: 301
Reputation: 2,865

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: charliesan763 and 14 guests